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 <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2020-03-25 10:02:29 +01:00
parent 9b6efe436d
commit 28e6e180bc

View File

@ -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) = @_;