From: Fiona Ebner <f.ebner@proxmox.com>
To: "Hannes Dürr" <h.duerr@proxmox.com>,
"Proxmox VE development discussion" <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH pve-storage] fix #1611: implement import of base-images for LVM-thin Storage
Date: Mon, 13 Nov 2023 14:39:41 +0100 [thread overview]
Message-ID: <76aa4c50-723e-4ba7-86e6-17fe1fde56ad@proxmox.com> (raw)
In-Reply-To: <d86ee66a-1dd1-41c1-bf63-2e9d5c1c6ccb@proxmox.com>
Am 13.11.23 um 14:13 schrieb Hannes Dürr:
>
> On 11/3/23 11:39, Fiona Ebner wrote:
>> 1. check if base
>> 2. check if already exists/rename allowed
>> 3. call parent plugin's volume_import function passing along
>> vm-XYZ-disk-N (or undef if it should be renamed) instead of
>> base-XYZ-disk-N
>> 4. if it was a base image, handle the conversion to base image
>>
>> Then there's no need for new helpers either. But this is just a sketch
>> of course, didn't think through all details. What do you think?
> that sounds good so far, but you can't get around the
> "find_free_diskspace()" call, can you ?
> Not specifying a name leads to an error in the volume_import of the LVM
> plugin,
Oh, I see.
> because without a name no plugin can be parsed and to get a new name in
> the style
> of "vm-XYZ-disk-N" you need "find_free_diskspace()" to make sure that
> the name does not yet exist,
> or am I missing something ?
> > So I'd propose:
>
> 1. check if base
> 2. check if already exists/rename allowed
> 3. call parent plugin's volume_import function passing along
> vm-XYZ-disk-N generated with "find_free_diskspace(), instead of
> base-XYZ-disk-N
Yes. And while not super important, we might want to preserve the N in
the suffix (or custom disk names). This can be done by only calling
find_free_diskname() if an image with the name already exists and the
image can be renamed. Otherwise, we can just pass the name with "base-"
replaced by "vm-" instead of invoking find_free_diskname().
> 4. if it was a base image, handle the conversion to base image
>
prev parent reply other threads:[~2023-11-13 13:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-16 11:59 Hannes Duerr
2023-11-03 10:39 ` Fiona Ebner
2023-11-13 13:13 ` Hannes Dürr
2023-11-13 13:39 ` 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=76aa4c50-723e-4ba7-86e6-17fe1fde56ad@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=h.duerr@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox