[libvirt] [PATCH]: vgscan before doing logical pool discovery

Chris Lalancette clalance at redhat.com
Tue Nov 4 17:32:37 UTC 2008


Assume that you have an iSCSI target available, and on that iSCSI target 1 LUN
is exported.  On that 1 LUN, you have an LVM volume group (say, myvg), with 2
logical volumes (say, lv1 and lv2).  Now you execute the following sequence of
commands:

1)  virsh define iscsi_pool.xml
2)  virsh start iscsi_pool
3)  virsh find-storage-pool-sources-as logical

With that sequence, you would expect step 3) to return XML similar to:

<sources><source><name>myvg</name><device path='/dev/sdb'/></source></sources>

However, what you instead get is: <sources/>.  That's because if you just try to
do storage pool discovery on a logical pool without ever touching the logical
pool in any fashion, pvs (what we use to do discovery) doesn't return anything.
 If you touch the logical volume group at all (say, with vgscan), they then
suddenly appear.  To make sure we see all of the potential volume groups when
doing pool discovery, make sure to run vgscan before we run pvs.  With this
patch in place, logical discovery just does the right thing.

Signed-off-by: Chris Lalancette <clalance at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libvirt-logical-vgscan.patch
Type: text/x-patch
Size: 3632 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20081104/d743e03d/attachment-0001.bin>


More information about the libvir-list mailing list