4.7 Setting up Glance

The Glance image service is the OpenStack service used to manage virtual machine images. By default, it runs on controller nodes.

The Glance service uses the local file system to store virtual machine images and is not, by default, configured for high availability (HA). To enable HA for Glance, you can use a shared file system, such as NFS, mounted on /var/lib/glance on each Glance node.

Alternatively, you can deploy Glance to a single node. This avoids any HA issues with file-based storage, though it also means that Glance is not HA-enabled. To deploy Glance to a single node, create a group which contains only Glance, and add one host to that group.

Using a Shared File System for Glance

The glance_api container mounts the /var/lib/glance directory on the host and uses it to store virtual machine images. To provide for high availability, you can mount a shared file system on /var/lib/glance on each Glance host.

You must ensure that the file system is mounted before the Glance containers are started because the Docker daemon does not wait for file systems to be mounted before it starts the containers. You can configure systemd to check that a file system is mounted before starting the Docker service. For example, if you have added an entry to /etc/fstab to mount an NFS file system at boot time, perform the following steps:

  1. Configure systemd to mount the NFS file system before starting the docker service.

    Create the drop-in file /etc/systemd/system/docker.service.d/nfs.conf with the following content:

    [Unit]
    After=remote-fs.target
  2. Reload systemd manager configuration.

    # systemctl daemon-reload
  3. Restart the docker service.

    # systemctl restart docker.service