1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-11 04:36:48 +00:00

fix(computes): a VM migrates to its host's panel address when it has no migration address

Without a migration address libvirt sends a migrating VM to the
destination's own host name, which the source host often cannot resolve:
a live migration to a host added without one failed ("Unable to resolve
address ..."), also when the other host had one. The destination's
address on the Computes page, which the panel reaches it at, is now the
default; the migration address stays for another network. A host the
panel reaches on its loopback keeps libvirt's default.
This commit is contained in:
catborise 2026-11-01 17:59:39 +03:00
parent 940e639149
commit cf991adad5
8 changed files with 74 additions and 23 deletions

View file

@ -340,7 +340,7 @@ def record_migration(instance, new_compute):
def migration_target(compute):
"""The destination for the log: its host name, and the migration address
when one is set and differs."""
when one is set and differs (else the migration goes to the host name)."""
if compute.migration_address not in ("", compute.hostname):
return _("%(hostname)s via %(address)s") % {"hostname": compute.hostname, "address": compute.migration_address}
return compute.hostname