Verify image and volume operations across edge sites

To ensure that the deployment of central and edge sites are working, test glance multi-store and instance creation. You can use the openstackclient pod to test commands as an OpenStack administrator.

You can import images into glance that are available on the local filesystem or available on a web server.

Note
Always store an image copy in the central site, even if there are no instances using the image at the central location.

View Image service stores in DCN

Verify that all Image service (glance) stores are available to confirm that your multi-store configuration is working correctly.

Procedure

Check the stores that are available through the Image service by using the glance stores-info command. In the following example, three stores are available: central, dcn1, and dcn2. The central store is at the central location, and the dcn1 and dcn2 stores are at edge sites:
  $ glance stores-info
  +----------+----------------------------------------------------------------------------------+
  | Property | Value                                                                            |
  +----------+----------------------------------------------------------------------------------+
  | stores   | [{"default": "true", "id": "az0", "description": "central rbd glance             |
  |          | store"}, {"id": "az1", "description": "z1 rbd glance store"},                    |
  |          | {"id": "az2", "description": "az2 rbd glance store"}]                            |
  +----------+----------------------------------------------------------------------------------+

Populate an edge Glance store from a local image file

Import an image from a local file to the central location and distribute it to edge sites. This workflow ensures that images are centrally managed and consistently available across all locations.

Procedure

  1. Ensure that your image file is in raw format. If the image is not in raw format, you must convert the image before importing it into the Image service:
    $ file cirros-0.5.1-x86_64-disk.img
    cirros-0.5.1-x86_64-disk.img: QEMU QCOW2 Image (v3), 117440512 bytes
    
    $ qemu-img convert -f qcow2 -O raw cirros-0.5.1-x86_64-disk.img cirros-0.5.1-x86_64-disk.raw
  2. Import the image into the default back end at the central site:
    openstack image create \
    --disk-format raw --container-format bare \
    --name cirros --file cirros-0.5.1-x86_64-disk.raw \
    --store central

Import an image from a web server

Import images directly from a web server to multiple storage locations. This method streamlines image distribution across your DCN deployment by eliminating manual copying steps.

About this task

This procedure assumes that the default image conversion plugin is enabled in the Image service (glance). This feature automatically converts QCOW2 file formats into raw images, which are optimal for Ceph RBD. You can confirm that a glance image is in raw format by running the glance image-show ID | grep disk_format.

Procedure

Use the image-create-via-import parameter of the glance command to import an image from a web server. Use the --stores parameter.
# glance image-create-via-import \
--disk-format qcow2 \
--container-format bare \
--name cirros \
--uri http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img \
--import-method web-download \
--stores az0,az1

In this example, the QCOW2 CirrOS image is downloaded from the official CirrOS site, converted to raw by glance, and imported into the central site and edge site 1 as specified by the --stores parameter.

Note
Alternatively you can replace --stores with --all-stores True to upload the image to all of the stores.

Copy an image to a new site

Copy images from the central location to edge sites to make them available for instance creation. This reduces instance launch time by eliminating the need to transfer images over the WAN during deployment.

Procedure

  1. Use the UUID of the glance image for the copy operation:
    ID=$(openstack image show cirros -c id -f value)
    
    glance image-import $ID --stores az1,az2 --import-method copy-image
    Note
    In this example, the --stores option copies the cirros image from the central site, az0, to edge sites az1 and az2. Alternatively, you can use the --all-stores True option, which uploads the image to all the stores that do not currently have the image.
  2. Confirm a copy of the image is in each store. Note that the stores key, which is the last item in the properties map, is set to az0,az1,az2.:
    $ openstack image show $ID | grep properties
    
    | properties | os_glance_failed_import='', os_glance_importing_to_stores='', os_hash_algo='sha512', os_hash_value='6b813aa46bb90b4da216a4d19376593fa3f4fc7e617f03a92b7fe11e9a3981cbe8f0959dbebe36225e5f53dc4492341a4863cac4ed1ee0909f3fc78ef9c3e869', os_hidden='False', stores='az0,az1' |
    Note
    Always store an image copy in the central site even if there is no VM using it on that site.

Create image-based boot volumes at edge sites

Create persistent boot volumes from images stored at edge sites to validate that instances can launch from Ceph-backed storage at your distributed locations.

Procedure

  1. Identify the ID of the image to create as a volume, and pass that ID to the openstack volume create command:
    IMG_ID=$(openstack image show cirros -c id -f value)
    openstack volume create --size 8 --availability-zone az1 pet-volume-az1 --image $IMG_ID
  2. Identify the volume ID of the newly created volume and pass it to the openstack server create command:
    VOL_ID=$(openstack volume show -f value -c id pet-volume-az1)
    openstack server create --flavor tiny --key-name az1-key --network az1-network --security-group basic --availability-zone az1 --volume $VOL_ID pet-server-az1
  3. You can verify that the volume is based on the image by running the rbd command within a ceph-mon container at the az1 edge site to list the volumes pool.
    $ sudo cephadm shell -- rbd -p volumes ls -l
    NAME                                      SIZE  PARENT                                           FMT PROT LOCK
    volume-28c6fc32-047b-4306-ad2d-de2be02716b7 8 GiB images/8083c7e7-32d8-4f7a-b1da-0ed7884f1076@snap   2      excl
    $
  4. Confirm that you can create a cinder snapshot of the root volume of the instance. Ensure that the server is stopped to quiesce data to create a clean snapshot. Use the '--force' option, because the volume status remains in-use when the instance is off.
    openstack server stop pet-server-az1
    openstack volume snapshot create pet-volume-az1-snap --volume $VOL_ID --force
    openstack server start pet-server-az1
  5. List the contents of the volumes pool on the az1 Ceph cluster to show the newly created snapshot.
    $ sudo cephadm shell -- rbd -p volumes ls -l
    NAME                                                                                      SIZE  PARENT                                           FMT PROT LOCK
    volume-28c6fc32-047b-4306-ad2d-de2be02716b7                                               8 GiB images/8083c7e7-32d8-4f7a-b1da-0ed7884f1076@snap   2      excl
    volume-28c6fc32-047b-4306-ad2d-de2be02716b7@snapshot-a1ca8602-6819-45b4-a228-b4cd3e5adf60 8 GiB images/8083c7e7-32d8-4f7a-b1da-0ed7884f1076@snap   2 yes

Create and copy instance snapshots between sites

Create instance snapshots at edge sites and copy them to the central location for backup and image management. This validates your image copying workflow across distributed sites.

Procedure

  1. Verify that you can create a new image at the az1 location. Ensure that the server is stopped to quiesce data to create a clean snapshot:
    NOVA_ID=$(openstack server show pet-server-az1 -f value -c id)
    openstack server stop $NOVA_ID
    openstack server image create --name cirros-snapshot $NOVA_ID
    openstack server start $NOVA_ID
  2. Copy the image from the az1 edge site back to the central location, which is the default backend for glance:
    IMAGE_ID=$(openstack image show cirros-snapshot -f value -c id)
    glance image-import $IMAGE_ID --stores az0 --import-method copy-image

Back up and restore volumes across edge sites

Back up and restore Block Storage (cinder) volumes across edge sites and the central location for data protection and disaster recovery. All backups are centrally stored and managed to provide a consistent recovery point across your distributed architecture.

Before you begin

  • The Block Storage backup service is deployed in the central AZ. For more information, see Updating the control plane.
  • Block Storage (cinder) REST API microversion 3.51 or later.
  • All sites use a common openstack cephx client name.

About this task

Back up and restore operations directly between edge sites are not supported.

Procedure

  1. Create a backup of a volume in the first DCN site:
    $ openstack --os-volume-api-version 3.51 volume backup create \
    --name <volume_backup> --availability-zone <az0> <edge_volume>
    • Replace <volume_backup> with a name for the volume backup.
    • Replace <az0> with the name of the central availability zone that hosts the cinder-backup service.
    • Replace <edge_volume> with the name of the volume that you want to back up. Note
      If you experience issues with Ceph keyrings, you might need to restart the cinder-backup container so that the keyrings copy from the host to the container successfully.
  2. Restore the backup to a new volume in the second DCN site:
    $ openstack --os-volume-api-version 3.47 volume create \
    --backup <volume_backup> --availability-zone <az_2> <new_volume>
    • Replace <az_2> with the name of the availability zone where you want to restore the backup.
    • Replace <new_volume> with a name for the new volume.
    • Replace <volume_backup> with the name of the volume backup that you created in the previous step.