all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Filip Schauer <f.schauer@proxmox.com>
Subject: Re: [pve-devel] [PATCH storage v6 1/7] plugin: allow volume import of iso, snippets, vztmpl and import
Date: Fri, 14 Feb 2025 10:50:09 +0100	[thread overview]
Message-ID: <376c4f7e-d266-4706-81f9-738c80583fcb@proxmox.com> (raw)
In-Reply-To: <6daf1a2a-e9ec-4c8d-834a-12d352d7db9a@proxmox.com>



Am 13.02.25 um 18:21 schrieb Fiona Ebner:
> Am 20.01.25 um 12:28 schrieb Filip Schauer:
>> Extend volume import functionality to support 'iso', 'snippets',
>> 'vztmpl', and 'import' types, in addition to the existing support for
>> 'images' and 'rootdir'. This is a prerequisite for the ability to move
>> ISOs, snippets and container templates between nodes.
>>
>> Existing behavior for importing VM disks and container volumes remains
>> unchanged.
>>
>> Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
>> ---
>>  src/PVE/Storage/Plugin.pm | 72 ++++++++++++++++++++++++++-------------
>>  1 file changed, 48 insertions(+), 24 deletions(-)
>>
>> diff --git a/src/PVE/Storage/Plugin.pm b/src/PVE/Storage/Plugin.pm
>> index 65cf43f..b682362 100644
>> --- a/src/PVE/Storage/Plugin.pm
>> +++ b/src/PVE/Storage/Plugin.pm
>> @@ -1738,6 +1738,8 @@ sub volume_export_formats {
>>  	my $format = ($class->parse_volname($volname))[6];
>>  	my $size = file_size_info($file, undef, $format);
>>  
>> +	return ('raw+size') if !defined($format);
> 
> Can we rather make this explicitly check for vtype being one of the ones
> we care about? That reflects more precisely what we want to test for.
> I'm also thinking whether we want to explicitly include the vtype in the
> new export format name to avoid potential type confusion down the line.
> I.e. if a storage wants to export an iso, it should not be importable as
> a snippet on the other side. We can keep the current formats for
> backwards-compat, but the formats for the newly supported vtypes could
> then be $vtype+meta, similar to the backup+size type you add. This would
> be more explicit and less likely to be(come) exploitable. And we could
> write the vtype into the header of the stream itself for extra safety.
> Maybe in a way that allows for some forwards-compatibility, e.g. what if
> ISO files get notes too at some point.
> 
> Just a crude outline what the stream could be from the top of my head:
> number of meta-properties
> for each meta-property: length of property name, property name, length
> of property data, property data
> length of volume, volume data

Or more easily
length of JSON with metadata, JSON with metadata
length of volume, volume data

> 
> For compatibility/extensibility, the stream consumer can then handle all
> meta properties it knows and skip the rest (with some informational
> logging about what was skipped). Or we can add a marker to each property
> whether it is required or optional and mark all important properties
> that should rather lead to failure than skipping. Then outdated nodes
> might not be able to receive certain streams, but we have the
> flexibility to decide for each property.
> 
> I'm sorry, it would expand the scope of the series a bit more, but I do
> think this will save us some headaches and give us more flexibility in
> the future. And it seems to be a natural generalization of what you
> already do for backup+size.
> 
> @other devs: opinions?
> 


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  reply	other threads:[~2025-02-14  9:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-20 11:28 [pve-devel] [PATCH storage v6 0/7] support moving volumes between storages Filip Schauer
2025-01-20 11:28 ` [pve-devel] [PATCH storage v6 1/7] plugin: allow volume import of iso, snippets, vztmpl and import Filip Schauer
2025-02-13 17:21   ` Fiona Ebner
2025-02-14  9:50     ` Fiona Ebner [this message]
2025-01-20 11:28 ` [pve-devel] [PATCH storage v6 2/7] api: content: implement moving a volume between storages Filip Schauer
2025-02-13 17:21   ` Fiona Ebner
2025-01-20 11:28 ` [pve-devel] [PATCH storage v6 3/7] api: content: support moving backups between path based storages Filip Schauer
2025-02-13 17:21   ` Fiona Ebner
2025-01-20 11:28 ` [pve-devel] [PATCH storage v6 4/7] storage: introduce decompress_archive_into_pipe helper Filip Schauer
2025-02-13 17:21   ` Fiona Ebner
2025-01-20 11:28 ` [pve-devel] [PATCH storage v6 5/7] support moving VMA backups to PBS Filip Schauer
2025-02-13 17:20   ` Fiona Ebner
2025-01-20 11:28 ` [pve-devel] [PATCH storage v6 6/7] pvesm: add a move-volume command Filip Schauer
2025-02-13 17:21   ` Fiona Ebner
2025-01-20 11:28 ` [pve-devel] [PATCH storage v6 7/7] storage migrate: avoid ssh when moving a volume locally Filip Schauer
2025-02-13 17:21   ` Fiona Ebner
2025-02-13 17:23 ` [pve-devel] [PATCH storage v6 0/7] support moving volumes between storages Fiona Ebner
2025-03-11 14:25 ` Filip Schauer

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=376c4f7e-d266-4706-81f9-738c80583fcb@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=f.schauer@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.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal