第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 a 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. You can also configure the Compute service to download images directly from the RBD image repository without using the Image service API, when the Image service (glance) uses Red Hat Ceph RADOS Block Device (RBD) as the back end.

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.

表4.1 Compute (nova) service image cache parameters

Configuration methodParameterDescription

Puppet

nova::compute::image_cache::manager_interval

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 nova::compute::image_cache::remove_unused_base_images is set to True.

Set to 0 to run at the default metrics interval of 60 seconds (not recommended). Set to -1 to disable the image cache manager.

Default: 2400

Puppet

nova::compute::image_cache::precache_concurrency

Specifies the maximum number of Compute nodes that can pre-cache images in parallel.

注記
  • Setting this parameter to a high number can cause slower pre-cache performance and might result in a DDoS on the Image service.
  • Setting this parameter to a low number reduces the load on the Image service, but can cause longer runtime to completion as the pre-cache is performed as a more sequential operation.

Default: 1

Puppet

nova::compute::image_cache::remove_unused_base_images

Set to True to automatically remove unused base images from the cache at intervals configured by using manager_interval. Images are defined as unused if they have not been accessed during the time specified by using NovaImageCacheTTL.

Default: True

Puppet

nova::compute::image_cache::remove_unused_resized_minimum_age_seconds

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 undef to disable.

Default: 3600

Puppet

nova::compute::image_cache::subdirectory_name

Specifies the name of the folder where cached images are stored, relative to $instances_path.

Default: _base

Heat

NovaImageCacheTTL

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)