cifmw_backup_restore
Automate OpenStack on OpenShift backup and restore operations using OADP (OpenShift API for Data Protection) and Velero. The role supports three actions: backup, restore, and cleanup.
backup — creates Galera database dumps, optionally backs up OVN NB/SB databases onto their PVCs, then creates Velero backups of labeled PVCs (via CSI snapshots) and cluster resources.
restore — performs an ordered Velero restore sequence (PVCs, foundation, infrastructure, control plane, Galera, optional OVN file restore, full control plane resume, dataplane, EDPM), then Neutron–OVN verification and sync (log mode, then repair, matching the backup-restore user guide Step 12).
cleanup — tears down dataplane and control-plane resources so the namespace is ready for a fresh restore.
Privilege escalation
None. All cluster operations are performed through oc against the target
OpenShift cluster.
Parameters
Common
cifmw_backup_restore_action: (String) Action to perform. Must be one ofbackup,restore, orcleanup. Defaults to""(role will fail if unset).cifmw_backup_restore_namespace: (String) Target OpenStack namespace. Defaults toopenstack.cifmw_backup_restore_oadp_namespace: (String) Namespace where Velero/OADP is running. Defaults toopenshift-adp.cifmw_backup_restore_auto_ack: (Boolean) Skip interactive pause prompts whentrue. Defaults tofalse.cifmw_backup_restore_ovn_db: (Boolean) Whentrue(default), the backup path labels OVN NB/SB PVCs and runsovsdb-clientbackup before the OADP PVC backup, and the restore path runs OVN NB/SB file restore after Galera (when timestamped files exist on the PVC) before resuming the full control plane. Set tofalseto skip both; post-EDPMneutron-ovn-db-syncstill runs when OVN files were not backed up.cifmw_backup_restore_ovn_db_ready_timeout: (String) Timeout foroc waiton OVN database pods during OVN backup/restore. Defaults to5m.
Backup
cifmw_backup_restore_galera_backup_timeout: (String) Timeout foroc waiton Galera backup jobs. Defaults to10m.cifmw_backup_restore_galera_storage_class: (String) StorageClass for Galera backup PVCs. Empty string uses the cluster default. Defaults to"".cifmw_backup_restore_galera_storage_request: (String) Size of the Galera backup PVC. Defaults to5Gi.cifmw_backup_restore_galera_transfer_storage_request: (String) Size of the Galera transfer storage PVC. Defaults to5Gi.cifmw_backup_restore_oadp_backup_timeout: (String) Timeout for OADP PVC and resource backup completion. Defaults to30m.cifmw_backup_restore_storage_location: (String) VeleroBackupStorageLocationname. Defaults tovelero-1.cifmw_backup_restore_backup_ttl: (String) TTL for Velero backups. Defaults to720h.cifmw_backup_restore_snapshot_move_data: (Boolean) Enable Velero snapshot data mover. Whentrue, cleanup also deletes labeled PVCs. Defaults totrue.
Restore
cifmw_backup_restore_backup_timestamp: (String) Timestamp suffix that identifies the backup to restore (e.g.20260311-081234). Required whencifmw_backup_restore_actionisrestore.cifmw_backup_restore_restore_timeout: (Integer) Seconds to wait for each Velero Restore to reach a terminal phase. Defaults to900.cifmw_backup_restore_infra_ready_timeout: (String) Timeout foroc waitonOpenStackControlPlaneInfrastructureReady. Defaults to20m.cifmw_backup_restore_ctlplane_ready_timeout: (String) Timeout foroc waiton control planeReadyafter removing the deployment-stage annotation. Defaults to10m.cifmw_backup_restore_strict_restore: (Boolean) Fail on VeleroPartiallyFailedstatus whentrue; only warn whenfalse. Defaults totrue.cifmw_backup_restore_restore_content: (String) Content flag passed torestore_galera(--content). Defaults todata.cifmw_backup_restore_edpm_deploy_timeout: (String) Timeout foroc waiton the post-restore EDPM deployment. Defaults to40m.cifmw_backup_restore_pin_pvcs: (Boolean) Enable PVC-to-node pinning during restore for WaitForFirstConsumer storage classes. Defaults tofalse.Post-EDPM Neutron–OVN steps follow user guide Step 12: run
neutron-ovn-db-sync-utilinlogmode first (neutron-dist.conf,neutron.conf,neutron.conf.d). Repair runs ifcifmw_backup_restore_ovn_dbisfalse(no OVN NB/SB file backup was taken), or if log-mode stdout/stderr contains aWARNINGline—Neutron reports drift that way while still exiting 0. If OVN file backup/restore was enabled and log output has noWARNINGlines, repair is skipped as redundant.
End-to-end orchestration (e2e.yml)
cifmw_backup_restore_install_deps: (Boolean) Install MinIO, OADP, and GaleraBackup CRs. Defaults totrue.cifmw_backup_restore_create_workload: (Boolean) Create a test VM with floating IP before backup. Defaults totrue.cifmw_backup_restore_run_backup: (Boolean) Run the backup step. Defaults totrue.cifmw_backup_restore_run_cleanup: (Boolean) Run the cleanup step. Defaults totrue.cifmw_backup_restore_run_restore: (Boolean) Run the restore step. Defaults totrue.cifmw_backup_restore_run_post_tempest: (Boolean) Run tempest validation after restore. Defaults tofalse.cifmw_backup_restore_test_swift_data: (Boolean) Upload a random file to Swift before backup and verify it can be downloaded after restore. Catches Swift data loss caused by xattr issues (OSPRH-29818). Defaults totrue.cifmw_backup_restore_swift_test_container: (String) Swift container name for the test object. Defaults tobackup-test-container.cifmw_backup_restore_swift_test_object: (String) Object name for the test file. Defaults tobackup-test-object.cifmw_backup_restore_swift_test_file_size_bytes: (Integer) Size of the random test file in bytes. Defaults to1048576(1 MiB).
Cleanup
cifmw_backup_restore_cleanup_ctlplane: (Boolean) Delete control-plane resources during cleanup. Defaults totrue.cifmw_backup_restore_cleanup_dataplane: (Boolean) Delete dataplane resources during cleanup. Defaults totrue.
Examples
Running a backup
- hosts: localhost
tasks:
- name: Backup OpenStack
ansible.builtin.include_role:
name: cifmw_backup_restore
vars:
cifmw_backup_restore_action: backup
cifmw_backup_restore_namespace: openstack
cifmw_backup_restore_auto_ack: true
Restoring from a backup
- hosts: localhost
tasks:
- name: Restore OpenStack
ansible.builtin.include_role:
name: cifmw_backup_restore
vars:
cifmw_backup_restore_action: restore
cifmw_backup_restore_backup_timestamp: "20260311-081234"
cifmw_backup_restore_auto_ack: true
Cleaning up before a restore
- hosts: localhost
tasks:
- name: Cleanup namespace
ansible.builtin.include_role:
name: cifmw_backup_restore
vars:
cifmw_backup_restore_action: cleanup
cifmw_backup_restore_auto_ack: true
cifmw_backup_restore_cleanup_ctlplane: true
cifmw_backup_restore_cleanup_dataplane: true