mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-10 20:26:48 +00:00
fix(computes): a deleted compute's VMs keep their owners
Deleting a compute removed its VMs from the panel together with their owners, while the VMs kept running on the host: added again, the host's VMs came back with no owners. A compute's delete now treats each VM as one that left its compute: its owners follow the same UUID on another compute or wait in a tombstone for the retention period. One function, forget(), does this for the refresh and for the delete; the API's compute delete goes through the same model delete. The delete holds the compute exclusive and locks its row before its VMs', as the reconcile does: a reconcile, VM operation or job on the compute makes it busy instead of losing owners to a concurrent restore or deadlocking with it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
fbe93d9aee
commit
2dee5ba41c
7 changed files with 92 additions and 14 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import json
|
||||
|
||||
from admin.decorators import superuser_only
|
||||
from django.conf import settings
|
||||
from django.core import signing
|
||||
from django.http import HttpResponse
|
||||
from django.shortcuts import get_object_or_404, redirect, render
|
||||
|
|
@ -129,8 +130,9 @@ def compute_delete(request, compute_id):
|
|||
request,
|
||||
"common/confirm_delete.html",
|
||||
{"object": compute,
|
||||
"consequence": _("Its VMs keep running on the host, but the panel forgets them and who owns them; "
|
||||
"added again, the host's VMs come back without owners.")},
|
||||
"consequence": _("Its VMs keep running on the host and leave the panel; their owners are kept for "
|
||||
"%(days)s days on the Removed VMs page and come back if the host is added again.")
|
||||
% {"days": getattr(settings, "INSTANCE_OWNERSHIP_RETENTION_DAYS", 30)}},
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue