Skip to content

Commit f485761

Browse files
Merge pull request #760 from gais-ameer-rh/OSPRH-28342
[DZ-Storage] Adding cinderBackups to controlplane To deploy multiple cinder backups based on AZ topology Removes the existing spec.cinder.template.cinderBackup (singluar) and replaces with cinderBackups (plural) Jira: OSPRH-28342 Signed-off-by: Gais Ameer gameer@redhat.com Depends-On: openstack-k8s-operators/ci-framework#3927 Reviewed-by: John Fulton <johfulto@redhat.com> Reviewed-by: Gais Ameer Reviewed-by: Andrew Bays <andrew.bays@gmail.com>
2 parents d75b803 + 585463f commit f485761

4 files changed

Lines changed: 115 additions & 44 deletions

File tree

automation/vars/dz-storage.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,3 +237,7 @@ vas:
237237
type: playbook
238238
source: "../../hooks/playbooks/dz_storage_pre_test_images.yaml"
239239
inventory: "${HOME}/ci-framework-data/artifacts/zuul_inventory.yml"
240+
- name: "04 Validate cinderBackups creation and restore"
241+
type: playbook
242+
source: "../../hooks/playbooks/cinder_backups.yaml"
243+
inventory: "${HOME}/ci-framework-data/artifacts/zuul_inventory.yml"

examples/dt/dz-storage/control-plane/kustomization.yaml

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -285,36 +285,12 @@ replacements:
285285
- source:
286286
kind: ConfigMap
287287
name: service-values
288-
fieldPath: data.cinderBackup.replicas
288+
fieldPath: data.cinderBackups
289289
targets:
290290
- select:
291291
kind: OpenStackControlPlane
292292
fieldPaths:
293-
- spec.cinder.template.cinderBackup.replicas
294-
options:
295-
create: true
296-
- source:
297-
kind: ConfigMap
298-
name: service-values
299-
fieldPath: data.cinderBackup.customServiceConfig
300-
targets:
301-
- select:
302-
kind: OpenStackControlPlane
303-
fieldPaths:
304-
- spec.cinder.template.cinderBackup.customServiceConfig
305-
options:
306-
create: true
307-
308-
# Set topologyRef.name for cinderBackup
309-
- source:
310-
kind: ConfigMap
311-
name: service-values
312-
fieldPath: data.cinderBackup.topologyRef.name
313-
targets:
314-
- select:
315-
kind: OpenStackControlPlane
316-
fieldPaths:
317-
- spec.cinder.template.cinderBackup.topologyRef.name
293+
- spec.cinder.template.cinderBackups
318294
options:
319295
create: true
320296

examples/dt/dz-storage/control-plane/service-values.yaml

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,43 @@ data:
4040
storage_availability_zone = az0
4141
cinderAPI:
4242
replicas: 3
43-
cinderBackup:
44-
replicas: 0
45-
topologyRef:
46-
name: azone-node-affinity
47-
customServiceConfig: |
48-
[DEFAULT]
49-
# Not implemented in this example
50-
43+
cinderBackups:
44+
cinder-backup-az0:
45+
topologyRef:
46+
name: azone-node-affinity
47+
customServiceConfig: |
48+
[DEFAULT]
49+
backup_share = _replaced_
50+
backup_driver = cinder.backup.drivers.nfs.NFSBackupDriver
51+
backup_mount_point_base = /var/lib/cinder/backup
52+
storage_availability_zone = az0
53+
networkAttachments:
54+
- storage
55+
replicas: 2
56+
cinder-backup-az1:
57+
topologyRef:
58+
name: bzone-node-affinity
59+
customServiceConfig: |
60+
[DEFAULT]
61+
backup_share = _replaced_
62+
backup_driver = cinder.backup.drivers.nfs.NFSBackupDriver
63+
backup_mount_point_base = /var/lib/cinder/backup
64+
storage_availability_zone = az1
65+
networkAttachments:
66+
- storage
67+
replicas: 2
68+
cinder-backup-az2:
69+
topologyRef:
70+
name: czone-node-affinity
71+
customServiceConfig: |
72+
[DEFAULT]
73+
backup_share = _replaced_
74+
backup_driver = cinder.backup.drivers.nfs.NFSBackupDriver
75+
backup_mount_point_base = /var/lib/cinder/backup
76+
storage_availability_zone = az2
77+
networkAttachments:
78+
- storage
79+
replicas: 2
5180
cinderVolumes:
5281
ontap-iscsi-az0:
5382
topologyRef:

