Migrating Image Library from Local Drive to Cinder Volume
This guide provides step-by-step instructions for migrating the Private Cloud Director Image Library backend from a local drive (file backend) to a Cinder volume (cinder backend), along with important considerations for High Availability (HA) mode and multi-host Image Library configurations.
Overview
By default, the Image Service in the Private Cloud Director uses a local file-based backend to store VM images. For enhanced scalability, persistence, and centralized management, it is recommended that the image library be migrated to use a Cinder volume.
Migrating to a Cinder backend is particularly beneficial in High Availability (HA) environments and supports future scalability through multi-host image library configuration.
Prerequisites
The Private Cloud Director environment is already deployed with a functional Image Library using the file backend.
A Cinder-compatible storage backend is configured and available.
At least one available volume for storing the image library.
Image Library role is assigned on one or more hosts.
Administrator access to all relevant nodes and services.
Downtime window for migration (this process involves stopping image services).
Step-by-Step Instructions
Step 1: Prepare the Cinder Volume
Create a new Cinder volume with sufficient capacity to hold all existing images (plus future growth).
Attach the volume to the host where the Image Library role is currently assigned.
openstack volume create --size <size-in-GB> pcd-image-repo-vol
openstack server add volume <image-node-hostname> pcd-image-repo-volOn the host, identify the volume device (e.g., /dev/vdb) and mount it:
sudo mkfs.ext4 /dev/vdb
sudo mkdir -p /mnt/glance-cinder
sudo mount /dev/vdb /mnt/glance-cinderCopy existing image data from local image library (default: /opt/pf9/pf9-glance/images) to the mounted Cinder volume:
sudo rsync -avh /opt/pf9/pf9-glance/images/ /mnt/glance-cinder/Update the system to mount the volume persistently:
echo '/dev/vdb /mnt/glance-cinder ext4 defaults 0 0' | sudo tee -a /etc/fstabStep 2: Update Glance Configuration
Edit the Glance configuration file (e.g., /etc/glance/glance-api.conf) and set the following backend settings:
[DEFAULT]
enabled_backends = cinder:cinder
[glance_store]
default_backend = cinder
[cinder]
volume_type = <your-volume-type-if-applicable>Restart the Glance service:
sudo systemctl restart glance-api
sudo systemctl restart pf9-ostackhostVerify the backend is now using Cinder:
openstack image show <image-id> -f json | grep locationHigh Availability and Multi-Host Image Library Considerations
HA Mode Support: Using a Cinder volume for the image library is fully supported in HA mode, as Cinder provides persistent and shared storage accessible across multiple controller nodes.
Multi-Host Image Library: If multiple hosts have the Image Library role:
The Cinder backend ensures centralized image access without needing data synchronization between nodes.
All image library nodes must have access to the Cinder volume and appropriate authentication configured.
Last updated
Was this helpful?
