Storage

Oracle Linux Virtualization Manager uses a centralized storage system for virtual machine disk images, ISO files and snapshots. You can use Network File System (NFS), Internet Small Computer System Interface (iSCSI), Fibre Channel Protocol (FCP), or Gluster FS storage. You can also configure local storage attached directly to hosts. For more information, see Storage in the Oracle Linux Virtualization Manager: Administration Guide.

A data center cannot be initialized unless a storage domain is attached to it and activated.

The storage must be located on the same subnet as the Oracle Linux KVM hosts that will use the storage, in order to avoid issues with routing.

Since you need to create, configure, attach and maintain storage, make sure you are familiar with the storage types and their use. Read your storage array manufacturer guides for more information.

Storage Domains

A storage domain is a collection of images that have a common storage interface. A storage domain contains complete images of templates, virtual machines, virtual machine snapshots, or ISO files. Oracle Linux Virtualization Manager supports storage domains that are block devices (SAN - iSCSI or FCP) or a file system (NAS - NFS or Gluster).

On NFS or Gluster, all virtual disks, templates, and snapshots are files. On SAN (iSCSI/FCP), each virtual disk, template or snapshot is a logical volume.

Virtual machines that share the same storage domain can be migrated between hosts that belong to the same cluster.

Storage, also referred to as a data domain, is used to store the virtual hard disks, snapshots, ISO files, and Open Virtualization Format (OVF) files for virtual machines and templates. Every data center must have at least one data domain. Data domains cannot be shared between data centers.

Note:

The Administration Portal currently offers options for creating storage domains that are export domains or ISO domains. These options are deprecated.

Detaching a storage domain from a data center stops the association, but does not remove the storage domain from the environment. A detached storage domain can be attached to another data center. And, the data, such as virtual machines and templates, remains attached to the storage domain.

Storage Pool Manager

The Storage Pool Manager (SPM) is a management role assigned to one of the hosts in a data center enabling it to manage the storage domains of the data center. Any host in the data center can run the SPM entity, which is assigned by the engine. SPM controls access to storage by coordinating the metadata across the storage domains. This includes creating, deleting, and manipulating virtual disks (images), snapshots, and templates, and allocating storage for sparse block devices (on SAN).

The host running as SPM can still host virtual resources. The SPM priority setting for hosts enables you to prioritize which host is assigned the SPM role. Since the SPM role uses some of the host's available resources, it is important to prioritize hosts that can afford the resources.

Because the SPM must always be available, the engine assigns the SPM role to another host if the SPM host becomes unavailable. A host with higher SPM priority is assigned the SPM role before a host with lower SPM priority.

Virtual Machine Storage

The Storage Pool Manager (SPM) is responsible for creating and deleting virtual disks, as well as snapshots, and templates. In addition it allocates storage for sparse block devices.

  • If you are using NFS or local storage, the SPM creates a thin provisioned virtual disk by default.
  • If you are using iSCSI storage or other block-based devices, Logical Unit Numbers (LUNs) are provided to the SPM. Then, a volume group on top of the LUNs and logical volumes for use as virtual machine disks are created and the SPM preallocates the space by default.
  • If a virtual disk is thinly-provisioned, a 1 GB logical volume is created with a QCOW2 format. Use thin provisioning for virtual machines with low I/O requirements.
  • The virtual machine's host continuously monitors the logical volume used for its virtual disk. You can set a threshold so that when the disk usage nears the threshold the host notifies the SPM and extends the logical volume by 1 GB.
  • If the storage in a pool starts to become exhausted, a new LUN can be added to the volume group. The SPM automatically distributes the additional storage to logical volumes that need it.
  • If a virtual disk is preallocated, a logical volume of the specified size in GB and a virtual disk of RAW format is created. Use preallocated disks for virtual machines with high levels of I/O.
  • When using pre-allocated QCOW2 virtual disks and incremental backup is enabled, disk size is monitored. The true size could be 1.1 times larger than virtual size. So, when allocating storage, allocate the disk capacity in such a way that 10% expansion does not result in capacity exhaustion.
  • If an application requires storage to be shared between virtual machines, use Shareable virtual disks which can be attached to multiple virtual machines concurrently.

    QCOW2 format virtual disks cannot be shareable. You cannot take a snapshot of a shared disk and virtual disks that have snapshots that cannot be marked shareable. You cannot live migrate a shared disk.

    If the virtual machines are not cluster-aware, mark shareable disks as read-only to avoid data corruption.

  • Use direct LUN to enable virtual machines to directly access RAW block-based storage devices on the host bus adapter (HBA). The mapping of the direct LUN to the host causes the storage to be emulated as file-based storage to virtual machines. This removes a layer of abstraction between virtual machines and their data as the virtual machine is being granted direct access to block-based storage LUNs.

Storage Leases

When you add a storage domain to Oracle Linux Virtualization Manager, a special volume is created called xleases. Virtual machines are able to acquire a lease on this special volume, which enables the virtual machine to start on another host even if the original host loses power.

A storage lease is configured automatically for the virtual machine when you select a storage domain to hold the VM lease. (See Configuring a Highly Available Virtual Machine in the Oracle Linux Virtualization Manager: Administration Guide.) This triggers a create a new lease request to the engine which then send the request to the SPM. The SPM creates a lease and a lease id for the virtual machine on the xreleases volume. VDSM creates the sanlock which is used to acquire an exclusive lock on a virtual disk.

The lease id and other information is then sent from the SPM to the engine. The engine then updates the virtual machine's device list with the lease information.

Local Storage

Local storage is storage that is attached directly to an Oracle Linux KVM host, such as a local physical disk or a locally attached SAN. When a KVM host is configured to use local storage, it is automatically added to a cluster where it is the only host. This is because clusters with multiple hosts must have shared storage domains accessible to all hosts.

When you use local storage, features such as live migration, scheduling, and fencing are not available.

For more information, see Configuring a KVM Host to Use Local Storage in the Oracle Linux Virtualization Manager: Administration Guide.