`virsh undefine` argument `--nvram` is only supported by newer
versions of libvirt.
Although this is mandatory for AArch64, for x86_64 this is not a
blocker (since we don't enable OVMF for the VMs on the jumpserver).
Change-Id: I3a82bc54b36228980a41d77a463a7558a685c03d
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
for node in $(virsh list --name --all | grep -P '\w{3}\d{2}'); do
virsh domblklist "${node}" | awk '/^.da/ {print $2}' | \
xargs --no-run-if-empty -I{} sudo rm -f {}
- virsh undefine "${node}" --remove-all-storage --nvram
+ virsh undefine "${node}" --remove-all-storage --nvram || \
+ virsh undefine "${node}" --remove-all-storage
done
}