From mboxrd@z Thu Jan 1 00:00:00 1970 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) From: Ronnie Sahlberg Date: Sat, 12 Nov 2011 08:46:46 +1100 Message-Id: <1321048006-16451-2-git-send-email-ronniesahlberg@gmail.com> In-Reply-To: <1321048006-16451-1-git-send-email-ronniesahlberg@gmail.com> References: <1321048006-16451-1-git-send-email-ronniesahlberg@gmail.com> Subject: [Qemu-devel] [PATCH] Documentation: Add section about iSCSI LUNS to qemu-doc List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, Ronnie Sahlberg 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 -- 1.7.3.1