qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Documentation: Add section about iSCSI LUNS to qemu-doc
  2011-11-11 21:46 [Qemu-devel] (no subject) Ronnie Sahlberg
@ 2011-11-11 21:46 ` Ronnie Sahlberg
  2011-11-11 22:14   ` Stefan Weil
  2011-11-11 23:11   ` Andreas Färber
  0 siblings, 2 replies; 7+ messages in thread
From: Ronnie Sahlberg @ 2011-11-11 21:46 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, 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 <ronniesahlberg@gmail.com>
---
 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://[<username>[%<password>]@@]<host>[:<port>]/<target-iqn-name>/<lun>
+@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=<username>
+export LIBISCSI_CHAP_PASSWORD=<password>
+iscsi://<host>/<target-iqn-name>/<lun>
+@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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH] Documentation: Add section about iSCSI LUNS to qemu-doc
  2011-11-11 21:46 ` [Qemu-devel] [PATCH] Documentation: Add section about iSCSI LUNS to qemu-doc Ronnie Sahlberg
@ 2011-11-11 22:14   ` Stefan Weil
  2011-11-11 23:11   ` Andreas Färber
  1 sibling, 0 replies; 7+ messages in thread
From: Stefan Weil @ 2011-11-11 22:14 UTC (permalink / raw)
  To: Ronnie Sahlberg; +Cc: kwolf, qemu-devel

Hi,

I have only some small remarks, see my inline comments below.

Am 11.11.2011 22:46, schrieb 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 <ronniesahlberg@gmail.com>
> ---
> 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://[<username>[%<password>]@@]<host>[:<port>]/<target-iqn-name>/<lun>
> +@end example
> +
> +Username and password are optional and only used if your taget is set up

taget -> target

> +using CHAP authentication for access control.
> +Alternatively the username and passwords can also be set via environment

password instead of passwords?

> +variables to have these not show up in the process list
> +
> +@example
> +export LIBISCSI_CHAP_USERNAME=<username>
> +export LIBISCSI_CHAP_PASSWORD=<password>
> +iscsi://<host>/<target-iqn-name>/<lun>
> +@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 \

There is no qemu executable any longer. You may choose from
a large number of executable names, e.g. qemu-system-i386.

> + -cdrom iscsi://127.0.0.1/iqn.qemu.test/2
> +@end example
> +
> +
> +
> @node pcsys_network
> @section Network emulation

Thanks for providing this documentation.

Kind regards,

Stefan Weil

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH] Documentation: Add section about iSCSI LUNS to qemu-doc
  2011-11-11 21:46 ` [Qemu-devel] [PATCH] Documentation: Add section about iSCSI LUNS to qemu-doc Ronnie Sahlberg
  2011-11-11 22:14   ` Stefan Weil
@ 2011-11-11 23:11   ` Andreas Färber
  2011-11-12  0:41     ` ronnie sahlberg
  1 sibling, 1 reply; 7+ messages in thread
From: Andreas Färber @ 2011-11-11 23:11 UTC (permalink / raw)
  To: Ronnie Sahlberg; +Cc: kwolf, qemu-devel

Hi,

Am 11.11.2011 22:46, schrieb 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 <ronniesahlberg@gmail.com>
> ---
>  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

> +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

Having an example is always good.

These commands and parameters don't seem familiar to me, having worked
with iSCSI on Solaris, so this part of the example seems
platform-specific. Could you mention that this example is for Linux? Or
what specific upstream project these tools can be obtained from?

Please also remember to choose a subject, a recurring fault. ;)

Thanks,

