[pve-devel] [PATCH storage] fix #1122: correctly create LUNs for linked clones
Fabian Grünbichler
f.gruenbichler at proxmox.com
Wed Sep 28 13:53:42 CEST 2016
---
PVE/Storage/ZFSPlugin.pm | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/PVE/Storage/ZFSPlugin.pm b/PVE/Storage/ZFSPlugin.pm
index 6ed3dc9..ca25402 100644
--- a/PVE/Storage/ZFSPlugin.pm
+++ b/PVE/Storage/ZFSPlugin.pm
@@ -260,10 +260,13 @@ sub create_base {
sub clone_image {
my ($class, $scfg, $storeid, $volname, $vmid, $snap) = @_;
- my $name = $class->SUPER::clone_image($scfg, $storeid, $volname, $vmid, $snap);
+ my $name = $class->SUPER::clone_image($scfg, $storeid, $volname, $vmid, $snap);
- my $guid = $class->zfs_create_lu($scfg, $name);
- $class->zfs_add_lun_mapping_entry($scfg, $name, $guid);
+ # get ZFS dataset name from PVE volname
+ my (undef, $clonedname) = $class->parse_volname($name);
+
+ my $guid = $class->zfs_create_lu($scfg, $clonedname);
+ $class->zfs_add_lun_mapping_entry($scfg, $clonedname, $guid);
return $name;
}
--
2.1.4
More information about the pve-devel
mailing list