From patchwork Fri Nov 11 21:46:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ronnie sahlberg X-Patchwork-Id: 125300 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 548C01007D8 for ; Sat, 12 Nov 2011 08:47:47 +1100 (EST) Received: from localhost ([::1]:56794 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROywq-0004RM-Nv for incoming@patchwork.ozlabs.org; Fri, 11 Nov 2011 16:47:44 -0500 Received: from eggs.gnu.org ([140.186.70.92]:34456) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROywk-0004R1-Vi for qemu-devel@nongnu.org; Fri, 11 Nov 2011 16:47:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ROywj-0003g0-Jq for qemu-devel@nongnu.org; Fri, 11 Nov 2011 16:47:38 -0500 Received: from mail-yx0-f173.google.com ([209.85.213.173]:44080) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROywj-0003Ts-AG for qemu-devel@nongnu.org; Fri, 11 Nov 2011 16:47:37 -0500 Received: by mail-yx0-f173.google.com with SMTP id r8so4147578yen.4 for ; Fri, 11 Nov 2011 13:47:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=dHLYQpg5NYD8aT6WuefWH0/yvkL/aptaoNDo/Mke/2g=; b=GcHv/kjhsiPRw7hJa5LYrR5fgN8v0RfLeOz6Nq8fHRlWNX3lnKSaghzbaZGvDF1h5F rLAgg+G9jOfm20WwH1A+QnEONLdzllUr8S5Ad+HohAM/joSuoRIaWir2zZqZKHajottw Vyp+3DNDQhAehnmcfvBqoeDGYDuO8QRb4FLkQ= Received: by 10.68.0.136 with SMTP id 8mr27831676pbe.46.1321048056629; Fri, 11 Nov 2011 13:47:36 -0800 (PST) Received: from ronniesahlberg@gmail.com (CPE-58-166-89-236.lnse5.cht.bigpond.net.au. [58.166.89.236]) by mx.google.com with ESMTPS id d8sm33091570pbb.6.2011.11.11.13.47.30 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 11 Nov 2011 13:47:33 -0800 (PST) Received: by ronniesahlberg@gmail.com (sSMTP sendmail emulation); Sat, 12 Nov 2011 08:47:11 +1100 From: Ronnie Sahlberg To: qemu-devel@nongnu.org Date: Sat, 12 Nov 2011 08:46:46 +1100 Message-Id: <1321048006-16451-2-git-send-email-ronniesahlberg@gmail.com> X-Mailer: git-send-email 1.7.3.1 In-Reply-To: <1321048006-16451-1-git-send-email-ronniesahlberg@gmail.com> References: <1321048006-16451-1-git-send-email-ronniesahlberg@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.213.173 Cc: kwolf@redhat.com, Ronnie Sahlberg Subject: [Qemu-devel] [PATCH] Documentation: Add section about iSCSI LUNS to qemu-doc X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Add a new section about using iSCSI LUNs with qemu and provide a short example on how to set up a target and access it using the built-in initiator Signed-off-by: Ronnie Sahlberg --- qemu-doc.texi | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 53 insertions(+), 0 deletions(-) diff --git a/qemu-doc.texi b/qemu-doc.texi index 149e9bd..c1b293e 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -421,6 +421,7 @@ snapshots. * disk_images_fat_images:: Virtual FAT disk images * disk_images_nbd:: NBD access * disk_images_sheepdog:: Sheepdog disk images +* disk_images_iscsi:: iSCSI LUNs @end menu @node disk_images_quickstart @@ -695,6 +696,58 @@ qemu-img create sheepdog:@var{hostname}:@var{port}:@var{image} @var{size} qemu sheepdog:@var{hostname}:@var{port}:@var{image} @end example +@node disk_images_iscsi +@subsection iSCSI LUNs + +iSCSI is a popular protocol used to access SCSI devices across a computer +network. + +There are two different ways iSCSI devices can be used by QEMU. + +The first method is to mount the iSCSI LUN on the host, and make it appear as +any other ordinary SCSI device on the host and then to access this device as a +/dev/sd device from QEMU. How to do this differs between host OSes. + +The second method involves using the iSCSI initiator that is built into +QEMU. This provides a mechanism that works the same way regardless of which +host OS you are running QEMU on. This section will describe this second method +of using iSCSI together with QEMU. + +In QEMU, iSCSI devices are described using special iSCSI URLs + +@example +URL syntax: +iscsi://[[%]@@][:]// +@end example + +Username and password are optional and only used if your taget is set up +using CHAP authentication for access control. +Alternatively the username and passwords can also be set via environment +variables to have these not show up in the process list + +@example +export LIBISCSI_CHAP_USERNAME= +export LIBISCSI_CHAP_PASSWORD= +iscsi://// +@end example + +Howto set up a simple iSCSI target on loopback and accessing it via QEMU: +@example +Setting up a iSCSI target with one CDROM and one DISK: +tgtd --iscsi portal=127.0.0.1:3260 +tgtadm --lld iscsi --op new --mode target --tid 1 -T iqn.qemu.test +tgtadm --lld iscsi --mode logicalunit --op new --tid 1 --lun 1 \ + -b /IMAGES/disk.img --device-type=disk +tgtadm --lld iscsi --mode logicalunit --op new --tid 1 --lun 2 \ + -b /IMAGES/cd.iso --device-type=cd +tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL + +qemu -boot d -drive file=iscsi://127.0.0.1/iqn.qemu.test/1 \ + -cdrom iscsi://127.0.0.1/iqn.qemu.test/2 +@end example + + + @node pcsys_network @section Network emulation