[pve-devel] [RFC qemu-server stable-4] add workaround for pve 4.4 to 5.0 live migration

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Jul 11 16:40:24 CEST 2017


commit 85909c04c49879f5fffa366fc3233eee2b157e97 switched from cirrus
to vga for non windows OSs.

This adds an artificial blocker on live migrations from PVE 4.X to
PVE 5.0.
Address it in PVE 4.4 by explicitly setting cirrus in the config if
it would be used, so that a PVE 5.0 starts up the correct hardware in
the case of a migration. Do it only on running VMs with online
migration enabled.
Do not clean it up, as this would then make live migration fail again
until the VM had a real poweroff and power on cycle even from PVE 5.0
to PVE 5.0.
While not the nicest way it is a short and valid solution and doesn't
adds hackery in new code. We may also touch the config only on the
source site until migration phase 3 completes.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---

Another approach would be to check the machine type on the target side and if
older than *-2.9 use cirrus, if not explicitly set already.
But this would then add code on PVE 5.0 which we would need to maintain for a
bit of time, so I'm not sure if that would be the nicer solution...

 PVE/QemuMigrate.pm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
index e6f147e..6cfca0b 100644
--- a/PVE/QemuMigrate.pm
+++ b/PVE/QemuMigrate.pm
@@ -429,6 +429,14 @@ sub phase1 {
 
     my $conf = $self->{vmconf};
 
+    # HACK: avoid migration failure to 5.0 as the VGA default has changed
+    if (!defined($conf->{vga}) && $self->{running} && $self->{opts}->{online}) {
+	my $winversion = PVE::QemuServer::windows_version($conf->{ostype});
+	if ($winversion < 6) {
+	    $conf->{vga} = 'cirrus';
+	}
+    }
+
     # set migrate lock in config file
     $conf->{lock} = 'migrate';
     PVE::QemuConfig->write_config($vmid, $conf);
-- 
2.11.0





More information about the pve-devel mailing list