1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-02 00:46:05 +00:00

fix(instances): a migrated VM's source definition is always removed

Migration left the VM defined on the source host unless "Delete
original" was ticked (VIR_MIGRATE_UNDEFINE_SOURCE). With the shared
storage migration needs, that definition points at the disks the
destination VM is running on: the VM showed on both hosts and could be
started (or autostarted) a second time against the same disks; only a
configured lock manager stops that.

moveto now always passes VIR_MIGRATE_UNDEFINE_SOURCE with
VIR_MIGRATE_PERSIST_DEST. The option is gone from the form, the view,
the API (MigrateSerializer.xml_del) and the clone auto-migration. It
removes the definition, not the disk files.
This commit is contained in:
catborise 2026-10-06 11:52:51 +03:00
parent 1ce7dbf18e
commit 25b3671c33
8 changed files with 56 additions and 22 deletions

View file

@ -657,7 +657,6 @@ def migrate(request, pk):
compute_id = request.POST.get("compute_id", "")
live = request.POST.get("live_migrate", False)
unsafe = request.POST.get("unsafe_migrate", False)
xml_del = request.POST.get("xml_delete", False)
offline = request.POST.get("offline_migrate", False)
autoconverge = request.POST.get("autoconverge", False)
compress = request.POST.get("compress", False)
@ -675,7 +674,6 @@ def migrate(request, pk):
request.user,
live,
unsafe,
xml_del,
offline,
autoconverge,
compress,
@ -1878,7 +1876,7 @@ def clone(request, pk):
new_compute = Compute.objects.order_by("?").first()
if new_compute != instance.compute:
utils.migrate_instance(
new_compute, new_instance, request.user, xml_del=True, offline=True
new_compute, new_instance, request.user, offline=True
)
return redirect(reverse("instances:instance", args=[new_instance.id]))