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 a NFS storage backend for the Compute service to store these instance files on shared NFS storage.

Procedure

  1. Log in to the undercloud as the stack user.
  2. Source the stackrc file:

    [stack@director ~]$ source ~/stackrc
  3. Create an environment file to configure shared instance storage, for example, nfs_instance_disk_backend.yaml.
  4. 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'".

  5. 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 the mount man page:

    $ man 8 mount.
  6. Save the updates to your environment file.
  7. 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