diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm index cb0afaa7..09cc1d83 100644 --- a/PVE/QemuMigrate.pm +++ b/PVE/QemuMigrate.pm @@ -433,7 +433,9 @@ sub scan_local_volumes { # we cannot migrate shapshots on local storage # exceptions: 'zfspool' or 'qcow2' files (on directory storage) - die "online storage migration not possible if snapshot exists\n" if $self->{running}; + die "online storage migration not possible if non-replicated snapshot exists\n" + if $self->{running} && !$local_volumes->{$volid}->{replicated}; + die "remote migration with snapshots not supported yet\n" if $self->{opts}->{remote}; if (!($scfg->{type} eq 'zfspool' diff --git a/test/run_qemu_migrate_tests.pl b/test/run_qemu_migrate_tests.pl index 0dffaa43..3a3049d7 100755 --- a/test/run_qemu_migrate_tests.pl +++ b/test/run_qemu_migrate_tests.pl @@ -678,7 +678,7 @@ my $tests = [ 'with-local-disks' => 1, }, expected_calls => {}, - expect_die => 'online storage migration not possible if snapshot exists', + expect_die => 'online storage migration not possible if non-replicated snapshot exists', expected => { source_volids => local_volids_for_vm(4567), target_volids => {}, @@ -1237,8 +1237,11 @@ my $tests = [ 'with-local-disks' => 1, }, target_volids => local_volids_for_vm(105), - expected_calls => {}, - expect_die => "online storage migration not possible if snapshot exists", + expected_calls => { + %{$replicated_expected_calls_online}, + 'block-dirty-bitmap-add-drive-scsi0' => 1, + 'block-dirty-bitmap-add-drive-ide0' => 1, + }, expected => { source_volids => local_volids_for_vm(105), target_volids => local_volids_for_vm(105),