public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Michael Köppl" <m.koeppl@proxmox.com>
To: "Jakob Klocker" <j.klocker@proxmox.com>, <pve-devel@lists.proxmox.com>
Subject: Re: [PATCH qemu-server 2/2] api: refuse moving disks if source VM is protected
Date: Thu, 22 Oct 2026 15:15:19 +0200	[thread overview]
Message-ID: <DMBE80NQ9NYP.2I6I01VX6MBRU@proxmox.com> (raw)
In-Reply-To: <20260921153545.406664-3-j.klocker@proxmox.com>

nit: the commit subject reads too broad. This commit only affects moving
disks to another VM. Moving disks to another storage is still possible
even with the --delete flag which removes the old disk. Mostly noticed
this because I initially thought this patch also covers the case where a
disk is moved to another storage.

I'm not entirely sure how to best handle this, though. On the one hand,
moving to another storage with --delete doesn't really remove anything
from the VM in that since, since it attaches the new disk on the new
storage in its place. On the other hand, the behavior then differs
between CTs and VMs. I think the basis for this in the docs saying that
the protection option on CTs prevents "disk remove/update operation"
(which moving a volume to another storage is), whereas the VM docs only
say "This will disable the remove VM and remove disk operations". Still,
wanted to bring it up to clarify the scope of this. Maybe @Fiona can
share her thoughts on this. I suppose if the behavior here should match
the CT behavior, the docs would of course also have to be updated.

On Mon Sep 21, 2026 at 5:35 PM CEST, Jakob Klocker wrote:
> Moving a disk removes it from the source VM, which, according to the
> documentation, the protection flag prevents.
> Refuse the move when the source is protected.
>
> Signed-off-by: Jakob Klocker <j.klocker@proxmox.com>
> ---
>  src/PVE/API2/Qemu.pm | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/src/PVE/API2/Qemu.pm b/src/PVE/API2/Qemu.pm
> index 922c6599..3cf3517b 100644
> --- a/src/PVE/API2/Qemu.pm
> +++ b/src/PVE/API2/Qemu.pm
> @@ -5024,6 +5024,11 @@ __PACKAGE__->register_method({
>              my $target_conf = PVE::QemuConfig->load_config($target_vmid);
>              PVE::QemuConfig->check_lock($target_conf);
>
> +            PVE::QemuConfig->check_protection(
> +                $source_conf,
> +                "Can't move disks from protected VMs\n",
> +            );
> +
>              die "Can't move disks from or to template VMs\n"
>                  if ($source_conf->{template} || $target_conf->{template});
>






  reply	other threads:[~2026-10-22 13:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-21 15:35 [PATCH container/qemu-server 0/2] qemu: lxc: refuse moving disks/volumes of protected VMs/CTs Jakob Klocker
2026-09-21 15:35 ` [PATCH pve-container 1/2] api: refuse moving volumes if container is protected Jakob Klocker
2026-10-22 13:15   ` Michael Köppl
2026-09-21 15:35 ` [PATCH qemu-server 2/2] api: refuse moving disks if source VM " Jakob Klocker
2026-10-22 13:15   ` Michael Köppl [this message]
2026-10-22 13:15 ` [PATCH container/qemu-server 0/2] qemu: lxc: refuse moving disks/volumes of protected VMs/CTs Michael Köppl

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=DMBE80NQ9NYP.2I6I01VX6MBRU@proxmox.com \
    --to=m.koeppl@proxmox.com \
    --cc=j.klocker@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal