libvirt: difference in exposing LVM logical volumes VS libvirt storage pools

Germano Massullo asked:

I started learning how to create a good virtualization stack with libvirt. I have created a LVM Volume Group that exposes a device block made of a Linux RAID. My idea is to give a Logical Volume to each virtual machine, but a person suggested me to use storage pools instead, like

<pool type='logical'>
  <capacity unit='bytes'>0</capacity>
  <allocation unit='bytes'>0</allocation>
  <available unit='bytes'>0</available>
    <device path='/dev/md2'/>
    <format type='lvm2'/>

I have read libvirt storage documentation but I did not understand the difference

My answer:

The effect of both of these is the same, but in one case you are doing everything manually, and in the other case, libvirt is able to do everything for you.

With the storage pool defined, libvirt is able to create and manage volumes in that pool. Without the storage pool defined, you must manually create and manage the volumes outside of libvirt.

Note that a block device does not have to be part of a storage pool in order for a virtual machine managed by libvirt to use it. But if it is not, then you must manage it yourself.

View the full question and any other answers on Server Fault.

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