Thursday, January 12, 2012

Create storage infrastructure with libvirt

Libvirt is defacto library to manage virtual machines. This will show how you can create a storage pool that can be used later to allocate space for vms.

my storage space is located under /storage and the type is a regular directory as i want to store image files in there. this is low performance but will do for my dev machines.

first you need to create the directory

mkdir /storage

# then you need to have an xml file as follow - see type is dir and path is /storage

<pool type="dir">


# than go into virsh and define the new pool - define will make the pool  persistent into the /etc/libvirt/

virsh# pool-list
virsh# pool-autostart pool_name
<capacity unit="T">1</capacity>


sas said...

That was a nice and good practical example

Anonymous said...

What's so practical about it? It stops short of being practical by not going into how to use the storage pool.