Skip to content

Commit 4f7c3cd

Browse files
stuggiclaude
authored andcommitted
[cifmw_backup_restore] Add Octavia OVN sync after Neutron sync
Sync Octavia load balancer entries to OVN NB database when Octavia with OVN provider is deployed. Checks spec.octavia.enabled on the OpenStackControlPlane CR, skips if Octavia is not enabled. Placed right after the Neutron sync and before EDPM deployment so OVN NB DB is fully populated when data plane nodes reconnect. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Martin Schuppert <mschuppert@redhat.com>
1 parent 140f441 commit 4f7c3cd

1 file changed

Lines changed: 32 additions & 3 deletions

File tree

roles/cifmw_backup_restore/tasks/restore.yml

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,36 @@
597597
changed_when: true
598598

599599
# ========================================
600-
# Step 11: Restore DataPlane (Order 60)
600+
# Step 11: Sync Octavia to OVN (optional)
601+
# ========================================
602+
# Only when Octavia with OVN provider is deployed. Repopulates OVN NB DB
603+
# with load balancer entries from Octavia's database.
604+
# Ref: https://docs.openstack.org/ovn-octavia-provider/latest/admin/driver.html#octavia-db-to-ovn-database-population
605+
- name: Check if Octavia is enabled
606+
ansible.builtin.shell: |
607+
oc get openstackcontrolplane {{ _ctlplane_name.stdout }} \
608+
-n {{ cifmw_backup_restore_namespace }} \
609+
-o jsonpath='{.spec.octavia.enabled}'
610+
register: _octavia_enabled
611+
changed_when: false
612+
613+
- name: Sync Octavia load balancers to OVN
614+
ansible.builtin.shell: |
615+
oc exec -n {{ cifmw_backup_restore_namespace }} \
616+
-c octavia-api deploy/octavia-api -- \
617+
octavia-ovn-db-sync-util
618+
register: _octavia_ovn_sync
619+
when: _octavia_enabled.stdout == 'true'
620+
changed_when: true
621+
622+
- name: Report Octavia OVN sync result
623+
ansible.builtin.debug:
624+
msg: >-
625+
Octavia OVN sync:
626+
{{ 'completed' if _octavia_enabled.stdout == 'true' else 'skipped (Octavia not enabled)' }}.
627+
628+
# ========================================
629+
# Step 12: Restore DataPlane (Order 60)
601630
# ========================================
602631
- name: Render dataplane restore
603632
ansible.builtin.template:
@@ -617,10 +646,10 @@
617646
ansible.builtin.include_tasks: wait_for_restore.yml
618647
vars:
619648
_restore_name: "openstack-restore-60-dataplane-{{ _restore_suffix }}"
620-
_step_name: "Step 11 (DataPlane restore)"
649+
_step_name: "Step 12 (DataPlane restore)"
621650

622651
# ========================================
623-
# Step 12: EDPM Deployment
652+
# Step 13: EDPM Deployment
624653
# ========================================
625654
- name: Get DataPlaneNodeSet names
626655
ansible.builtin.shell: |

0 commit comments

Comments
 (0)