mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-03 17:36:05 +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:
parent
272260eec5
commit
5f7555f348
4 changed files with 14 additions and 6 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class ShutOffMigrationTestCase(unittest.TestCase):
|
|||
destination(host).moveto(source, "vm", live=False, unsafe=False, offline=True)
|
||||
self.assertEqual(host.defined, ["<domain><name>vm</name></domain>"])
|
||||
self.assertEqual(source.instance.calls, [])
|
||||
self.assertEqual(source.instance.undefined, libvirt.VIR_DOMAIN_UNDEFINE_KEEP_NVRAM)
|
||||
self.assertEqual(source.instance.undefined, libvirt.VIR_DOMAIN_UNDEFINE_KEEP_NVRAM | libvirt.VIR_DOMAIN_UNDEFINE_CHECKPOINTS_METADATA)
|
||||
|
||||
def test_a_tpm_without_local_state_moves(self):
|
||||
xml = "<domain><devices><tpm model='tpm-tis'><backend type='passthrough'/></tpm></devices></domain>"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue