public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH container] api: template: allow creating template from ct with disk on LVM
@ 2026-03-12 18:27 Lukas Sichert
  0 siblings, 0 replies; only message in thread
From: Lukas Sichert @ 2026-03-12 18:27 UTC (permalink / raw)
  To: pve-devel; +Cc: Lukas Sichert

Currently, in the UI, one can create a template from a VM with a disk on
LVM storage, but not from a container. This is because the LVM plugin
does not have the functionality to create base images from disks
implemented. While the system simply skips this function for VMs, it
throws an error and aborts for LXC containers.

To allow converting to a template, skip the volumes where the required
functionality is not present by exiting early instead of aborting.

Signed-off-by: Lukas Sichert <l.sichert@proxmox.com>
---
 src/PVE/LXC.pm | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index caba952..e77d208 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -1613,17 +1613,7 @@ sub template_create {
 
             my $volid = $mountpoint->{volume};
 
-            die "Template feature is not available for '$volid'\n"
-                if !PVE::Storage::volume_has_feature($storecfg, 'template', $volid);
-        },
-    );
-
-    PVE::LXC::Config->foreach_volume(
-        $conf,
-        sub {
-            my ($ms, $mountpoint) = @_;
-
-            my $volid = $mountpoint->{volume};
+            return if !PVE::Storage::volume_has_feature($storecfg, 'template', $volid);
 
             PVE::Storage::activate_volumes($storecfg, [$volid]);
 
-- 
2.47.3





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-03-12 18:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-12 18:27 [PATCH container] api: template: allow creating template from ct with disk on LVM Lukas Sichert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal