storage pool with persistent device names fails
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libvirt (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
lvm2 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
lvm2 tools do not store by-path values in their config.
That can drive scripts/tools (like the libvirt case here) mad.
Simplified example:
$ sudo /sbin/pvcreate /dev/disk/
$ sudo /sbin/pvs --noheadings -o pv_name,vg_name
/dev/vdc
It is NOT using /dev/disk/
I know that "inside" lvm all that is done via metadata and it won't matter.
But tools around it get confused.
Not sure yet if it is a real issue, or just "works as designed".
--- started as libvirt issue - keeping old desc below ---
I am trying to create a logical volume storage pool with persistent
device names for the block devices, because I can't/don't want to ensure
that /dev/sd* names are persistent through reboots.
virsh # pool-define-as web2067 logical - -
/dev/disk/
virsh # pool-build web2067
These two steps work as expected and the pv and the vg get created, but
when I try to start the pool I get the following error:
virsh # pool-start web2067
error: Failed to start pool web2067
error: unsupported configuration: cannot find any matching source
devices for logical volume group 'web2067'
If I do the same steps just with /dev/sdX instead of
/dev/disk/
According to the libvirt mailing list /dev and /dev/disk/by-path are
supposed to work the same way.
Hi Jan,
to reproduce I started a KVM guest with two extra disks:
$ sudo qemu-img create -f qcow2 /var/lib/ libvirt/ images/ test-storage- pools-1. img 30M libvirt/ images/ test-storage- pools-2. img 30M var/lib/ libvirt/ images/ test-storage- pools-1. img'/> backingStore/ > var/lib/ libvirt/ images/ test-storage- pools-2. img'/> backingStore/ >
$ sudo qemu-img create -f qcow2 /var/lib/
Add to the guest like:
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/
<
<target dev='vdc' bus='virtio'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/
<
<target dev='vdd' bus='virtio'/>
</disk>
This is fix on PCI slot 7 and 8. pci-0000: 00:07.0 -> ../../vdc pci-0000: 00:08.0 -> ../../vdd
So on by-path I can rely on
lrwxrwxrwx 1 root root 9 Nov 6 12:02 virtio-
lrwxrwxrwx 1 root root 9 Nov 6 12:02 virtio-
Since https:/ /libvirt. org/storage. html#StorageBac kendLogical doesn't need host and dir path I didn't define those. pci-0000: 00:07.0 --target /dev/testpoolVG testpool1< /name> pci-0000: 00:07.0' /> /dev/testpoolVG </path>
I used:
$ virsh pool-define-as --print-xml testpool1 logical --source-dev virtio-
<pool type='logical'>
<name>
<source>
<device path='virtio-
</source>
<target>
<path>
</target>
</pool>
$ sudo virsh pool-define-as testpool1 logical --source-dev virtio- pci-0000: 00:07.0 --target /dev/testpoolVG
$ sudo virsh pool-define-as testpool2 logical --source-dev /dev/vdd --target /dev/testpoolVG2
Already on pool-build I see it missing the by path device pci-0000: 00:07.0
$ sudo virsh pool-build testpool1
error: Failed to build pool testpool1
error: Storage pool probe failed: Failed to create filesystem probe for device virtio-
$ sudo virsh pool-build testpool2
Pool testpool2 built
The same is true if I pool-build one defined with the syntax you used: pci-0000: 00:08.0 /dev/testpoolVG2
$ sudo virsh pool-define-as testpool2 logical - - virtio-
Related log message of the daemon: ndBLKIDFindEmpt y:3130 : Storage pool probe failed: Failed to create filesystem probe for device virtio- pci-0000: 00:07.0
libvirtd[6311]: 6315: error : virStorageBacke
If we enable debug we see this before: ndBLKIDFindEmpt y:3125 : Probe for existing filesystem/ partition format LVM2_member on device virtio- pci-0000: 00:07.0
debug: virStorageBacke
In the case of the working /dev/vdd it uses a full path in this call: ndBLKIDFindEmpt y:3125 : Probe for existing filesystem/ partition format LVM2_member on device /dev/vdd
debug: virStorageBacke
Now it is not the code of libvirt on pool-build that "looses" that information. pci-0000: 00:07.0' /> by-path/ virtio- pci-0000: 00:07.0 --target /dev/testpoolVG
No if we look more carefully at the XML that was defined it is:
<device path='virtio-
Silly me :-/ I forgot the full path in the definition
Redefine as:
$ sudo virsh pool-define-as testpool1 logical --source-dev /dev/disk/
Yeah that looks better: testpool1< /name> d85ec218- 9b82-4f99- 8b75-6b11840d06 b5</uuid> >0</capacity> >0</allocation. ..
$ sudo virsh pool-dumpxml testpool1
<pool type='logical'>
<name>
<uuid>
<capacity unit='bytes'
<allocation unit='bytes'