[Bug 1801918] Re: storage pool with persistent device names fails

 Christian Ehrhardt  1801918 at bugs.launchpad.net
Tue Nov 6 13:58:01 UTC 2018


That is in fact a LVM limitation of the default config that is targetted
at low multi-scanning and general compatibility with older setups.

You'll find in /etc/lvm/lvm.conf a disabled line like:
# filter = [ "a|.*/|" ]

That means that it will consider /dev/* but not more - in particular not
/dev/disk/by-...

If you configure lvm to consider the paths you want (it will pick up the first it finds with metadata, so I made it ONLY by path)
  filter =[ "a|/dev/disk/by-path/.*|" ]

I wasn't sure what to reload, so I restarted all (might be too much)
$ sudo systemctl restart lvm2-lvmetad.service lvm2-monitor.service lvm2-lvmpolld.service

Now things work as you expected:
$ sudo /sbin/pvcreate /dev/disk/by-path/virtio-pci-0000:00:07.0
  Physical volume "/dev/disk/by-path/virtio-pci-0000:00:07.0" successfully created.
ubuntu at cosmic-storage-pools:~$ sudo pvdisplay 
  "/dev/disk/by-path/pci-0000:00:07.0" is a new physical volume of "30.00 MiB"
  --- NEW Physical volume ---
  PV Name               /dev/disk/by-path/pci-0000:00:07.0
  VG Name               
  PV Size               30.00 MiB
  Allocatable           NO
  PE Size               0   
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               mwk7tq-fZ1C-zElW-u0Qy-KlqJ-PUK0-BVHOpz


That would fix things on the LVM side to be as libvirt expects.
Interestingly libvirt still can't start the pool now.

Haven't looked yet further, need to check what and how it parses in libvirt to get to the conclusion that it is not existing.
As now pvs looks like:
$ sudo /sbin/pvs --noheadings -o pv_name,vg_name
  /dev/disk/by-path/pci-0000:00:07.0 testpool1

** Changed in: libvirt (Ubuntu)
       Status: Invalid => Incomplete

** Changed in: lvm2 (Ubuntu)
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to lvm2 in Ubuntu.
https://bugs.launchpad.net/bugs/1801918

Title:
  storage pool with persistent device names fails

Status in libvirt package in Ubuntu:
  Incomplete
Status in lvm2 package in Ubuntu:
  Invalid

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/by-path/virtio-pci-0000:00:07.0
  $ sudo /sbin/pvs --noheadings -o pv_name,vg_name
    /dev/vdc

  It is NOT using /dev/disk/by-path/virtio-pci-0000:00:07.0 as
  instructed, but instead did the mapping to /dev/vdd and keeps that
  from now on.

  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/by-path/pci-0000:18:00.0-scsi-0:2:2:0  web2067 /dev/web2067
  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/by-path/..., the pool gets created correctly.

  According to the libvirt mailing list /dev and /dev/disk/by-path are
  supposed to work the same way.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1801918/+subscriptions



More information about the foundations-bugs mailing list