From 28e6e180bcae77f5534bdc2a5b9e6018909cf889 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Wed, 25 Mar 2020 10:02:29 +0100 Subject: [PATCH] add basic version check for live-migration with replicated disks 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 --- PVE/QemuMigrate.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm index 6f300de8..b2023689 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) = @_;