mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-01 16:36:06 +00:00
fix(instances): a create whose definition answer was lost keeps the VM's disk
A definition can go through on the host while its answer is lost, as when the connection drops right then. The create job took every failed definition for none and deleted the new disk and seed, so the VM could be left defined without them, and recovery then reported it created. The job now asks the host for the VM's UUID first. Only when the host says there is no such VM do the new volumes go; otherwise they stay and recovery decides, recording the VM it finds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
This commit is contained in:
parent
b7c5f98ba5
commit
590b8d956d
4 changed files with 34 additions and 1 deletions
|
|
@ -31,6 +31,9 @@ class CloudInitCreateTestCase(TransactionTestCase):
|
|||
patcher = patch("instances.jobs.wvmCreate")
|
||||
self.conn = patcher.start().return_value
|
||||
self.addCleanup(patcher.stop)
|
||||
missing = libvirt.libvirtError("no domain")
|
||||
missing.get_error_code = lambda: libvirt.VIR_ERR_NO_DOMAIN
|
||||
self.conn.wvm.lookupByUUIDString.side_effect = missing # until the job defines the VM
|
||||
self.conn.get_instances.return_value = []
|
||||
self.conn.get_cache_modes.return_value = {"none": "Disable cache"}
|
||||
self.conn.get_firmwares.return_value = ["BIOS", "UEFI", "UEFI Secure Boot"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue