Chapter 6. Validating edge storage 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. Prerequisites 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. These correspond to glance stores at the central location and edge sites, respectively: 6.1. Importing from a local file You must upload the image to the central location's store first, then copy the image to remote sites. 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: Import the image into the default back end at the central site: 6.2. Importing an image from a web server If the image is hosted on a web server, you can use the GlanceImageImportPlugins parameter to upload the image to multiple stores. 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. 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. Alternatively you can replace --stores with --all-stores True to upload the image to all of the stores. 6.3. Copying an image to a new site You can copy existing images from the central location to edge sites, which gives you access to previously created images at newly established locations. Use the UUID of the glance image for the copy operation: Note In this example, the --stores option specifies that the cirros image will be copied 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 don't currently have the image. 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 .: Note Always store an image copy in the central site even if there is no VM using it on that site. 6.4. Confirming that an instance at an edge site can boot with image based volumes You can use an image at the edge site to create a persistent root volume. Procedure Identify the ID of the image to create as a volume, and pass that ID to the openstack volume create command: Identify the volume ID of the newly created volume and pass it to the openstack server create command: 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. 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. List the contents of the volumes pool on the az1 Ceph cluster to show the newly created snapshot. 6.5. Confirming image snapshots can be created and copied between sites 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: Copy the image from the az1 edge site back to the central location, which is the default backend for glance: 6.6. Testing a backup and restore across edge sites You can back up and restore Block Storage service (cinder) volumes across edge site availability zones (AZs) and the central AZ. The cinder-backup service runs in the central AZ, and backups are stored in the central AZ. The Block Storage service does not store backups at edge sites, and back up and restore operations directly between edge sites are not supported. Prerequisites 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. Procedure Create a backup of a volume in the first DCN site: 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. Restore the backup to a new volume in the second DCN site: 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 step.

Commands:
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"}] | +----------+----------------------------------------------------------------------------------+
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
openstack image create --disk-format raw --container-format bare --name cirros --file cirros-0.5.1-x86_64-disk.raw --store central
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
ID=USD(openstack image show cirros -c id -f value) glance image-import USDID --stores az1,az2 --import-method copy-image
openstack image show USDID | 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 |
IMG_ID=USD(openstack image show cirros -c id -f value) openstack volume create --size 8 --availability-zone az1 pet-volume-az1 --image USDIMG_ID
VOL_ID=USD(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 USDVOL_ID pet-server-az1
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 USD
openstack server stop pet-server-az1 openstack volume snapshot create pet-volume-az1-snap --volume USDVOL_ID --force openstack server start pet-server-az1
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
NOVA_ID=USD(openstack server show pet-server-az1 -f value -c id) openstack server stop USDNOVA_ID openstack server image create --name cirros-snapshot USDNOVA_ID openstack server start USDNOVA_ID
IMAGE_ID=USD(openstack image show cirros-snapshot -f value -c id) glance image-import USDIMAGE_ID --stores az0 --import-method copy-image
openstack --os-volume-api-version 3.51 volume backup create --name <volume_backup> --availability-zone <az0> <edge_volume>
openstack --os-volume-api-version 3.47 volume create --backup <volume_backup> --availability-zone <az_2> <new_volume>