all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: Elias Huhsovitz <e.huhsovitz@proxmox.com>, pve-devel@lists.proxmox.com
Subject: Re: [PATCH qemu-server 2/4] fix #8209: clone disk: do not ignore failure to query size of target
Date: Wed, 28 Oct 2026 10:05:18 +0100	[thread overview]
Message-ID: <4dc611ef-b185-4ebe-bb54-b74b0761014c@proxmox.com> (raw)
In-Reply-To: <DMBEG3BT3V18.3VR58KNG4P5FP@proxmox.com>

Am 22.10.26 um 3:25 PM schrieb Elias Huhsovitz:
> On Thu Oct 22, 2026 at 11:38 AM CEST, Fiona Ebner wrote:
>> @@ -4997,9 +4998,15 @@ __PACKAGE__->register_method({
>>                      $conf->{agent},
>>                      $movelimit,
>>                  );
>> +                my $newdrive = $clone_result->{drive};
>>                  $conf->{$disk} = PVE::QemuServer::print_drive($newdrive);
>>  
>> -                if (!$param->{delete}) {
>> +                if ($do_delete && $clone_result->{'after-copy-error'}) {
>> +                    warn "skipping delete of source because of error after copy\n";
>> +                    $do_delete = 0;
> 
> Since we now set $clone_result->{'after-copy-error'}, if e.g., the
> target NFS share returns an error, we set $do_delete = 0 to prevent the
> source disk from being deleted.
> 
>> +                }
>> +
>> +                if (!$do_delete) {
>>                      my $unused_key = PVE::QemuConfig->add_unused_volume($conf, $old_volid);
> 
> So now in the case that $clone_result->{'after-copy-error'} is set, we
> always call add_unused_volume(). But add_unused_volume() can fail with
> 
> "Too many unused volumes - please delete them first.\n"
> 
> according to AbstractConfig::add_unused_volume()
> 
> Couldn't this kill the disk during a live migration, if we are unable to
> add the unused volume?
> 
> In Drive.pm the maximum number for unused disks is set to:
> 
> our $MAX_UNUSED_DISKS = 256;
> 
> IMO being unable to add a new disk in a production system, might be a
> real possibility.

It's not a new issue (my patch only changes that 'delete' is not used in
a rare error scenario, delete=0 was already possible before). I'm not
aware of any reports about people running into this. It should be quite
rare to reach that limit in practice. Still, it's an issue and I'll add
a patch to fix it in v2.

And the issue is also present in case the template_create() call fails,
I'll guard that too.

> 
>>                      print("adding source volume '$old_volid' as '$unused_key' to config\n");
>>                  }
>> @@ -5030,7 +5037,7 @@ __PACKAGE__->register_method({
>>                  die "storage migration failed: $err";
>>              }
>>  
>> -            if ($param->{delete}) {
>> +            if ($do_delete) {
>>                  print("removing source volume '$old_volid' after successful copy\n");
>>                  eval {
>>                      PVE::Storage::deactivate_volumes($storecfg, [$old_volid]);




  reply	other threads:[~2026-10-28  9:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-22  9:38 [PATCH-SERIES qemu-server 0/4] fix #8209: clone disk: do not ignore failure to query size of target Fiona Ebner
2026-10-22  9:38 ` [PATCH qemu-server 1/4] block job: monitor: document that job-complete is not used if source differs from target Fiona Ebner
2026-10-23  8:44   ` Elias Huhsovitz
2026-10-28  8:56     ` Fiona Ebner
2026-10-22  9:38 ` [PATCH qemu-server 2/4] fix #8209: clone disk: do not ignore failure to query size of target Fiona Ebner
2026-10-22 13:25   ` Elias Huhsovitz
2026-10-28  9:05     ` Fiona Ebner [this message]
2026-10-28  9:08       ` Fiona Ebner
2026-10-22  9:38 ` [PATCH qemu-server 3/4] clone disk: abort early when failing to query size of source disk Fiona Ebner
2026-10-23  8:53   ` Elias Huhsovitz
2026-10-22  9:38 ` [PATCH qemu-server 4/4] clone disk: bump timeout for querying target volume size to 1 minute Fiona Ebner
2026-10-23  9:31   ` Elias Huhsovitz
2026-10-28  9:39     ` Fiona Ebner

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=4dc611ef-b185-4ebe-bb54-b74b0761014c@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=e.huhsovitz@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