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

fix(instances): a volume already named as a new VM's disk refuses the create

A new disk or template copy whose name a volume of its pool already had
made the job fail on it; recovery then took that volume for the job's own,
ended the job uncertain and kept its claims, so no VM could be created on
that compute until an admin resolved it. Recovery also took a volume of the
same name in any other pool for the job's, and one in a stopped pool for
nothing left.

The form, the API and the worker now refuse a name a volume of the disk's
pool already has, as they did for a template copy's .img only. Recovery
looks in the job's own pools; one that is not running cannot be listed, so
recovery waits for it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
This commit is contained in:
catborise 2026-11-10 20:45:04 +03:00
parent 417be11616
commit b7c5f98ba5
3 changed files with 62 additions and 20 deletions

View file

@ -94,8 +94,8 @@ class CloudInitCreateTestCase(TransactionTestCase):
missing = libvirt.libvirtError("no domain")
missing.get_error_code = lambda: libvirt.VIR_ERR_NO_DOMAIN
conn.return_value.wvm.lookupByUUIDString.side_effect = missing
conn.return_value.wvm.listAllStoragePools.return_value = [
SimpleNamespace(listVolumes=lambda: ["cidata-abababab-0000-1111-2222-333333333333.iso"])]
conn.return_value.wvm.storagePoolLookupByName.return_value = SimpleNamespace(
listVolumes=lambda: ["cidata-abababab-0000-1111-2222-333333333333.iso"])
outcome = CreateInstance().reconcile(op)
self.assertEqual(outcome.state, Operation.UNCERTAIN)
self.assertIn("cidata-abababab-0000-1111-2222-333333333333.iso", words(outcome.error))