diff --git a/roles/libvirt/setup/overcloud/tasks/main.yml b/roles/libvirt/setup/overcloud/tasks/main.yml index b56943b16..afc2ab78e 100644 --- a/roles/libvirt/setup/overcloud/tasks/main.yml +++ b/roles/libvirt/setup/overcloud/tasks/main.yml @@ -30,6 +30,28 @@ name: "{{ libvirt_volume_pool }}" uri: "{{ libvirt_uri }}" +# In some cases the pool_check can pass and the pool xml config is absent +# In this case it is required to dump the xml and redefine the pool +# I believe this is the case when {{ working_dir }}/volume_pool.xml is not present. +# https://bugs.launchpad.net/tripleo-quickstart/+bug/1657232 + +- name: check for the existence of {{ working_dir }}/volume_pool.xml + stat: + path: "{{ working_dir }}/volume_pool.xml" + register: volume_pool + +- name: dump the running virsh pool's xml file to the system + shell: "virsh pool-dumpxml {{ libvirt_volume_pool }} > {{ working_dir }}/volume_pool.xml" + when: volume_pool.stat.exists == False + environment: + LIBVIRT_DEFAULT_URI: "{{ libvirt_uri }}" + +- name: re-define the volume pool + command: "virsh pool-define {{ working_dir }}/volume_pool.xml" + when: volume_pool.stat.exists == False + environment: + LIBVIRT_DEFAULT_URI: "{{ libvirt_uri }}" + - name: Mark volume pool for autostart virt_pool: name: "{{ libvirt_volume_pool }}"