Installation guide

Chapter 25. Storage concepts
200
25.2. Volumes
Storage pools are divided into storage volumes. Storage volumes are an abstraction of physical
partitions, LVM logical volumes, file-based disk images and other storage types handled by libvirt.
Storage volumes are presented to virtualized guests as local storage devices regardless of the
underlying hardware.
Referencing volumes
To reference a specific volume, three approaches are possible:
The name of the volume and the storage pool
A volume may be referred to by name, along with an identifier for the storage pool it belongs in.
On the virsh command line, this takes the form --pool storage_pool volume_name.
For example, a volume named firstimage in the guest_images pool.
# virsh vol-info --pool guest_images
firstimage
Name: firstimage
Type: block
Capacity: 20.00 GB
Allocation: 20.00 GB
virsh #
The full path to the storage on the host system
A volume may also be referred to by its full path on the file system. When using this approach, a
pool identifier does not need to be included.
For example, a volume named secondimage.img, visible to the host system as /images/
secondimage.img. The image can be referred to as /images/secondimage.img.
# virsh vol-info /images/secondimage.img
Name: secondimage.img
Type: file
Capacity: 20.00 GB
Allocation: 136.00 KB
The unique volume key
When a volume is first created in the virtualization system, a unique identifier is generated and
assigned to it. The unique identifier is termed the volume key. The format of this volume key varies
upon the storage used.
When used with block based storage such as LVM, the volume key may follow this format:
c3pKz4-qPVc-Xf7M-7WNM-WJc8-qSiz-mtvpGn
When used with file based storage, the volume key may instead be a copy of the full path to the
volume storage.
/images/secondimage.img
For example, a volume with the volume key of Wlvnf7-a4a3-Tlje-lJDa-9eak-PZBv-
LoZuUr:
# virsh vol-info Wlvnf7-a4a3-Tlje-lJDa-9eak-PZBv-LoZuUr