Bug 625888 - Can't use LVM on iSCSI LUN
Can't use LVM on iSCSI LUN
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: iscsi-initiator-utils (Show other bugs)
All Linux
low Severity high
: rc
: ---
Assigned To: Chris Leech
Red Hat Kernel QE team
Depends On:
  Show dependency treegraph
Reported: 2010-08-20 13:36 EDT by Amadeus
Modified: 2014-06-30 07:49 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-06-02 09:16:57 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Amadeus 2010-08-20 13:36:38 EDT
Description of problem:
An iSCSI target can't be used as an LVM storage pool in libvirt/virt-manager.

How reproducible:

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 14:33:13 EDT
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 09:18:27 EDT
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 16:46:50 EDT
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 13:40:43 EDT
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 06:36:16 EDT
See also bug #474833 comment #15.
Comment 8 RHEL Product and Program Management 2014-03-07 07:47:06 EST
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 Product and Program Management 2014-06-02 09:16:57 EDT
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).

Note You need to log in before you can comment on or make changes to this bug.