Chapter 2. Configure OpenStack Compute Storage
This chapter describes the architecture for the back-end storage of images in OpenStack Compute (nova), and provides basic configuration options.
2.1. Architecture Overview
In Red Hat Enterprise Linux OpenStack Platform, the OpenStack Compute service uses the KVM hypervisor to execute compute workloads. The libvirt
driver handles all interactions with KVM, and enables the creation of virtual machines.
Two types of libvirt
storage must be considered for Compute:
- Base image, which is a cached and formatted copy of the Image service image.
-
Instance disk, which is created using the
libvirt
base and is the back end for the virtual machine instance. Instance disk data can be stored either in Compute’s ephemeral storage (using thelibvirt
base) or in persistent storage (for example, using Block Storage).
The steps that Compute takes to create a virtual machine instance are:
-
Cache the Image service’s backing image as the
libvirt
base. - Convert the base image to the raw format (if configured).
- Resize the base image to match the VM’s flavor specifications.
- Use the base image to create the libvirt instance disk.
In the diagram above, the #1 instance disk uses ephemeral storage; the #2 disk uses a block-storage volume.
Ephemeral storage is an empty, unformatted, additional disk available to an instance. This storage value is defined by the instance flavor. The value provided by the user must be less than or equal to the ephemeral value defined for the flavor. The default value is 0
, meaning no ephemeral storage is created.
The ephemeral disk appears in the same way as a plugged-in hard drive or thumb drive. It is available as a block device which you can check using the lsblk
command. You can format it, mount it, and use it however you normally would a block device. There is no way to preserve or reference that disk beyond the instance it is attached to.
Block storage volume is persistant storage available to an instance regardless of the state of the running instance.
2.2. Configuration
Compute configuration for handling the libvirt
base and instance disks can determine both performance and security aspects of your environment; parameters are configured in the /etc/nova/nova.conf
file.
Section | Parameter | Description | Default |
---|---|---|---|
[DEFAULT] |
|
Whether to convert a
Converting the base to raw uses more space for any image that could have been used directly by the hypervisor (for example, a qcow2 image). If you have a system with slower I/O or less available space, you might want to specify 'false', trading the higher CPU requirements of compression for that of minimized input bandwidth.
Raw base images are always used with |
|
[DEFAULT] |
|
Whether to use CoW (Copy on Write) images for
| true |
[DEFAULT] |
|
Preallocation mode for
Even when not using CoW instance disks, the copy each VM gets is sparse and so the VM may fail unexpectedly at run time with ENOSPC. By running | none |
[DEFAULT] |
|
Whether to enable direct resizing of the base image by accessing the image over a block device (boolean). This is only necessary for images with older versions of Because this parameter enables the direct mounting of images which might otherwise be disabled for security reasons, it is not enabled by default. |
|
[DEFAULT] |
|
The default format that is used for a new ephemeral volume. Value can be: |
|
[DEFAULT] |
|
Number of seconds to wait between runs of the image cache manager, which impacts base caching on libvirt compute nodes. This period is used in the auto removal of unused cached images (see |
|
[DEFAULT] |
|
Whether to enable the automatic removal of unused base images (checked every |
|
[DEFAULT] |
|
How old an unused base image must be before being removed from the |
|
[ |
|
Image type to use for |
|