[CentOS-virt] Best practices for LVM and virtualization

Wed Feb 10 11:09:32 UTC 2010
Mathieu Baudier <mbaudier at argeo.org>

> yes, you can add / remove disks to a VM without restarting the guest.
> look at the xm block-attach  / block-detach commands

My understanding is that xm is Xen specific (I'm using Qemu/KVM)

I tried with virsh:

virsh # attach-disk 6 /dev/mapper/vg_alma_fast-lv_test_virtlvm2 vdb
Disk attached successfully

virsh # dumpxml 6
<domain type='kvm' id='6'>
...
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
...
    <disk type='block' device='disk'>
      <source dev='/dev/mapper/vg_alma_fast-lv_test_virtlvm'/>
      <target dev='vda' bus='virtio'/>
    </disk>
    <disk type='block' device='disk'>
      <driver name='phy'/>
      <source dev='/dev/mapper/vg_alma_fast-lv_test_virtlvm2'/>
      <target dev='vdb' bus='virtio'/>
    </disk>
...
  </devices>
</domain>

But I still cannot see the disk using fdisk: there is no /dev/vdb.

Please note that I'm testing with a minimal CentOS installation
(without even the Base group).
So maybe it lacks some required deamons (there is no ACPI deamon for exmaple).

I will try again with an install including the Base group.