Bug 625888

Summary: Can't use LVM on iSCSI LUN
Product: Red Hat Enterprise Linux 5 Reporter: Amadeus <sha256sum>
Component: iscsi-initiator-utilsAssignee: Chris Leech <cleech>
Status: CLOSED WONTFIX QA Contact: Red Hat Kernel QE team <kernel-qe>
Severity: high Docs Contact:
Priority: low    
Version: 5.7CC: coughlan, igeorgex, lvm-team, mathieu-acct, mchristi, prajnoha, ricardo.arguello, sha256sum, xen-maint
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-02 13:16:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Amadeus 2010-08-20 17:36:38 UTC
Description of problem:
An iSCSI target can't be used as an LVM storage pool in libvirt/virt-manager.

How reproducible:
Everytime.

Steps to Reproduce:
1. Create iSCSI target in a SAN
2. Create a LUN on the target
3. Connect the LUN and set it to automatic connect at boot up, and put an LVM partition in it with a Volume Group and a Logical Volume.
4. Select Add "LVM storage pool" in virt-manager and hit ok.
5. Reboot.
  
Actual results:
It can't add the LVM as LVM storge pool, and after reboot the Volume Group is not available. Have to do "vgchange -ya "vg name".

Expected results:
RHEL should boot up, and libvirt should be able to an LVM partition as storage poll even if it is in an iSCSI target.

Additional info:
The problem is the boot order
S02lvm2-monitor -> ../init.d/lvm2-monitor*
S07iscsid -> ../init.d/iscsid*
S13iscsi -> ../init.d/iscsi*
S97libvirtd -> ../init.d/libvirtd*

LVM is initialised before iscsi.

Red Hat support suggests using netfs in fstab or putting "vgchange -ya vg_name" and "lvchange -ya lv_name" in rc.local, but both of these suggests won't work for KVM guests, as they may not be mounted from the host.

Either it is a bug, or it should be written in the manual that LVM in iSCSI is not supported in virt-manager/libvirt.

Comment 1 Cole Robinson 2010-08-21 18:33:13 UTC
This doesn't sound specific to virt-manager/libvirt since you point out that LVM is initialized before iSCSI. Not really sure what the fix is, so reassigning to iscsi

Comment 3 Mathieu Chouquet-Stringer 2010-10-29 13:18:27 UTC
I have the same issue on RHEL 5.5.

I have vgs and lvs used by KVM hosts and VGs are not enabled by vgchange in /etc/rc.d/rc.sysinit so when libvirtd and all start, it fails because LVs used by KVM are not up...  I think the issue is more of a lvm thing than a iSCSI vs libvirt thing...

Comment 5 Amadeus 2010-10-29 20:46:50 UTC
A very dirty workaround is to:

* create an LVM Physical Volume on the iscsi targets LUN.
pvcreate /dev/disk/by-id/device_name_here

* create an LVM Volume Group on the iscsi targets LUN.
vgcreate vg00 device_name_here

* create an LVM Logical Volume 
lvcreate --name dontdelete --size 1G vg00

* format the LV
mkfs.ext3 /dev/vg00/dontdelete
mkdir /mnt/dontdelete

* mount dontdelete on boot with netfs
/dev/vg00/dontdelete    /mnt/dontdelete         ext3    defaults,_netdev 0 0


This courses iscsi to be started up before LVM.

Tested on RHEL 5.5 and it works on reboot with KVM guests running using LV's on the iscsi target.

Comment 6 Mathieu Chouquet-Stringer 2010-10-30 17:40:43 UTC
Well in my case, the issue was a multipath configuration problem.  I thought about creating a fake volume but adding a simple entry in /etc/fstab like the following did the trick too:
none none nfs _netdev 0 0

This triggers netfs to do another vgchange.  Nfs because the script does a mount -a -t nonfs...

Comment 7 Peter Rajnoha 2012-10-22 10:36:16 UTC
See also bug #474833 comment #15.

Comment 8 RHEL Program Management 2014-03-07 12:47:06 UTC
This bug/component is not included in scope for RHEL-5.11.0 which is the last RHEL5 minor release. This Bugzilla will soon be CLOSED as WONTFIX (at the end of RHEL5.11 development phase (Apr 22, 2014)). Please contact your account manager or support representative in case you need to escalate this bug.

Comment 9 RHEL Program Management 2014-06-02 13:16:57 UTC
Thank you for submitting this request for inclusion in Red Hat Enterprise Linux 5. We've carefully evaluated the request, but are unable to include it in RHEL5 stream. If the issue is critical for your business, please provide additional business justification through the appropriate support channels (https://access.redhat.com/site/support).