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
This commit is contained in:
Wes Hayutin 2017-01-17 14:39:20 -05:00
parent 261df114ed
commit 8ae6f050a5
1 changed files with 22 additions and 0 deletions

View File

@ -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 }}"