From 8ae6f050a523c8e8af0cb4d71165e31140b66985 Mon Sep 17 00:00:00 2001 From: Wes Hayutin Date: Tue, 17 Jan 2017 14:39:20 -0500 Subject: [PATCH] ensure the volume pool can be marked autostart in all cases In some cases after rerunning the workflow it is possible to get into a state where the oooq pool is running but not autostarted. In this case the pool_check will pass and pool autostart will fail. This should provide the steps required for autostart to work in either case. Closes-Bug: #1657232 Change-Id: Ieba0caa40290c9e03740cef337c6a3f3fa04db30 --- roles/libvirt/setup/overcloud/tasks/main.yml | 22 ++++++++++++++++++++ 1 file changed, 22 insertions(+) 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 }}"