Skip to content

Commit

Permalink
[Bug_Fix] Fix cleanup.sh.j2 template doesn't destroy domain properly (s…
Browse files Browse the repository at this point in the history
…onic-net#11517)

When I try run the script to clean up domains. will got error:

error: Failed to undefine domain vlab-01
error: Requested operation is not valid: cannot undefine transient domain
That's because the domain was not destroyed properly.
  • Loading branch information
w1nda authored Feb 4, 2024
1 parent 8968e9b commit 1291ad2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ansible/roles/vm_set/templates/cleanup.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -ex
test -z "$(virsh list --state-running --name)" || virsh list --state-running --name | xargs -I % virsh destroy %

# stop paused VMs
test -z "$(virsh list --state-paused --name)" || virsh list --state-running --name | xargs -I % virsh destroy %
test -z "$(virsh list --state-paused --name)" || virsh list --state-paused --name | xargs -I % virsh destroy %

# undefine all VMs
test -z "$(virsh list --all --name)" || virsh list --all --name | xargs -I % virsh undefine %
Expand Down

0 comments on commit 1291ad2

Please sign in to comment.