Andreas

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Qemu-devel] Patch to add iSCSI documentation
@ 2011-11-12  0:06 Ronnie Sahlberg
  2011-11-12  0:06 ` [Qemu-devel] [PATCH] Documentation: Add section about iSCSI LUNS to qemu-doc Ronnie Sahlberg
  0 siblings, 1 reply; 7+ messages in thread
From: Ronnie Sahlberg @ 2011-11-12  0:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf

List,

Please find an updated patch to add documentation for iSCSI and a simple
example how to set up a target to use with qemu.

It addresses the issues rised by the review of the first patch.

regards
ronnie sahlberg

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH] Documentation: Add section about iSCSI LUNS to qemu-doc
  2011-11-12  0:06 [Qemu-devel] Patch to add iSCSI documentation Ronnie Sahlberg
@ 2011-11-12  0:06 ` Ronnie Sahlberg
  2011-11-14 10:06   ` Kevin Wolf
  0 siblings, 1 reply; 7+ messages in thread
From: Ronnie Sahlberg @ 2011-11-12  0:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, 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 <ronniesahlberg@gmail.com>
---
 qemu-doc.texi |   56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 56 insertions(+), 0 deletions(-)

diff --git a/qemu-doc.texi b/qemu-doc.texi
index 149e9bd..1d37a91 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://[<username>[%<password>]@@]<host>[:<port>]/<target-iqn-name>/<lun>
+@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=<username>
+export LIBISCSI_CHAP_PASSWORD=<password>
+iscsi://<host>/<target-iqn-name>/<lun>
+@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 RedHat 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
 
-- 
1.7.3.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH] Documentation: Add section about iSCSI LUNS to qemu-doc
  2011-11-11 23:11   ` Andreas Färber
@ 2011-11-12  0:41     ` ronnie sahlberg
  0 siblings, 0 replies; 7+ messages in thread
From: ronnie sahlberg @ 2011-11-12  0:41 UTC (permalink / raw)
  To: Andreas Färber; +Cc: kwolf, qemu-devel

Hi,

On Sat, Nov 12, 2011 at 10:11 AM, Andreas Färber <andreas.faerber@web.de> wrote:
> Hi,
>
> Am 11.11.2011 22:46, schrieb 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 <ronniesahlberg@gmail.com>
>> ---
>>  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
>
>> +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
>
> Having an example is always good.
>
> These commands and parameters don't seem familiar to me, having worked
> with iSCSI on Solaris, so this part of the example seems
> platform-specific. Could you mention that this example is for Linux? Or
> what specific upstream project these tools can be obtained from?
>

I have mentioned now that this is Linux STGT target and that it comes
in the scsi-target-utils package.

Maybe add an example for Solaris too?
I don't use Solaris myself so I dont know how to configure iSCSI
target on Solaris.

Does OpenSolaris come with the same iSCSI target as Real-Solaris? If
so I could set it up in a VM and
try to figure out what a Solaris example could look like.


IMHO, examples are useful to get people up and running real quick to
get to a point where one they start experimenting.
straight away without having to search/learn lots of stuff first.



> Please also remember to choose a subject, a recurring fault. ;)

I know, I am completely hopless with 'git-send-email' :-)

regards
ronnie sahlberg

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH] Documentation: Add section about iSCSI LUNS to qemu-doc
  2011-11-12  0:06 ` [Qemu-devel] [PATCH] Documentation: Add section about iSCSI LUNS to qemu-doc Ronnie Sahlberg
@ 2011-11-14 10:06   ` Kevin Wolf
  0 siblings, 0 replies; 7+ messages in thread
From: Kevin Wolf @ 2011-11-14 10:06 UTC (permalink / raw)
  To: Ronnie Sahlberg; +Cc: qemu-devel

Am 12.11.2011 01:06, schrieb 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 <ronniesahlberg@gmail.com>

Thanks, applied to the block-stable branch (for 1.0)

Kevin

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-11-14 10:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-12  0:06 [Qemu-devel] Patch to add iSCSI documentation Ronnie Sahlberg
2011-11-12  0:06 ` [Qemu-devel] [PATCH] Documentation: Add section about iSCSI LUNS to qemu-doc Ronnie Sahlberg
2011-11-14 10:06   ` Kevin Wolf
  -- strict thread matches above, loose matches on Subject: below --
2011-11-11 21:46 [Qemu-devel] (no subject) Ronnie Sahlberg
2011-11-11 21:46 ` [Qemu-devel] [PATCH] Documentation: Add section about iSCSI LUNS to qemu-doc Ronnie Sahlberg
2011-11-11 22:14   ` Stefan Weil
2011-11-11 23:11   ` Andreas Färber
2011-11-12  0:41     ` ronnie sahlberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).