From patchwork Wed Nov 23 11:44:51 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 127273 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 58E7C1007D4 for ; Wed, 23 Nov 2011 22:46:02 +1100 (EST) Received: from localhost ([::1]:48143 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTBH1-0003aC-On for incoming@patchwork.ozlabs.org; Wed, 23 Nov 2011 06:45:55 -0500 Received: from eggs.gnu.org ([140.186.70.92]:55792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTBGq-0003RY-Fc for qemu-devel@nongnu.org; Wed, 23 Nov 2011 06:45:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTBGk-0001pU-MY for qemu-devel@nongnu.org; Wed, 23 Nov 2011 06:45:44 -0500 Received: from mtagate1.uk.ibm.com ([194.196.100.161]:36170) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTBGk-0001ow-E9 for qemu-devel@nongnu.org; Wed, 23 Nov 2011 06:45:38 -0500 Received: from d06nrmr1707.portsmouth.uk.ibm.com (d06nrmr1707.portsmouth.uk.ibm.com [9.149.39.225]) by mtagate1.uk.ibm.com (8.13.1/8.13.1) with ESMTP id pANBjXmf017579 for ; Wed, 23 Nov 2011 11:45:33 GMT Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by d06nrmr1707.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pANBjWvi2633868 for ; Wed, 23 Nov 2011 11:45:33 GMT Received: from d06av08.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pANBjWOU004371 for ; Wed, 23 Nov 2011 11:45:32 GMT Received: from localhost (sig-9-79-13-177.uk.ibm.com [9.79.13.177]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id pANBjV9u004359; Wed, 23 Nov 2011 11:45:32 GMT From: Stefan Hajnoczi To: Date: Wed, 23 Nov 2011 11:44:51 +0000 Message-Id: <1322048728-26061-2-git-send-email-stefanha@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.7.1 In-Reply-To: <1322048728-26061-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1322048728-26061-1-git-send-email-stefanha@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 194.196.100.161 Cc: Kevin Wolf , Paolo Bonzini , Marcelo Tosatti , Ronnie Sahlberg Subject: [Qemu-devel] [PATCH v3 01/38] 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 From: 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 Signed-off-by: Kevin Wolf --- qemu-doc.texi | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 56 insertions(+), 0 deletions(-) diff --git a/qemu-doc.texi b/qemu-doc.texi index 149e9bd..1abba98 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,61 @@ 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 target is set up +using CHAP authentication for access control. +Alternatively the username and password 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 +This example shows how to set up an iSCSI target with one CDROM and one DISK +using the Linux STGT software target. This target is available on Red Hat based +systems as the package 'scsi-target-utils'. + +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-system-i386 -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