|
| 1 | +:_mod-docs-content-type: PROCEDURE |
| 2 | +[id="adopting-block-storage-service-with-dcn-backend_{context}"] |
| 3 | + |
| 4 | += Adopting the {block_storage} with multiple {Ceph} back ends (DCN) |
| 5 | + |
| 6 | +[role="_abstract"] |
| 7 | +Adopt the {block_storage_first_ref} in a Distributed Compute Node (DCN) deployment where multiple {CephCluster} clusters provide storage at different sites. This configuration deploys multiple `CinderVolume` instances, one for each availability zone, with each volume service configured to use its local {Ceph} cluster. |
| 8 | + |
| 9 | +.Architecture change during adoption |
| 10 | + |
| 11 | +During adoption, the {block_storage} volume services that ran on edge site compute nodes are migrated to run on {rhocp_long} at the central site. Although the control path for API requests now traverses the WAN to reach the {block_storage} running on {rhocp_long}, the data path remains local. Volume data continues to be stored in the {Ceph} cluster at each edge site. When you create a volume or clone a volume from a snapshot, the operation occurs entirely within the local {Ceph} cluster. This architecture preserves data locality and avoids transferring volume data across the WAN. |
| 12 | + |
| 13 | +.Prerequisites |
| 14 | + |
| 15 | +* You have completed the previous adoption steps. |
| 16 | +* The per-site {Ceph} secrets (`ceph-conf-central`, `ceph-conf-dcn1`, `ceph-conf-dcn2`) exist and contain the configuration and keyrings for each site's {Ceph} cluster. For more information, see xref:configuring-a-ceph-backend_migrating-databases[Configuring a {Ceph} back end]. |
| 17 | +* The `extraMounts` property of the `OpenStackControlPlane` CR is configured to mount the {Ceph} configuration to all {block_storage} instances. |
| 18 | +* You have stopped the {block_storage} on all DCN nodes. For more information, see xref:stopping-openstack-services_{context}[Stopping {rhos_prev_long} services]. On edge sites, the {block_storage} volume service runs on compute nodes with the service name `tripleo_cinder_volume.service`. |
| 19 | + |
| 20 | +.Procedure |
| 21 | + |
| 22 | +. Retrieve the `fsid` for each {Ceph} cluster in your DCN deployment. The `fsid` is used as the `rbd_secret_uuid` for libvirt integration: |
| 23 | ++ |
| 24 | +---- |
| 25 | +$ oc get secret ceph-conf-central -o json | jq -r '.data | to_entries[] | select(.key | endswith(".conf")) | "\(.key): \(.value | @base64d)"' | grep fsid |
| 26 | +---- |
| 27 | + |
| 28 | +. Create a patch file for the {block_storage} with multiple {Ceph} back ends. The following example shows a DCN deployment with a central site and two edge sites: |
| 29 | ++ |
| 30 | +[subs="+quotes"] |
| 31 | +---- |
| 32 | +$ cat << EOF > cinder_dcn_patch.yaml |
| 33 | +spec: |
| 34 | + cinder: |
| 35 | + enabled: true |
| 36 | + template: |
| 37 | + cinderAPI: |
| 38 | + customServiceConfig: | |
| 39 | + [DEFAULT] |
| 40 | + default_availability_zone = az-central |
| 41 | + cinderScheduler: |
| 42 | + replicas: 1 |
| 43 | + cinderVolumes: |
| 44 | + central: |
| 45 | + networkAttachments: |
| 46 | + - storage |
| 47 | + replicas: 1 |
| 48 | + customServiceConfig: | |
| 49 | + [DEFAULT] |
| 50 | + enabled_backends = central |
| 51 | + glance_api_servers = http://glance-central-internal.openstack.svc:9292 |
| 52 | + [central] |
| 53 | + backend_host = hostgroup |
| 54 | + volume_backend_name = central |
| 55 | + volume_driver = cinder.volume.drivers.rbd.RBDDriver |
| 56 | + rbd_ceph_conf = /etc/ceph/central.conf |
| 57 | + rbd_user = openstack |
| 58 | + rbd_pool = volumes |
| 59 | + rbd_flatten_volume_from_snapshot = False |
| 60 | + report_discard_supported = True |
| 61 | + rbd_secret_uuid = *<central_fsid>* |
| 62 | + rbd_cluster_name = central |
| 63 | + backend_availability_zone = az-central |
| 64 | + dcn1: |
| 65 | + networkAttachments: |
| 66 | + - storage |
| 67 | + replicas: 1 |
| 68 | + customServiceConfig: | |
| 69 | + [DEFAULT] |
| 70 | + enabled_backends = dcn1 |
| 71 | + glance_api_servers = http://glance-dcn1-internal.openstack.svc:9292 |
| 72 | + [dcn1] |
| 73 | + backend_host = hostgroup |
| 74 | + volume_backend_name = dcn1 |
| 75 | + volume_driver = cinder.volume.drivers.rbd.RBDDriver |
| 76 | + rbd_ceph_conf = /etc/ceph/dcn1.conf |
| 77 | + rbd_user = openstack |
| 78 | + rbd_pool = volumes |
| 79 | + rbd_flatten_volume_from_snapshot = False |
| 80 | + report_discard_supported = True |
| 81 | + rbd_secret_uuid = *<dcn1_fsid>* |
| 82 | + rbd_cluster_name = dcn1 |
| 83 | + backend_availability_zone = az-dcn1 |
| 84 | + dcn2: |
| 85 | + networkAttachments: |
| 86 | + - storage |
| 87 | + replicas: 1 |
| 88 | + customServiceConfig: | |
| 89 | + [DEFAULT] |
| 90 | + enabled_backends = dcn2 |
| 91 | + glance_api_servers = http://glance-dcn2-internal.openstack.svc:9292 |
| 92 | + [dcn2] |
| 93 | + backend_host = hostgroup |
| 94 | + volume_backend_name = dcn2 |
| 95 | + volume_driver = cinder.volume.drivers.rbd.RBDDriver |
| 96 | + rbd_ceph_conf = /etc/ceph/dcn2.conf |
| 97 | + rbd_user = openstack |
| 98 | + rbd_pool = volumes |
| 99 | + rbd_flatten_volume_from_snapshot = False |
| 100 | + report_discard_supported = True |
| 101 | + rbd_secret_uuid = *<dcn2_fsid>* |
| 102 | + rbd_cluster_name = dcn2 |
| 103 | + backend_availability_zone = az-dcn2 |
| 104 | +EOF |
| 105 | +---- |
| 106 | ++ |
| 107 | +where: |
| 108 | + |
| 109 | +<central_fsid>:: |
| 110 | +Specifies the `fsid` of the central {Ceph} cluster, used as the libvirt secret UUID. |
| 111 | + |
| 112 | +<dcn1_fsid>:: |
| 113 | +Specifies the `fsid` of the DCN1 edge {Ceph} cluster. |
| 114 | + |
| 115 | +<dcn2_fsid>:: |
| 116 | +Specifies the `fsid` of the DCN2 edge {Ceph} cluster. |
| 117 | + |
| 118 | ++ |
| 119 | +[NOTE] |
| 120 | +==== |
| 121 | +* Each `CinderVolume` is configured with `backend_availability_zone` matching the {compute_service} availability zone for that site. The {block_storage} availability zone names must match the {compute_service} availability zone names exactly, because `cross_az_attach = False` is set in the {compute_service} configuration. If the names do not match, instances cannot attach volumes. Replace the example availability zone names (`az-central`, `az-dcn1`, `az-dcn2`) with the names used in your {rhos_prev_long} deployment. |
| 122 | +* Each `CinderVolume` points to its local {image_service} API endpoint via `glance_api_servers`. This ensures that volume creation from images uses the local {image_service} and {Ceph} cluster. The examples use `http://` for the {image_service} endpoints. If your {rhos_prev_long} deployment uses TLS for internal endpoints, use `https://` instead, and ensure that you have completed the TLS migration. For more information, see xref:migrating-tls-everywhere_{context}[Migrating TLS-e to the RHOSO deployment]. |
| 123 | +* The `rbd_cluster_name` setting identifies which {Ceph} cluster configuration to use from the mounted secrets. |
| 124 | +* Adjust the number of edge sites and their names to match your DCN deployment. |
| 125 | +==== |
| 126 | + |
| 127 | +. Patch the `OpenStackControlPlane` CR to deploy the {block_storage} with multiple {Ceph} back ends: |
| 128 | ++ |
| 129 | +---- |
| 130 | +$ oc patch openstackcontrolplane openstack --type=merge --patch-file cinder_dcn_patch.yaml |
| 131 | +---- |
| 132 | + |
| 133 | +. Configure the {block_storage} backup service. In this example DCN deployment the backup service runs at the central site and uses the central {Ceph} cluster. Add the `cinderBackup` section to your patch file and re-apply it: |
| 134 | ++ |
| 135 | +[subs="+quotes"] |
| 136 | +---- |
| 137 | +$ cat << EOF >> cinder_dcn_patch.yaml |
| 138 | + cinderBackup: |
| 139 | + networkAttachments: |
| 140 | + - storage |
| 141 | + replicas: 1 |
| 142 | + customServiceConfig: | |
| 143 | + [DEFAULT] |
| 144 | + backup_driver=cinder.backup.drivers.ceph.CephBackupDriver |
| 145 | + backup_ceph_conf=/etc/ceph/central.conf |
| 146 | + backup_ceph_user=openstack |
| 147 | + backup_ceph_pool=backups |
| 148 | + storage_availability_zone=az-central |
| 149 | +EOF |
| 150 | +$ oc patch openstackcontrolplane openstack --type=merge --patch-file cinder_dcn_patch.yaml |
| 151 | +---- |
| 152 | ++ |
| 153 | +[NOTE] |
| 154 | +==== |
| 155 | +Unlike a single-site {Ceph} deployment where the backup config references `/etc/ceph/ceph.conf`, in a DCN deployment the {Ceph} configuration files in the `ceph-conf-files` secret are named by cluster. Set `backup_ceph_conf` to the path of the {Ceph} configuration file for whichever cluster hosts your `backups` pool. In this example the file is named `central.conf`, so the path is `/etc/ceph/central.conf`. Using a path that does not match a file in the secret will cause the backup service to fail with a `conf_read_file` error. |
| 156 | +
|
| 157 | +Set `storage_availability_zone` to match the availability zone of the volumes you want to back up. The backup scheduler uses this to route backup requests to a service in the correct zone. If the backup service zone does not match the volume zone, backup creation fails with `Service not found for creating backup`. |
| 158 | +==== |
| 159 | + |
| 160 | +. Verify that the {block_storage} volume services are running for each availability zone: |
| 161 | ++ |
| 162 | +---- |
| 163 | +$ openstack volume service list --service cinder-volume |
| 164 | +
|
| 165 | ++------------------+---------------------+------------+---------+-------+----------------------------+ |
| 166 | +| Binary | Host | Zone | Status | State | Updated At | |
| 167 | ++------------------+---------------------+------------+---------+-------+----------------------------+ |
| 168 | +| cinder-volume | hostgroup@central | az-central | enabled | up | 2024-01-01T00:00:00.000000 | |
| 169 | +| cinder-volume | hostgroup@dcn1 | az-dcn1 | enabled | up | 2024-01-01T00:00:00.000000 | |
| 170 | +| cinder-volume | hostgroup@dcn2 | az-dcn2 | enabled | up | 2024-01-01T00:00:00.000000 | |
| 171 | ++------------------+---------------------+------------+---------+-------+----------------------------+ |
| 172 | +---- |
| 173 | + |
| 174 | +. Verify that the {block_storage} backup service is running and in the correct availability zone: |
| 175 | ++ |
| 176 | +---- |
| 177 | +$ openstack volume service list --service cinder-backup |
| 178 | +
|
| 179 | ++---------------+-----------------+------------+---------+-------+----------------------------+ |
| 180 | +| Binary | Host | Zone | Status | State | Updated At | |
| 181 | ++---------------+-----------------+------------+---------+-------+----------------------------+ |
| 182 | +| cinder-backup | cinder-backup-0 | az-central | enabled | up | 2024-01-01T00:00:00.000000 | |
| 183 | ++---------------+-----------------+------------+---------+-------+----------------------------+ |
| 184 | +---- |
| 185 | + |
| 186 | +. Test the backup service by creating a volume, backing it up, and restoring the backup: |
| 187 | ++ |
| 188 | +---- |
| 189 | +$ openstack volume create --size 1 backup-test-vol |
| 190 | +
|
| 191 | +$ openstack volume backup create --name backup-test-backup backup-test-vol |
| 192 | +
|
| 193 | +$ openstack volume backup show backup-test-backup |
| 194 | ++-----------------------+--------------------------------------+ |
| 195 | +| Field | Value | |
| 196 | ++-----------------------+--------------------------------------+ |
| 197 | +| container | backups | |
| 198 | +| fail_reason | None | |
| 199 | +| name | backup-test-backup | |
| 200 | +| size | 1 | |
| 201 | +| status | available | |
| 202 | ++-----------------------+--------------------------------------+ |
| 203 | +
|
| 204 | +$ openstack volume backup restore backup-test-backup backup-test-restore |
| 205 | +---- |
| 206 | ++ |
| 207 | +[NOTE] |
| 208 | +==== |
| 209 | +Some versions of the {rhocp_long} client display a `cannot unpack non-iterable VolumeBackupsRestore object` error after the restore command. This is a display bug in the client so it does not necessarily mean that the restore operation failed. Verify by checking the restored volume status directly. |
| 210 | +==== |
| 211 | ++ |
| 212 | +---- |
| 213 | +$ openstack volume show backup-test-restore -c status -c availability_zone -c os-vol-host-attr:host -f value |
| 214 | +available |
| 215 | +az-central |
| 216 | +hostgroup@central#central |
| 217 | +---- |
0 commit comments