Chapter 4. Configuring Compute service storage
You create an instance from a base image, which the Compute service copies from the Image (glance) service, and caches locally on the Compute nodes. The instance disk, which is the back end for the instance, is also based on the base image.
You can configure the Compute service to store ephemeral instance disk data locally on the host Compute node or remotely on either an NFS share or Ceph cluster. Alternatively, you can also configure the Compute service to store instance disk data in persistent storage provided by the Block Storage (Cinder) service.
You can configure image caching for your environment, and configure the performance and security of the instance disks.
4.1. Configuration options for image caching
Use the parameters detailed in the following table to configure how the Compute service implements and manages an image cache on Compute nodes.
Table 4.1. Compute (nova) service image cache parameters
Configuration method | Parameter | Description |
---|---|---|
Puppet |
|
Specifies the number of seconds to wait between runs of the image cache manager, which manages base image caching on Compute nodes. The Compute service uses this period to perform automatic removal of unused cached images when
Set to
Default: |
Puppet |
| Specifies the maximum number of Compute nodes that can pre-cache images in parallel. Note
Default: |
Puppet |
|
Set to
Default: |
Puppet |
|
Specifies the minimum age that an unused resized base image must be to be removed from the cache, in seconds. Unused resized base images younger than this will not be removed. Set to
Default: |
Puppet |
|
Specifies the name of the folder where cached images are stored, relative to
Default: |
Heat |
| Specifies the length of time in seconds that the Compute service should continue caching an image when it is no longer used by any instances on the Compute node. The Compute service deletes images cached on the Compute node that are older than this configured lifetime from the cache directory until they are needed again. Default: 86400 (24 hours) |
4.2. Configuration options for instance ephemeral storage properties
Use the parameters detailed in the following table to configure the performance and security of ephemeral storage used by instances.
Red Hat OpenStack Platform (RHOSP) does not support the LVM image type for instance disks. Therefore, the [libvirt]/volume_clear
configuration option, which wipes ephemeral disks when instances are deleted, is not supported because it only applies when the instance disk image type is LVM.
Table 4.2. Compute (nova) service instance ephemeral storage parameters
Configuration method | Parameter | Description |
---|---|---|
Puppet |
| Specifies the default format that is used for a new ephemeral volume. Set to one of the following valid values:
The
Default: |
Puppet |
|
Set to
Default: |
Puppet |
|
Set to
Set to
Default: |
Puppet |
| Specifies the preallocation mode for instance disks. Set to one of the following valid values:
Default: |
Hieradata override |
|
Set to This parameter is not enabled by default because it enables the direct mounting of images which might otherwise be disabled for security reasons.
Default: |
Hieradata override |
| Specifies the image type to use for instance disks. Set to one of the following valid values:
Note RHOSP does not support the LVM image type for instance disks.
When set to a valid value other than
The default value is determined by the configuration of
|
4.3. Configuring shared instance storage
By default, when you launch an instance, the instance disk is stored as a file in the instance directory, /var/lib/nova/instances
. You can configure an NFS storage backend for the Compute service to store these instance files on shared NFS storage.
Prerequisites
- You must be using NFSv4 or later. Red Hat OpenStack Platform (RHOSP) does not support earlier versions of NFS. For more information, see the Red Hat Knowledgebase solution RHOS NFSv4-Only Support Notes.
Procedure
-
Log in to the undercloud as the
stack
user. Source the
stackrc
file:[stack@director ~]$ source ~/stackrc
-
Create an environment file to configure shared instance storage, for example,
nfs_instance_disk_backend.yaml
. To configure an NFS backend for instance files, add the following configuration to
nfs_instance_disk_backend.yaml
:parameter_defaults: ... NovaNfsEnabled: True NovaNfsShare: <nfs_share>
Replace
<nfs_share>
with the NFS share directory to mount for instance file storage, for example,'192.168.122.1:/export/nova'
or'192.168.24.1:/var/nfs'
. If using IPv6, use both double and single-quotes, e.g."'[fdd0::1]:/export/nova'"
.Optional: The default mount SELinux context for NFS storage when NFS backend storage is enabled is
'context=system_u:object_r:nova_var_lib_t:s0'
. Add the following parameter to amend the mount options for the NFS instance file storage mount point:parameter_defaults: ... NovaNfsOptions: 'context=system_u:object_r:nova_var_lib_t:s0,<additional_nfs_mount_options>'
Replace
<additional_nfs_mount_options>
with a comma-separated list of the mount options you want to use for NFS instance file storage. For more information on the available mount options, see themount
man page:$ man 8 mount.
- Save the updates to your environment file.
Add your new environment file to the stack with your other environment files and deploy the overcloud:
(undercloud)$ openstack overcloud deploy --templates \ -e [your environment files] \ -e /home/stack/templates/nfs_instance_disk_backend.yaml