public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: Markus Ebner <info@ebner-markus.de>, pve-devel@lists.proxmox.com
Subject: Re: [pve-devel] [PATCH qemu-server 1/1] fix #5033: api: Add target-filename option to move_disk reassign
Date: Fri, 10 Nov 2023 14:07:37 +0100	[thread overview]
Message-ID: <29a09577-0c39-4191-970b-1910ccdd021a@proxmox.com> (raw)
In-Reply-To: <1877948.CQOukoFCf9@pc.markus.lan>

Am 10.11.23 um 11:54 schrieb Markus Ebner:
>> But I do have another suggestion too: Should we rather automatically
>> preserve the current volume name (just replacing the VM ID) if there is
>> no other volume with that name and choose a new name if there is? For
>> offline storage migration, we also do it like that (sans replacing the
>> VM ID). Then we could get away without needing a new option and users
>> specifying it. Would that be enough to cover your use case?
> 
> Use-Case:
> Our VM disks are tagged with UUIDs so we can reliably match them to the
> hardware configuration in our database and don't delete any disks just
> because they were in the wrong slot. (e.g. because someone manually
> fiddled with the config).
> We also have VM templates prepared with Cloud-Init installations that
> use the default disk naming scheme. Now if we want to reinstall a VM,
> we delete the vm's root disk volume, clone the template and move the clone's
> disk volume to the target VM. At that step, we want to rename from <default
> naming scheme> to <uuid naming scheme> with the correct UUID that's
> already specified for the vm's rootdisk in our database.
> So unfortunately, I don't think that would solve our use-case.
> 

Okay, then it won't work. I thought you might have created the disks
with the custom naming scheme via the storage layer.

>> Exposing the rename functionality as part of the storage API instead
>> might fit better with the status quo?
> 
> Yesterday in: https://bugzilla.proxmox.com/show_bug.cgi?id=5038[1] you
> wrote that the storage layer has no access to the guest layer.
> So if renaming is instead implemented here, renaming an attached disk
> would break the vm similar to how deleting a volume breaks it, right?
> 

Yes, that's true. I was thinking about doing:

1. remove config entry for disk for VM A
2. rename volume on storage layer
3. add config entry for disk for VM B

The issue is that step 1 is currently not possible AFAIK, because
removing the config entry will rather detach the disk (if attached) or
remove the disk in the process. So I think a guest-level approach can be
fine after all.

> Our use-case would then probably have to look something like this:
> - clone cloud-init template
> - unattach rootdisk in clone
> - rename vm<cloneId>-disk-0 to vm-<cloneId>-<targetVM.UUID>
> - request clone's /config/current to search for uuid in unused disks
> - move_disk from clone.unused<N> to targetVM.virtio0
> 
> 
> Yet another suggestion:
> - Do it like you said in move_disk and preserve the appendix; just changing
> the vmid.
> - Add a rename_disk endpoint at the guest level that is aware of the vm config
> and patches it accordingly so nothing breaks.
> 
> What do you think about that?
> 

I'd rather go with your current approach than a new endpoint. Having
said that, another issue is that custom naming is not a first-class
feature currently, e.g. live-migration of a local disk or moving a disk
to a different storage or restoring from a backup will just throw away
the custom name. If we add more explicit support for custom names here,
then it's natural that users expect it to "just work" in all scenarios.

So I feel like it's a question of whether we want to better support
custom names in general.

There also is an open feature request to support comment fields for
disks (and other hardware items):
https://bugzilla.proxmox.com/show_bug.cgi?id=2672 and IMHO that would be
a cleaner solution than encoding custom information in the disk name itself.

Opinions from other devs?

Best Regards,
Fiona




  parent reply	other threads:[~2023-11-10 13:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20231108165239.22145-1-info@ebner-markus.de>
     [not found] ` <20231108165239.22145-2-info@ebner-markus.de>
2023-11-10  9:45   ` Fiona Ebner
     [not found]     ` <1877948.CQOukoFCf9@pc.markus.lan>
2023-11-10 13:07       ` Fiona Ebner [this message]
2023-11-13  9:38         ` Fabian Grünbichler
2023-11-13 10:14           ` Thomas Lamprecht

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=29a09577-0c39-4191-970b-1910ccdd021a@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=info@ebner-markus.de \
    --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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal