[pve-devel] [PATCH V2 qemu-server] Add LVM and LVMThin to QemuMigration

Wolfgang Link w.link at proxmox.com
Wed Jun 8 14:59:08 CEST 2016


Ofline migration on LVM and LVMThin are possible offline.
---
 PVE/QemuMigrate.pm | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
index 7b9506f..1d5664b 100644
--- a/PVE/QemuMigrate.pm
+++ b/PVE/QemuMigrate.pm
@@ -293,12 +293,13 @@ sub sync_disks {
 	    my $scfg =  PVE::Storage::storage_config($self->{storecfg}, $sid);
 
 	    die "can't migrate '$volid' - storage type '$scfg->{type}' not supported\n"
-		if (!($scfg->{type} eq 'dir' || $scfg->{type} eq 'zfspool') && (!$sharedvm));
+		if (!($scfg->{type} eq 'dir' || $scfg->{type} eq 'zfspool' || $scfg->{type} eq 'lvmthin') && (!$sharedvm));
 
 	    # 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;
+	    if ($scfg->{type} eq 'dir' || $scfg->{type} eq 'zfspool' || $scfg->{type} eq 'lvmthin')  {
+		#if a basename exists there must be a parrent.
+		my $basename = (PVE::Storage::parse_volname($self->{storecfg}, $volid))[3];
+		die "can't migrate '$volid' as it's a clone of '$basename'" if $basename;
 	    }
 	}
 
-- 
2.1.4





More information about the pve-devel mailing list