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 behavior: https://www.redhat.com/archives/libvir-list/2010-November/msg00548.html 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): How reproducible: always 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 4. reboot Actual results: 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. Expected results: The configured host storage should automatically become available upon reboot. Additional info:
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-6.2.0.872-6.el5.src.rpm (released around Apr 2011).
Created attachment 1152419 [details] proposed patch 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 libvir-list so it gets the proper attention
Patch was sent: http://www.redhat.com/archives/libvir-list/2016-May/msg00002.html
Adjustments to original patch were sent: http://www.redhat.com/archives/libvir-list/2016-May/msg01162.html reviewed, ACK'd, and pushed. commit 56057900dc53df490d953d56de1195ebfa025bdd Author: Fritz Elfert <fritz> Date: Fri May 13 11:19:09 2016 -0400 util: Remove disabling of autologin for iscsi-targets ... $ git describe 56057900dc53df490d953d56de1195ebfa025bdd v1.3.4-340-g5605790 $
I hit some conflicts backporting this to f23, so moving to f24
libvirt-1.3.3.1-4.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-b2f402a414
libvirt-1.3.3.1-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-1.3.3.1-4.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.