mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-11 12:46:49 +00:00
fix(instances): find known VMs by UUID, not by name
Instance.proxy looked the domain up by its stored name. After a rename or a name swap outside WebVirtCloud, an operation on one VM changed another; after a VM was replaced under the same name, operations hit the new VM. wvmInstance takes the UUID and uses lookupByUUIDString, with no fallback to the name: a missing UUID fails instead of picking another domain. Every caller that has an Instance passes it: proxy, console, quota, post-migration autostart and the VDI URL. Migration uses the domain the proxy already resolved. getvvfile and the gstfsd requests use the host's current name of that UUID. Live tests cover a name swap and a VM replaced under the same name; both fail on the previous code.
This commit is contained in:
parent
ffb2ce6bfa
commit
3e427a41b8
9 changed files with 52 additions and 14 deletions
|
|
@ -64,6 +64,7 @@ def check_user_quota(user, instance, cpu, memory, disk_size):
|
|||
usr_inst.instance.compute.password,
|
||||
usr_inst.instance.compute.type,
|
||||
usr_inst.instance.name,
|
||||
uuid=usr_inst.instance.uuid,
|
||||
)
|
||||
cpu += int(conn.get_vcpu())
|
||||
memory += int(conn.get_memory())
|
||||
|
|
@ -181,6 +182,7 @@ def migrate_instance(
|
|||
new_compute.password,
|
||||
new_compute.type,
|
||||
instance.name,
|
||||
uuid=instance.uuid,
|
||||
)
|
||||
|
||||
if autostart:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue