1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-03 09:26:03 +00:00

fix(instances): a VM with backup checkpoints is deleted and moved offline

libvirt refuses to undefine a domain that has checkpoints unless asked to
drop their metadata. The VM delete job and the shut-off migration's
removal of the source definition now pass CHECKPOINTS_METADATA; a backup
chain ends with them, and the next backup is full.
This commit is contained in:
catborise 2026-11-17 16:55:26 +03:00
parent 272260eec5
commit 5f7555f348
4 changed files with 14 additions and 6 deletions

View file

@ -25,6 +25,7 @@ from libvirt import (
VIR_DOMAIN_XML_SECURE,
VIR_DOMAIN_XML_INACTIVE,
VIR_DOMAIN_XML_MIGRATABLE,
VIR_DOMAIN_UNDEFINE_CHECKPOINTS_METADATA,
VIR_DOMAIN_UNDEFINE_KEEP_NVRAM,
VIR_ERR_NO_DOMAIN,
VIR_ERR_NO_STORAGE_POOL,
@ -632,8 +633,9 @@ class wvmInstances(wvmConnect):
self.delete_nvram(nvram)
raise
try:
# libvirt refuses to undefine a VM with NVRAM without this; the file stays for the cleanup
dom.undefineFlags(VIR_DOMAIN_UNDEFINE_KEEP_NVRAM)
# libvirt refuses to undefine a VM with NVRAM or backup checkpoints without these; the file stays for
# the cleanup, the checkpoints are this host's (the next backup is full)
dom.undefineFlags(VIR_DOMAIN_UNDEFINE_KEEP_NVRAM | VIR_DOMAIN_UNDEFINE_CHECKPOINTS_METADATA)
try:
started = dom.isActive()
except libvirtError as error: