Introduction:
I wanted to have one virtual machine guest accessing a certain software RAID partition, formatted on ext4 - exclusively.
I've tried adding that device to the KVM's storage pool, using virt-manager, but I failed. It always mounted the device and sold it to the guests as dir. That's not what I wanted.
Luckily, I found a post on Ronald Ever's blog, about adding a physical device using libvirt. I think this is currently not yet possible with virt-manager, so as Ronald says:
But don't be afraid: It's actually really easy. If you're able to edit a textfile, you're ready to play!You have to do it by hand.
First: Stop the virtual machine guest you're planning to add the disk to.
Then, add the disk:
The XML block you have to add to "/etc/libvirt/qemu/<vm_guest>.xml" looks somewhat like this:
Code: Select all
<disk type='block' device='disk'>
<driver name='qemu' type='raw'/>
<source dev='/dev/md0'/>
<target dev='vdb1' bus='virtio'/>
</disk>
Code: Select all
$ virsh edit <vm_guest>
Then restart libvirt:
Code: Select all
$ /etc/init.d/libvirt-bin restart
Have fun!