Commit 1b83079
committed
guestfs: fix destroy tasks
The destroy task was failing to properly undefine VMs due to two
Ansible module compatibility issues: 1. The libvirt module flags
format [1] requiring underscores instead of hyphens in flag names. This
lead to failures with "Got no match for: snapshots-metadata" errors.
2. Undefined variable in storage volume cleanup. This caused volume
deletion to fail, leaving storage files behind after VM destruction.
These failures resulted in VMs remaining in 'shut off' state instead of
being completely removed.
Link: https://docs.ansible.com/ansible/latest/collections/community/libvirt/virt_module.html#parameter-flags [1]
Fixes error:
27 - name: Undefine each stopped target node
^ column 3
fatal: [debian13-xfs-reflink-4k -> localhost]: FAILED! => {"changed":
true, "msg": "value of flags must be one or more of: managed_save,
snapshots_metadata, nvram, keep_nvram, checkpoints_metadata,
delete_volumes. Got no match for: snapshots-metadata,
checkpoints-metadata"}
...
TASK [guestfs : Clean up storage volumes for target nodes]
task path:
/media/tarkir/dagomez/src/linux-kdevops/kdevops/playbooks/roles/guestfs/
tasks/destroy.yml:41
[ERROR]: Task failed: Finalization of task args for
'ansible.builtin.shell' failed: Error while resolving value for
'_raw_params': 'kdevops_storage_pool' is undefined
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Daniel Gomez <[email protected]>1 parent d0f577f commit 1b83079
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
| 32 | + | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
| 43 | + | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
0 commit comments