3.4.3. Logical Volume Extension
The Red Hat Enterprise Virtualization Manager uses thin provisioning to over-commit a certain amount of storage to a disk image. Because the over-committing function logically defines more storage than is physically available, a virtual machine may attempt to use too much storage and subsequently run out of storage for its disk image. In such a situation, logical volume extension is used to provide additional storage and facilitate the continued operations for the virtual machine.
Red Hat Enterprise Virtualization provides a thin provisioning mechanism over LVM. When using QCOW2 formatted storage, Red Hat Enterprise Virtualization relies on the host system process qemu-kvm to map storage blocks on disk to logical blocks in a sequential manner. This allows, for example, the definition of a logical 100GB disk backed by a 1GB logical volume. When qemu-kvm crosses a usage threshold set by VDSM, the local VDSM instance makes a request to the SPM for the logical volume to be extended by another one gigabyte. VDSM on the host running a virtual machine in need of volume extension notifies the SPM VDSM that more space is required. The SPM extends the logical volume and the SPM VDSM instance causes the host VDSM to refresh volume group information and recognize that the extend operation is complete. The host can continue operations.
Logical Volume extension does not require that a host know which other host is the SPM; it could even be the SPM itself. The storage extension communication is done via a storage mailbox which is a dedicated logical volume in the data storage domain. A host that needs the SPM to extend a logical volume writes a message to the storage mailbox logical volume on the data storage domain in an area designated to that particular host . The SPM periodically reads the incoming mail, performs requested logical volume extensions, and writes a reply in the outgoing mail. After sending the request, a host monitors its incoming mail for responses every two seconds. When the host receives a successful reply to its logical volume extension request, it refreshes the logical volume map in device mapper to recognize the newly allocated storage.
In a situation where the physical storage available to a volume group itself is nearly exhausted, multiple images can run out of usable storage with no means to replenish their resources. A volume group that exhausts its memory causes QEMU to return an enospc error, which indicates that the device no longer has any storage available. At this point, running virtual machines are automatically paused and the administrator must intervene to add a new LUN to the volume group.
When the administrator adds a new LUN to the volume group, the Storage Pool Manager automatically distributes the additional storage or memory resources to logical volumes that need it. The automatic allocation of additional resources allows the relevant virtual machines to automatically continue operations uninterrupted or resume operations if stopped.