[pve-devel] [RFC container] Handle lined clone check in clone_vm call

Wolfgang Link w.link at proxmox.com
Thu Jun 7 14:34:42 CEST 2018


The check if storage support linked clones should make
in the call 'clone_vm' and not in the template.

The storage feature property 'lxc_clone' will show if storage can
provide linked clones.
---
 src/PVE/API2/LXC.pm | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm
index d85c1a2..d3c2fba 100644
--- a/src/PVE/API2/LXC.pm
+++ b/src/PVE/API2/LXC.pm
@@ -1166,15 +1166,6 @@ __PACKAGE__->register_method({
 	    die "you can't convert a CT to template if the CT is running\n"
 		if PVE::LXC::check_running($vmid);
 
-	    my $scfg = PVE::Storage::config();
-	    PVE::LXC::Config->foreach_mountpoint($conf, sub {
-		my ($ms, $mp) = @_;
-
-		my ($sid) =PVE::Storage::parse_volume_id($mp->{volume}, 0);
-		die "Directory storage '$sid' does not support container templates!\n"
-		    if $scfg->{ids}->{$sid}->{path};
-	    });
-
 	    my $realcmd = sub {
 		PVE::LXC::template_create($vmid, $conf);
 
@@ -1366,7 +1357,7 @@ __PACKAGE__->register_method({
 			    } else {
 				# not full means clone instead of copy
 				die "Linked clone feature for '$volid' is not available\n"
-				    if !PVE::Storage::volume_has_feature($storecfg, 'clone', $volid, $snapname, $running);
+				    if !PVE::Storage::volume_has_feature($storecfg, 'lxc_clone', $volid, $snapname, $running);
 			    }
 
 			    $mountpoints->{$opt} = $mp;
-- 
2.11.0




More information about the pve-devel mailing list