Skip to content

Commit

Permalink
DR-Failback errors when gathering/detecting HA VM as well as storage …
Browse files Browse the repository at this point in the history
…domains

Signed-off-by: Shubha Kulkarni <[email protected]>
  • Loading branch information
shubhaOracle authored and mwperina committed Dec 9, 2022
1 parent 8db8e10 commit 88fab7b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,37 @@
- name: Remove valid storage domain main block
block:
- name: Fetch active/maintenance/detached storage domain for remove
ovirt_storage_domain_info:
pattern: >
name={{ storage['dr_' + dr_source_map + '_name'] }} and
datacenter={{ storage['dr_' + dr_source_map + '_dc_name'] }} and {{ dr_active_domain_search }}
auth: "{{ ovirt_auth }}"
register: storage_domain_info_active

- name: Fetch maintenance storage domain for remove
ovirt_storage_domain_info:
pattern: >
name={{ storage['dr_' + dr_source_map + '_name'] }} and
datacenter={{ storage['dr_' + dr_source_map + '_dc_name'] }} and {{ dr_maintenance_domain_search }}
auth: "{{ ovirt_auth }}"
register: storage_domain_info_maintenance

- name: Fetch detached storage domain for remove
ovirt_storage_domain_info:
pattern: >
name={{ storage['dr_' + dr_source_map + '_name'] }} and
(
datacenter={{ storage['dr_' + dr_source_map + '_dc_name'] }} and {{ dr_active_domain_search }} or
datacenter={{ storage['dr_' + dr_source_map + '_dc_name'] }} and {{ dr_maintenance_domain_search }} or
{{ dr_unattached_domain_search }}
)
auth: "{{ ovirt_auth }}"
register: storage_domain_info
register: storage_domain_info_detached

- name: Remove valid storage domain
include_tasks: remove_domain_process.yml
vars:
sd: "{{ sd }}"
with_items:
- "{{ storage_domain_info.ovirt_storage_domains }}"
- "{{ storage_domain_info_active.ovirt_storage_domains }}"
- "{{ storage_domain_info_maintenance.ovirt_storage_domains }}"
- "{{ storage_domain_info_detached.ovirt_storage_domains }}"
when: (not only_master and not sd.master) or (only_master and sd.master)
loop_control:
loop_var: sd
Expand Down
2 changes: 1 addition & 1 deletion roles/disaster_recovery/tasks/unregister_entities.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

- name: Init list property for running_vms
ansible.builtin.set_fact:
res_ovirt_vms="[]"
res_ovirt_vms=[]

- name: Map all running VMs in fact
ansible.builtin.set_fact:
Expand Down

0 comments on commit 88fab7b

Please sign in to comment.