Specify backing format for restoring images

45de287447
provides a fix to autodect the backing format.

Until we have that fix in libguestfs, specify it explicitly.

Related: rhbz#1998820

Change-Id: Ibfbefcacd684f046c0798987483c48a97e222092
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
This commit is contained in:
Bogdan Dobrelya 2021-12-14 15:28:36 +01:00
parent e13a68310c
commit b5083aff99
1 changed files with 2 additions and 2 deletions

View File

@ -47,7 +47,7 @@
- name: Create snapshot
shell: |
mv {{ libvirt_volume_path }}/{{ item.name }}.qcow2 {{ libvirt_volume_path }}/{{ item.name }}.qcow2.bak
qemu-img create -f qcow2 -b {{ libvirt_volume_path }}/{{ item.name }}.qcow2.bak {{ libvirt_volume_path }}/{{ item.name }}.qcow2
qemu-img create -F qcow2 -f qcow2 -b {{ libvirt_volume_path }}/{{ item.name }}.qcow2.bak {{ libvirt_volume_path }}/{{ item.name }}.qcow2
args:
creates: "{{ libvirt_volume_path }}/{{ item.name }}.qcow2.bak"
with_items: "{{ overcloud_nodes }}"
@ -57,7 +57,7 @@
- name: Restore previous snapshot
shell: |
rm {{ libvirt_volume_path }}/{{ item.name }}.qcow2
qemu-img create -f qcow2 -b {{ libvirt_volume_path }}/{{ item.name }}.qcow2.bak {{ libvirt_volume_path }}/{{ item.name }}.qcow2
qemu-img create -F qcow2 -f qcow2 -b {{ libvirt_volume_path }}/{{ item.name }}.qcow2.bak {{ libvirt_volume_path }}/{{ item.name }}.qcow2
with_items: "{{ overcloud_nodes }}"
when: snapshot_restore|bool
changed_when: true