[pve-devel] applied: [PATCH qemu-server] add basic version check for live-migration with replicated disks

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Mar 25 11:31:01 CET 2020


as we need at least pve-qemu in 4.2 for this to work, the target side
is implicitly checked with "to old version" check for migrate or the
mirror will fail anyway.

Just use the simple "qemu binary version check", as we could stil
live migrate an older snapshot with older machine versions if both
sides have a recent enough qemu.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 PVE/QemuMigrate.pm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
index 6f300de..b202368 100644
--- a/PVE/QemuMigrate.pm
+++ b/PVE/QemuMigrate.pm
@@ -12,6 +12,7 @@ use PVE::Cluster;
 use PVE::Storage;
 use PVE::QemuServer;
 use PVE::QemuServer::Drive;
+use PVE::QemuServer::Helpers qw(min_version);
 use PVE::QemuServer::Machine;
 use PVE::QemuServer::Monitor qw(mon_cmd);
 use Time::HiRes qw( usleep );
@@ -448,6 +449,12 @@ sub sync_disks {
 	my $rep_cfg = PVE::ReplicationConfig->new();
 	if (my $jobcfg = $rep_cfg->find_local_replication_job($vmid, $self->{node})) {
 	    if ($self->{running}) {
+
+		my $version = PVE::QemuServer::kvm_user_version();
+		if (!min_version($version, 4, 2)) {
+		    die "can't live migrate VM with replicated volumes, pve-qemu to old (< 4.2)!\n"
+		}
+
 		my $live_replicatable_volumes = {};
 		PVE::QemuServer::foreach_drive($conf, sub {
 		    my ($ds, $drive) = @_;
-- 
2.20.1





More information about the pve-devel mailing list