From 71cc2c41777def4c335df2ebed95f53b281232b0 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Wed, 16 Nov 2022 12:45:25 +0100 Subject: [PATCH] migration: cloudinit check: bump manager dependency and guard with cloudinit drive The former to ensure the manager that depends on the newer qemu-server is actually installed and the latter to avoid false positives Signed-off-by: Thomas Lamprecht --- PVE/QemuMigrate.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm index 9759aa29..5cd7d288 100644 --- a/PVE/QemuMigrate.pm +++ b/PVE/QemuMigrate.pm @@ -125,9 +125,12 @@ sub prepare { my $version = PVE::QemuServer::Helpers::get_node_pvecfg_version($self->{node}); my $cloudinit_config = $conf->{cloudinit}; - if (defined($cloudinit_config) && keys %$cloudinit_config && - !PVE::QemuServer::Helpers::pvecfg_min_version($version, 7, 2, 5)) { - die "target node is too old and doesn't support new cloudinit section\n"; + if ( + PVE::QemuConfig->has_cloudinit($conf) && defined($cloudinit_config) + && scalar(keys %$cloudinit_config) > 0 + && !PVE::QemuServer::Helpers::pvecfg_min_version($version, 7, 2, 13) + ) { + die "target node is too old (manager <= 7.2-13) and doesn't support new cloudinit section\n"; } my $repl_conf = PVE::ReplicationConfig->new();