* [PATCH] guestfs: fix destroy tasks
@ 2025-08-14 17:15 Daniel Gomez
[not found] ` <CAB=NE6VO93cG6Am94dHTU5QFicNSTd2zWyR42xiL2Uo3DhD_gg@mail.gmail.com>
2025-08-15 15:43 ` Daniel Gomez
0 siblings, 2 replies; 3+ messages in thread
From: Daniel Gomez @ 2025-08-14 17:15 UTC (permalink / raw)
To: Luis Chamberlain, Chuck Lever; +Cc: kdevops, Daniel Gomez
From: Daniel Gomez <da.gomez@samsung.com>
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
Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
---
Is it correct to use kdevops_storage_pool_path? I think we can also
clean up these 2, right?
scripts/guestfs.Makefile:GUESTFS_ARGS += kdevops_storage_pool_group='$(QEMU_GROUP)'
scripts/guestfs.Makefile:GUESTFS_ARGS += storage_pool_group='$(QEMU_GROUP)'
---
playbooks/roles/guestfs/tasks/destroy.yml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/playbooks/roles/guestfs/tasks/destroy.yml b/playbooks/roles/guestfs/tasks/destroy.yml
index 4e04482d..88cc4c16 100644
--- a/playbooks/roles/guestfs/tasks/destroy.yml
+++ b/playbooks/roles/guestfs/tasks/destroy.yml
@@ -29,8 +29,8 @@
command: "undefine"
flags:
- "nvram"
- - "snapshots-metadata"
- - "checkpoints-metadata"
+ - "snapshots_metadata"
+ - "checkpoints_metadata"
name: "{{ inventory_hostname }}"
uri: "{{ libvirt_uri }}"
changed_when: true
@@ -40,8 +40,8 @@
- name: Clean up storage volumes for target nodes
ansible.builtin.shell: |
- virsh -c {{ libvirt_uri }} vol-delete --pool {{ kdevops_storage_pool }} {{ inventory_hostname }}/root.raw 2>/dev/null || true
- virsh -c {{ libvirt_uri }} vol-delete --pool {{ kdevops_storage_pool }} {{ inventory_hostname }}.raw 2>/dev/null || true
+ virsh -c {{ libvirt_uri }} vol-delete --pool {{ kdevops_storage_pool_path }} {{ inventory_hostname }}/root.raw 2>/dev/null || true
+ virsh -c {{ libvirt_uri }} vol-delete --pool {{ kdevops_storage_pool_path }} {{ inventory_hostname }}.raw 2>/dev/null || true
changed_when: false
ignore_errors: true
---
base-commit: d0f577ffb0004754b6bbe1a71ac3a8a1c1c20b20
change-id: 20250814-fix-guestfs-destroy-a9eeb8e56a65
Best regards,
--
Daniel Gomez <da.gomez@samsung.com>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] guestfs: fix destroy tasks
[not found] ` <CAB=NE6VO93cG6Am94dHTU5QFicNSTd2zWyR42xiL2Uo3DhD_gg@mail.gmail.com>
@ 2025-08-15 11:15 ` Daniel Gomez
0 siblings, 0 replies; 3+ messages in thread
From: Daniel Gomez @ 2025-08-15 11:15 UTC (permalink / raw)
To: Luis Chamberlain; +Cc: Chuck Lever, Daniel Gomez, kdevops@lists.linux.dev
On 14/08/2025 10.23, Luis Chamberlain wrote:
> Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
>
> Luis
Thanks Luis.
For some reason, your review did not make it to the mailing list:
https://lore.kernel.org/all/20250814-fix-guestfs-destroy-v1-1-d58248461800@samsung.com/
But I don't know if there's something wrong in your header email, To/Cc fields?
I've updated the Cc field from kdevops@lists.linux.dev -->
kdevops@lists.linux.dev <kdevops@lists.linux.dev>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] guestfs: fix destroy tasks
2025-08-14 17:15 [PATCH] guestfs: fix destroy tasks Daniel Gomez
[not found] ` <CAB=NE6VO93cG6Am94dHTU5QFicNSTd2zWyR42xiL2Uo3DhD_gg@mail.gmail.com>
@ 2025-08-15 15:43 ` Daniel Gomez
1 sibling, 0 replies; 3+ messages in thread
From: Daniel Gomez @ 2025-08-15 15:43 UTC (permalink / raw)
To: Luis Chamberlain, Chuck Lever, Daniel Gomez; +Cc: Daniel Gomez, kdevops
From: Daniel Gomez <da.gomez@samsung.com>
On Thu, 14 Aug 2025 19:15:50 +0200, Daniel Gomez wrote:
> 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.
>
> [...]
Applied, thanks!
[1/1] guestfs: fix destroy tasks
commit: 1b83079e5060a396cc5491ed4060d4887c025734
Best regards,
--
Daniel Gomez <da.gomez@samsung.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-08-15 15:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-14 17:15 [PATCH] guestfs: fix destroy tasks Daniel Gomez
[not found] ` <CAB=NE6VO93cG6Am94dHTU5QFicNSTd2zWyR42xiL2Uo3DhD_gg@mail.gmail.com>
2025-08-15 11:15 ` Daniel Gomez
2025-08-15 15:43 ` Daniel Gomez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox