From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 2C18E1FF13F for ; Wed, 14 Jan 2026 14:01:09 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id AAF62122BD; Wed, 14 Jan 2026 14:01:06 +0100 (CET) References: <20250609073214.7880-1-denis.kanchev@storpool.com> <20250609073214.7880-5-denis.kanchev@storpool.com> In-Reply-To: Date: Wed, 14 Jan 2026 14:59:47 +0200 To: Proxmox VE development discussion , =?UTF-8?Q?Fabian_Gr=C3=BCnbichler?= MIME-Version: 1.0 Message-ID: List-Id: Proxmox VE development discussion List-Post: From: Denis Kanchev via pve-devel Precedence: list Cc: Denis Kanchev X-Mailman-Version: 2.1.29 X-BeenThere: pve-devel@lists.proxmox.com List-Subscribe: , List-Unsubscribe: , List-Archive: Reply-To: Proxmox VE development discussion List-Help: Subject: Re: [pve-devel] [PATCH atomic snapshot 4/4] plugin: add optional atomic snapshot creation Content-Type: multipart/mixed; boundary="===============7967579514422393168==" Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" --===============7967579514422393168== Content-Type: message/rfc822 Content-Disposition: inline Return-Path: X-Original-To: pve-devel@lists.proxmox.com Delivered-To: pve-devel@lists.proxmox.com Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 62E4BDDA29 for ; Wed, 14 Jan 2026 14:01:04 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 3A54312297 for ; Wed, 14 Jan 2026 14:00:34 +0100 (CET) Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Wed, 14 Jan 2026 14:00:30 +0100 (CET) Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-64b4b35c812so14111679a12.0 for ; Wed, 14 Jan 2026 05:00:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=storpool.com; s=google; t=1768395624; x=1769000424; darn=lists.proxmox.com; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=8NyNIvgTaodORa9VbdfBR60jKq5cLXKbHPQ60kOCSNk=; b=AnqQfeO2Y7d8zflVYB8AXBOcxvbHbxxXPkKjblO5pTCtjq9W/VmzaNI2CwKANWz7PO fHWUnorijE+b9JLuOGcORjeZueYCR2RUkGyFl49eaH+nazm+L4mRKfs3tUazi/d+sE2l hXBnQNmrjLPI0hwgc1WA1SnJtWgLFDx6v5OR3TPHkAZAOQ+VsdHHpEbgxHwlc6jb141G 5oYhTu9ACmqdFOWNAUUz6Bk+FFlFkhqDlP7/InSFE+Sjpb5npQ7L6WiPfP5wG2ZxCuxA gotxBIB2hHpmoMZRDleXKZYK+cjjvfxlsgr/trq2sp1IGDM3TakIcRxDAsGUQ6dubx+B eMcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768395624; x=1769000424; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8NyNIvgTaodORa9VbdfBR60jKq5cLXKbHPQ60kOCSNk=; b=PJerRjxu7wVU2p/J1K3qyPUFjxKPk7ff4LAD6iFVgiv4j0Ul+79iJTftDjwXJNgttP hW+iprkzJCwXg8Ij6AfJJyWDnpBndIHzZtetZOZGKrKET5AmOQEP01+6DNIp/WSbNgYa v/djs5xegEjEcZ7EUU2UPnwIshi9FYhkjI+aa64vVYdrr+xxUaCtlmeCMO8at1s2vYO3 tdOF+dU1+SJbtcyq4bqY4YnMJuSnf5gg2C6D65q9t5icoErYClLZ5jZPGi5wNDTn3ODD k6KjBRhaa49cBkmDVtzxuWBkaOSU23Ji5zCbusXWAcMqrBZ2QAac4JIWyNbLXuoE4JvF dVRw== X-Gm-Message-State: AOJu0Yyle46bMN/2DuzaNh1n4zraPoWy3FZchCkhgDKi4HI7ZVCpwSgE aMWHI5G5VyqtCZeIJPNkDoVIPJP2yh5CFrcQaBX7lA2Q003IiU3Jk+t+wlT/OOZ6DpRLlD+UIiY Y23Nu2A84u5JSqx0Zk1chIcqdHCDsqYtHuEMDzd599HWgnlHtLcKU X-Gm-Gg: AY/fxX5LEC5oodkPrhyl9nBscY2STPiCrOeieW8LvpgCPnV3+dJWLjUhd9VwWVmorDo ARPKk1YnBvVXGux0XbDYqk6cB5K9ZH17Qrs6xbN1SU4VVxjmBf9eFXK2WD+FC7YJIbny1v05Lpp bXhYZ1ffHiBcBemkGe8Nk97vN/X8j1ZuK4nMMLrn+sYtD79gIJELRC6IH5HNwY9VNvacwMATTcB fjA4SluNXC44M09cHzFZckMzwMkWidhdTtTCOlyd1JsEe/zoLvUToHU5Mv/J3N+rS5Mhww= X-Received: by 2002:a05:6402:1e8c:b0:64b:946a:4a3a with SMTP id 4fb4d7f45d1cf-653ec46b48dmr1895800a12.31.1768395623602; Wed, 14 Jan 2026 05:00:23 -0800 (PST) MIME-Version: 1.0 References: <20250609073214.7880-1-denis.kanchev@storpool.com> <20250609073214.7880-5-denis.kanchev@storpool.com> In-Reply-To: From: Denis Kanchev Date: Wed, 14 Jan 2026 14:59:47 +0200 X-Gm-Features: AZwV_QjK-ikKX9xdSxSZROnMqA-Vh0oT1xWuPUn55iyZBKX7XbvwThOImOYYtho Message-ID: Subject: Re: [pve-devel] [PATCH atomic snapshot 4/4] plugin: add optional atomic snapshot creation To: Proxmox VE development discussion , =?UTF-8?Q?Fabian_Gr=C3=BCnbichler?= X-SPAM-LEVEL: Spam detection results: 0 BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy HTML_MESSAGE 0.001 HTML included in message KAM_SHORT 0.001 Use of a URL Shortener for very short URL RCVD_IN_DNSWL_NONE -0.0001 Sender listed at https://www.dnswl.org/, no trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [storpool.com,gnu.org,storage.pm,plugin.pm,proxmox.com] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 up On Mon, Sep 29, 2025 at 2:26=E2=80=AFPM Denis Kanchev via pve-devel < pve-devel@lists.proxmox.com> wrote: > > > > ---------- Forwarded message ---------- > From: Denis Kanchev > To: pve-devel@lists.proxmox.com > Cc: > Bcc: > Date: Mon, 29 Sep 2025 14:24:53 +0300 > Subject: Re: [PATCH atomic snapshot 4/4] plugin: add optional atomic > snapshot creation > ping > > On Mon, Jun 9, 2025 at 10:32=E2=80=AFAM Demayl wrote: > > > This will allow creating atomic snapshots from the custom plugins when > > they support it > > > > Signed-off-by: Demayl > > --- > > src/PVE/Storage.pm | 52 +++++++++++++++++++++++++++++++++++++-- > > src/PVE/Storage/Plugin.pm | 16 ++++++++++++ > > 2 files changed, 66 insertions(+), 2 deletions(-) > > > > diff --git a/src/PVE/Storage.pm b/src/PVE/Storage.pm > > index d0a696a..9b044cc 100755 > > --- a/src/PVE/Storage.pm > > +++ b/src/PVE/Storage.pm > > @@ -42,11 +42,11 @@ use PVE::Storage::BTRFSPlugin; > > use PVE::Storage::ESXiPlugin; > > > > # Storage API version. Increment it on changes in storage API interfac= e. > > -use constant APIVER =3D> 11; > > +use constant APIVER =3D> 12; > > # Age is the number of versions we're backward compatible with. > > # This is like having 'current=3DAPIVER' and age=3D'APIAGE' in libtool= , > > # see > > > https://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.= html > > -use constant APIAGE =3D> 2; > > +use constant APIAGE =3D> 3; > > > > our $KNOWN_EXPORT_FORMATS =3D ['raw+size', 'tar+size', 'qcow2+size', > > 'vmdk+size', 'zfs', 'btrfs']; > > > > @@ -347,6 +347,54 @@ sub volume_rollback_is_possible { > > } > > } > > > > + > > +sub get_volumes_storecfg { > > + my ($cfg, $volume_data) =3D @_; > > + my $vol_cfg =3D {}; > > + for my $volid (keys %{$volume_data}) { > > + my ($storeid, $volname) =3D > > parse_volume_id($volume_data->{$volid}->{file}, 1); > > + if ($storeid) { > > + $vol_cfg->{$volname} =3D { > > + storeid =3D> $storeid, > > + scfg =3D> storage_config($cfg, $storeid), > > + }; > > + } > > + elsif ($volid =3D~ m|^(/.+)$| && -e $volid) { > > + die "snapshot file/device '$volid' is not possible\n"; > > + } else { > > + die "unable to parse volume ID '$volid'\n"; > > + } > > + } > > + return $vol_cfg; > > +} > > + > > +sub volumes_atomic_snapshot_possible { > > + my ($cfg, $disk_data) =3D @_; > > + my $last_type; > > + my $voldata =3D get_volumes_storecfg($cfg, $disk_data); > > + for my $key (keys %$voldata) { > > + my $type =3D $voldata->{ $key }->{scfg}->{type}; > > + if (defined($last_type) && $last_type ne $type) { > > + return (0, 0, $voldata); > > + } > > + $last_type =3D $type; > > + } > > + my $plugin =3D PVE::Storage::Plugin->lookup($last_type); > > + return ( > > + $plugin->volumes_atomic_snapshot_possible($voldata), > > + $plugin->atomic_snapshot_preferred($voldata), > > + $voldata, > > + ) > > +} > > + > > +sub volumes_atomic_snapshot { > > + my ($voldata, $snapname) =3D @_; > > + my $type =3D $voldata->{(keys %{$voldata})[0]}->{scfg}->{type}; > > + my $plugin =3D PVE::Storage::Plugin->lookup($type); > > + > > + $plugin->volumes_atomic_snapshot($voldata, $snapname); > > +} > > + > > sub volume_snapshot { > > my ($cfg, $volid, $snap) =3D @_; > > > > diff --git a/src/PVE/Storage/Plugin.pm b/src/PVE/Storage/Plugin.pm > > index 4e16420..391dd0b 100644 > > --- a/src/PVE/Storage/Plugin.pm > > +++ b/src/PVE/Storage/Plugin.pm > > @@ -1904,4 +1904,20 @@ sub config_aware_base_mkdir { > > } > > } > > > > +sub volumes_atomic_snapshot_possible { > > + my ($class, $voldata) =3D @_; > > + return 0; > > +} > > + > > +sub atomic_snapshot_preferred { > > + my ($class, $volata) =3D @_; > > + return 0; > > +} > > + > > +# Performs an atomic (crash-consistent) snapshot of all volumes at onc= e. > > +sub volumes_atomic_snapshot { > > + my ($class, $voldata, $snap) =3D @_; > > + die "volumes_atomic_snapshot is not implemented for $class"; > > +} > > + > > 1; > > -- > > 2.43.0 > > > > > > -- > -- > *Denis Kanchev* > Senior Software Engineer > StorPool Storage > tel: +3598883395988 > @: denis.kanchev@storpool.com > W: www.storpool.com > > *The best storage solution when building **a Leading **Cloud.* > > > > ---------- Forwarded message ---------- > From: Denis Kanchev via pve-devel > To: pve-devel@lists.proxmox.com > Cc: Denis Kanchev > Bcc: > Date: Mon, 29 Sep 2025 14:24:53 +0300 > Subject: Re: [pve-devel] [PATCH atomic snapshot 4/4] plugin: add optional > atomic snapshot creation > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel > --=20 --=20 *Denis Kanchev* Senior Software Engineer StorPool Storage tel: +3598883395988 @: denis.kanchev@storpool.com W: www.storpool.com *The best storage solution when building **a Leading **Cloud.* --===============7967579514422393168== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel --===============7967579514422393168==--