Description of problem:
I have a setup where multiple iscsi targets are used for *both* libvirt (as a storage-pool) as well as the host system itself (as general storage). Of course, the desired autologin-mode for targets used as host storage is "automatic". However, whenever libvirtd starts, *all* targets are switched into manual mode. When the system is rebooted, then the next start fails for all the host-mounted filsystems.
I found this mail which i believe is the original reasoning for that
However: Since quite some time the mentioned behavior of iscsiadm has been changed and therefore the reasoning is obsolete. Instead, when performing discovery with iscsiadm, libvirt should use the --op nonpersistent argument in order to prevent any persistent changes in the first place, it then can safely skip the subsequent disabling of auto-login mode.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. configure an iscsi storage pool for libvirt
2. use another iscsi target as host storage with auto-logon enabled
3. startup libvirt
The configured host storage fails, because no auto-login is performed.
Depending on the mount-point subsequent services may fail, if they depend on the mounted filesystem.
The configured host storage should automatically become available upon reboot.
jferlan this seems like your area, any thoughts?
BTW: I'll try to come up with a patch over the weekend ...
My initial thought would be that changing the libvirt iSCSI backend code to utilize some new iscsiadm switch/option would only be valid if that switch option were available; otherwise, the existing mechanism would have to be used (and we'd need to document that). I don't stay current with the changes in iscsiadm, so I assume that switch would "do the right thing".
Whatever patches are developed need to take into account that an 'iscsiadm' may not have that switch. Checking for that in configure.ac is I'm sure possible, but I'm not the expert to know the "how" to do that. You will end up with "WITH_" type conditionals that would then be used in the iSCSI storage backend to decide whether or not to use the switch.
On latest RHEL6 at least the iscsiadm man page says it supports --op nonpersistent, so maybe we can use it unconditionally since we don't support RHEL5 host anymore.
If you look into iscsiadm's upstream git, you can see, that support for nonpersistent mode was added long time in March 2010 even before the original mail above was written. It just happened that - at that time - it was not yet released.
So: I'm certain, that this is supported even in older releases now (no need for a configure check!). See this commit: https://github.com/open-iscsi/open-iscsi/commit/ad873767436f1cc242f0d4a522a2fce7133795c1
Even in RHEL5.6 (checked against CentOS, because old RHEL sources are hard to find) this is supported since iscsi-initiator-utils-18.104.22.1682-6.el5.src.rpm (released around Apr 2011).
Created attachment 1152419 [details]
This patch fixes the problem on my test system:
- Non-libvirt related targets stay in automatic login mode
- libvirt-related target stay in manual login mode
- The whole setup "survives" a reboot.
As I have shown in Comments 5 and 6, the used "nonpersistent" feature is generally available since ~ April 2011. Therefore, I found it unnecessary to add a configure check. (According to https://access.redhat.com/support/policy/updates/errata RHEL 5.6 is EOL (EUS for 5.6 ended July 31, 2013 - almost 3 years ago!)
Thanks for the patch! Please send it to firstname.lastname@example.org so it gets the proper attention
Patch was sent:
Adjustments to original patch were sent:
reviewed, ACK'd, and pushed.
Author: Fritz Elfert <email@example.com>
Date: Fri May 13 11:19:09 2016 -0400
util: Remove disabling of autologin for iscsi-targets
$ git describe 56057900dc53df490d953d56de1195ebfa025bdd
I hit some conflicts backporting this to f23, so moving to f24
libvirt-22.214.171.124-4.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-b2f402a414
libvirt-126.96.36.199-4.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-b2f402a414
libvirt-188.8.131.52-4.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.