Mapping between KVM guest virtual discs and LVM logical volumes

user3106036 asked:

The question is, how do I know which LVM partition corresponds to which virtual KVM disc?

I am trying to install a KVM guest (Ubuntu server) on LVM logical volumes. I have used lvcreate to
create partitions for boot, root, home, tmp, usr, var and swap. Boot is ext2, swap is swap and
the rest is ext4.

However, using virt-install and connecting with spice from an external computer, the ubuntu installer shows
the virtual discs vda, vdb, vdc, vdd, vde, vdf and vdg.

Since I used the filesystem ext2 on boot and that vda is recognized as ext2 I can
map boot to vda. In a similar way I can map the swap to vdg. But how do this for the others? Where is this mapping located?

Also, is the above procedure to install KVM guest on LVM logical volumes the way to do it?

My answer:

The virtual disks are mapped in the order you created them in the virt-install command line.

To see the exact mapping, inspect the <disk> nodes in the XML definition for the guest:

virsh dumpxml guestname

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.