From: Fiona Ebner <f.ebner@proxmox.com>
To: Lukas Sichert <l.sichert@proxmox.com>, pve-devel@lists.proxmox.com
Subject: Re: [PATCH container] api: template: allow creating template from ct with disk on LVM
Date: Mon, 24 Aug 2026 17:33:35 +0200 [thread overview]
Message-ID: <328e1266-003a-42fd-bfea-2801b5afb88d@proxmox.com> (raw)
In-Reply-To: <20260312182714.108583-1-l.sichert@proxmox.com>
Am 12.03.26 um 7:26 PM schrieb 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.
>
I feel like we should properly implement the feature the LVM plugin
instead and maybe start requiring the feature for VMs with the next
major version too, but not super important. The implementation for the
LVM plugin can be similar to what is done for LVM-thin, i.e. rename and
set readonly and activationskip flags.
> 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]);
>
prev parent reply other threads:[~2026-08-24 15:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-12 18:27 [PATCH container] api: template: allow creating template from ct with disk on LVM Lukas Sichert
2026-08-24 15:33 ` Fiona Ebner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=328e1266-003a-42fd-bfea-2801b5afb88d@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=l.sichert@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.