iSCSI initiator iqn
Hi, I could not find any option to set iSCSI initiator iqn while using guestfish, although the underlying qemu command has this option. It appears that each time guestfish tries to connect to iSCSI LUN, a randomly generated initiator iqn is being used. This is preventing guestfish to connect to the iSCSI target in our environment as the target allows incoming connection based on the preconfigured initiator iqn. Is there way to set iSCSI initiator iqn with guestfish command? Regards Raghu
On Fri, Jul 04, 2014 at 05:43:30PM +0530, Raghu wrote:
Hi,
I could not find any option to set iSCSI initiator iqn while using guestfish, although the underlying qemu command has this option. It appears that each time guestfish tries to connect to iSCSI LUN, a randomly generated initiator iqn is being used. This is preventing guestfish to connect to the iSCSI target in our environment as the target allows incoming connection based on the preconfigured initiator iqn.
Is there way to set iSCSI initiator iqn with guestfish command?
From my (limited) understanding of iSCSI, I believe it is the case
At the API level, this is what is currently possible: http://libguestfs.org/guestfs.3.html#iscsi http://libguestfs.org/guestfs.3.html#guestfs_add_drive_opts that the target and initiator iqn's are different things. We need to pass the `-iscsi initiator-name=<initiator-iqn>' parameter. This is not supported right now, but it's certainly something which we should add. See also this section in the FAQ for how to supply patches or file bugs requesting new features: http://libguestfs.org/guestfs-faq.1.html#developers Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
Thanks Rich for your response. Perhaps, this option could be passed via an environment variable and guestfish could pass it down to qemu. I will file a bug requesting this feature. This is an absolutely necessary feature we would to like to have in order to make use of libguestfs in our work. Generally, what is the turnaround time for such feature requests to appear in a release? Meanwhile, I am thinking of the following as a workaround 1. Make use of iscsi-initiator utils ( which gets installed as part of libguestfs dependency ) to establish iscsi connection 2. This will create a device such as /dev/sdb 3. Mount the partition and execute our guestfs script as follows guestfish -m /dev/sdb1:/ -f myscript.txt Will this work without -a parameter ? Any other alternative? Thanks Raghu On 6 July 2014 16:02, Richard W.M. Jones <rjones@redhat.com> wrote:
On Fri, Jul 04, 2014 at 05:43:30PM +0530, Raghu wrote:
Hi,
I could not find any option to set iSCSI initiator iqn while using guestfish, although the underlying qemu command has this option. It appears that each time guestfish tries to connect to iSCSI LUN, a randomly generated initiator iqn is being used. This is preventing guestfish to connect to the iSCSI target in our environment as the target allows incoming connection based on the preconfigured initiator iqn.
Is there way to set iSCSI initiator iqn with guestfish command?
At the API level, this is what is currently possible:
http://libguestfs.org/guestfs.3.html#iscsi http://libguestfs.org/guestfs.3.html#guestfs_add_drive_opts
From my (limited) understanding of iSCSI, I believe it is the case that the target and initiator iqn's are different things. We need to pass the `-iscsi initiator-name=<initiator-iqn>' parameter.
This is not supported right now, but it's certainly something which we should add. See also this section in the FAQ for how to supply patches or file bugs requesting new features:
http://libguestfs.org/guestfs-faq.1.html#developers
Rich.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
On Sun, Jul 06, 2014 at 11:07:42PM +0530, Raghu wrote:
Thanks Rich for your response.
See also: https://www.redhat.com/archives/libvir-list/2014-July/msg00281.html
Perhaps, this option could be passed via an environment variable and guestfish could pass it down to qemu.
If you're using the 'direct' backend then environment variables get passed along to qemu unmodified, so you could use a qemu wrapper script which parses the environment variable and adds the appropriate '-iscsi ...' flag. http://libguestfs.org/guestfs.3.html#backend http://libguestfs.org/guestfs.3.html#qemu-wrappers The 'direct' backend is the default upstream, and in every distro except Fedora/RHEL. Fedora >= 18 & RHEL >= 7 now default to the 'libvirt' backend, but you can switch them to use the direct backend by setting a single environment variable. http://libguestfs.org/guestfs.3.html#environment-variables While it's possible to use hacks like this, it's better to fix the API properly in the long term, so please do still file an RFE bug.
I will file a bug requesting this feature. This is an absolutely necessary feature we would to like to have in order to make use of libguestfs in our work. Generally, what is the turnaround time for such feature requests to appear in a release?
Please file the bug - I'll have a look at it when I can, but it wouldn't be available as a new feature in a stable release before version 1.28 (which is due in about 2-3 months from now). http://libguestfs.org/guestfs.3.html#libguestfs-version-numbers
Meanwhile, I am thinking of the following as a workaround 1. Make use of iscsi-initiator utils ( which gets installed as part of libguestfs dependency ) to establish iscsi connection 2. This will create a device such as /dev/sdb 3. Mount the partition and execute our guestfs script as follows guestfish -m /dev/sdb1:/ -f myscript.txt
Will this work without -a parameter ? Any other alternative?
qemu wrapper is going to be much simpler -- see above. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Basically like this: (1) Save the attached file as `/tmp/qemu.wrapper'. (2) chmod +x /tmp/qemu.wrapper (3) Run: export LIBGUESTFS_BACKEND=direct export LIBGUESTFS_QEMU=/tmp/qemu.wrapper export QEMU_EXTRA_PARAMS="-iscsi initiator-name=iqn.2014-07.foo" guestfish -a iscsi://.... Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
participants (2)
-
Raghu -
Richard W.M. Jones