]> git.proxmox.com Git - qemu-server.git/commitdiff
migration: fix issue with qcow2 cloudinit disk live migration
authorFiona Ebner <f.ebner@proxmox.com>
Wed, 21 Jun 2023 10:43:39 +0000 (12:43 +0200)
committerFiona Ebner <f.ebner@proxmox.com>
Wed, 21 Jun 2023 10:48:11 +0000 (12:48 +0200)
The check for with_snapshots for qcow2 needs to happen for these too.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
PVE/QemuMigrate.pm

index bc60c496a9ff4bc5c3997250fd1b55d5d7a6c2ae..506911e2c15cf454a68bcd46f94e95b4d9003e12 100644 (file)
@@ -394,6 +394,11 @@ sub scan_local_volumes {
            $local_volumes->{$volid}->{drivename} = $attr->{drivename}
                if $attr->{drivename};
 
+           # If with_snapshots is not set for storage migrate, it tries to use
+           # a raw+size stream, but on-the-fly conversion from qcow2 to raw+size
+           # back to qcow2 is currently not possible.
+           $local_volumes->{$volid}->{snapshots} = ($local_volumes->{$volid}->{format} =~ /^(?:qcow2|vmdk)$/);
+
            if ($attr->{cdrom}) {
                if ($volid =~ /vm-\d+-cloudinit/) {
                    $local_volumes->{$volid}->{ref} = 'generated';
@@ -401,10 +406,6 @@ sub scan_local_volumes {
                }
                die "local cdrom image\n";
            }
-           # If with_snapshots is not set for storage migrate, it tries to use
-           # a raw+size stream, but on-the-fly conversion from qcow2 to raw+size
-           # back to qcow2 is currently not possible.
-           $local_volumes->{$volid}->{snapshots} = ($local_volumes->{$volid}->{format} =~ /^(?:qcow2|vmdk)$/);
 
            my ($path, $owner) = PVE::Storage::path($storecfg, $volid);