examples/dt/dz-storage/validate.md

Lines changed: 72 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,26 @@ This section describes how to:
99

1010
## Pod Distribution
1111

12-
The generated `OpenStckControlPlane` CR has each pod inherit the `spread-pods` topology, defined in [section 6.4](https://docs.redhat.com/en/documentation/red_hat_openstack_services_on_openshift/18.0/html-single/deploying_a_rhoso_environment_with_distributed_zones/index#proc_create-a-Topology-CR-that-spreads-pods-across-all-zones_distributed-control-plane), except the `cinderVolumes`, `manilaShares` and Glance edge pods, which all use `topologyRef` to run in specific availability zones. Confirm that the pods for these services are running on their expected worker nodes based on the zone those where those worker nodes were tagged.
12+
The generated `OpenStckControlPlane` CR has each pod inherit the `spread-pods` topology, defined in [section 6.4](https://docs.redhat.com/en/documentation/red_hat_openstack_services_on_openshift/18.0/html-single/deploying_a_rhoso_environment_with_distributed_zones/index#proc_create-a-Topology-CR-that-spreads-pods-across-all-zones_distributed-control-plane), except the `cinderVolumes`, `cinderBackups`, `manilaShares` and Glance edge pods, which all use `topologyRef` to run in specific availability zones. Confirm that the pods for these services are running on their expected worker nodes based on the zone those where those worker nodes were tagged.
1313

1414
Observe the Cinder pod distribution.
1515
```shell
1616
$ oc get pods -l service=cinder -o wide
17-
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
18-
cinder-cbca0-api-0 2/2 Running 0 45h 192.172.40.49 worker-4 <none> <none>
19-
cinder-cbca0-api-1 2/2 Running 0 45h 192.172.16.50 worker-7 <none> <none>
20-
cinder-cbca0-api-2 2/2 Running 0 45h 192.172.28.26 worker-1 <none> <none>
21-
cinder-cbca0-scheduler-0 2/2 Running 0 45h 192.172.44.23 worker-5 <none> <none>
22-
cinder-cbca0-volume-ontap-iscsi-az0-0 2/2 Running 0 100m 192.172.32.51 worker-2 <none> <none>
23-
cinder-cbca0-volume-ontap-iscsi-az1-0 2/2 Running 0 100m 192.172.44.110 worker-5 <none> <none>
24-
cinder-cbca0-volume-ontap-iscsi-az2-0 2/2 Running 0 100m 192.172.49.52 worker-8 <none> <none>
25-
cinder-db-purge-29170081-s4k78 0/1 Completed 0 23h 192.172.40.57 worker-4 <none> <none>
17+
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
18+
cinder-db-purge-29646721-qrvlq 0/1 Completed 0 12h 192.172.20.66 worker-4 <none> <none>
19+
cinder-fc64f-api-0 2/2 Running 0 24h 192.172.12.33 worker-1 <none> <none>
20+
cinder-fc64f-api-1 2/2 Running 0 24h 192.172.16.43 worker-3 <none> <none>
21+
cinder-fc64f-api-2 2/2 Running 0 24h 192.172.18.20 worker-8 <none> <none>
22+
cinder-fc64f-backup-cinder-backup-az0-0 2/2 Running 0 23h 192.172.12.47 worker-1 <none> <none>
23+
cinder-fc64f-backup-cinder-backup-az0-1 2/2 Running 0 23h 192.172.8.61 worker-2 <none> <none>
24+
cinder-fc64f-backup-cinder-backup-az1-0 2/2 Running 0 23h 192.172.20.63 worker-4 <none> <none>
25+
cinder-fc64f-backup-cinder-backup-az1-1 2/2 Running 0 23h 192.172.14.48 worker-5 <none> <none>
26+
cinder-fc64f-backup-cinder-backup-az2-0 2/2 Running 0 23h 192.172.6.56 worker-7 <none> <none>
27+
cinder-fc64f-backup-cinder-backup-az2-1 2/2 Running 0 23h 192.172.18.60 worker-8 <none> <none>
28+
cinder-fc64f-scheduler-0 2/2 Running 0 24h 192.172.6.37 worker-7 <none> <none>
29+
cinder-fc64f-volume-ontap-iscsi-az0-0 2/2 Running 0 23h 192.172.8.59 worker-2 <none> <none>
30+
cinder-fc64f-volume-ontap-iscsi-az1-0 2/2 Running 0 23h 192.172.16.53 worker-3 <none> <none>
31+
cinder-fc64f-volume-ontap-iscsi-az2-0 2/2 Running 0 23h 192.172.24.54 worker-6 <none> <none>
2632
$
2733
```
2834
Observe the Glance pod distribution.
@@ -500,3 +506,59 @@ Mount the share from the virtual machine at the desired path.
500506
```
501507
mount -t nfs 10.0.0.42:/share_<UUID> /mnt/share
502508
```
509+
510+
## Validate Cinder Backups
511+
512+
Create a test volume in AZ1:
513+
```shell
514+
$ openstack volume create --size 1 vol-az1 --availability-zone az1
515+
516+
$ openstack volume show vol-az1
517+
```
518+
519+
### Scenario 1: Backup and restore within the same AZ
520+
521+
Create a backup in AZ1:
522+
```shell
523+
$ openstack --os-volume-api-version 3.51 volume backup create --availability-zone az1 --name vol-az1-backup-az1 vol-az1
524+
525+
$ openstack volume backup show vol-az1-backup-az1
526+
```
527+
528+
Restore the backup to AZ1:
529+
```shell
530+
$ openstack --os-volume-api-version 3.47 volume create --backup vol-az1-backup-az1 --availability-zone az1 vol-az1-backup-az1-restore-az1
531+
532+
$ openstack volume show vol-az1-backup-az1-restore-az1
533+
```
534+
535+
536+
### Scenario 2: Backup to different AZ, restore to original AZ
537+
538+
Create a backup in AZ2 for the volume in AZ1:
539+
```shell
540+
$ openstack --os-volume-api-version 3.51 volume backup create --availability-zone az2 --name vol-az1-backup-az2 vol-az1
541+
542+
$ openstack volume backup show vol-az1-backup-az2
543+
```
544+
545+
Restore the backup back to AZ1:
546+
```shell
547+
$ openstack --os-volume-api-version 3.47 volume create --backup vol-az1-backup-az2 --availability-zone az1 vol-az1-backup-az2-restore-az1
548+
549+
$ openstack volume show vol-az1-backup-az2-restore-az1
550+
```
551+
552+
### Scenario 3: Backup to different AZ, restore to that AZ
553+
554+
Reusing the backup `vol-az1-backup-az2` created in Scenario 2:
555+
```shell
556+
$ openstack volume backup show vol-az1-backup-az2
557+
```
558+
559+
Restore the AZ2 backup to AZ2:
560+
```shell
561+
$ openstack --os-volume-api-version 3.47 volume create --backup vol-az1-backup-az2 --availability-zone az2 vol-az1-backup-az2-restore-az2
562+
563+
$ openstack volume show vol-az1-backup-az2-restore-az2
564+
```

0 commit comments

Comments
 (0)