]> git.proxmox.com Git - qemu-server.git/commitdiff
Add LVM and LVMThin to QemuMigration
authorWolfgang Link <w.link@proxmox.com>
Mon, 13 Jun 2016 13:54:14 +0000 (15:54 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 16 Jun 2016 06:14:33 +0000 (08:14 +0200)
Offline migration on LVM and LVMThin are possible offline.

PVE/QemuMigrate.pm

index 7b9506f93a65a8e4568a00defcbb61d09f05a1ab..eb3ced0ea3424b2a6f89468f3fa4f522e4964e40 100644 (file)
@@ -287,18 +287,20 @@ sub sync_disks {
            die "can't do online migration - VM uses local disks\n";
        }
 
-       # do some checks first
+       # additional checks for local storage
        foreach my $volid (keys %$volhash) {
            my ($sid, $volname) = PVE::Storage::parse_volume_id($volid);
            my $scfg =  PVE::Storage::storage_config($self->{storecfg}, $sid);
 
+           my $migratable = ($scfg->{type} eq 'dir') || ($scfg->{type} eq 'zfspool') ||
+               ($scfg->{type} eq 'lvmthin') || ($scfg->{type} eq 'lvm');
+
            die "can't migrate '$volid' - storage type '$scfg->{type}' not supported\n"
-               if (!($scfg->{type} eq 'dir' || $scfg->{type} eq 'zfspool') && (!$sharedvm));
+               if !$migratable;
 
-           # if file, check if a backing file exist
-           if (!($scfg->{type} eq 'dir' || $scfg->{type} eq 'zfspool') && (!$sharedvm)) {
-               my (undef, undef, undef, $parent) = PVE::Storage::volume_size_info($self->{storecfg}, $volid, 1);
-               die "can't migrate '$volid' as it's a clone of '$parent'" if $parent;
+           # image is a linked clone on local storage, se we can't migrate.
+           if (my $basename = (PVE::Storage::parse_volname($self->{storecfg}, $volid))[3]) {
+               die "can't migrate '$volid' as it's a clone of '$basename'";
            }
        }