Libvirt Pools and Volumes

Libvirt pools contain volumes. There is a default pool, called “Default” which is defined during the KVM installation. You can create volumes in the Default pool, or you can define another pool and place the newly installed volume in the new pool. When you create a new volume, you can either do it through Virtual Machine Manager (which is piictured below) or you can do it via CLI using libvirt. Here is the BASH script for the libvirt volume:

qemu-img create -f qcow2 /var/lib/libvirt/images/qemu-img/ubuntu-qemu.qcow2 20G

This will create the volume, but not the pool. Once the volume is created you can create the pool via VMM or you do it via command line, and place the volume in that newly build pool. It is probably imperative that at this point, if not before, you get yourself familiar with this page:

http://libvirt.org/storage.html

Here are pictures of a Default pool,

pools

and another user-defined pool, named “qcow2”.

pools2

As you can see, if both screenshots the file pathname is shown, the Default uses /var/lib/libvirt/images and for the qcow2 Pool, the pathname is /var/lib/libvirt/images/qemu-img.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s