public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Elias Huhsovitz" <e.huhsovitz@proxmox.com>
To: "Jakob Klocker" <j.klocker@proxmox.com>, <pve-devel@lists.proxmox.com>
Subject: Re: [PATCH pve-storage v3 2/2] fix #7598: qemu-img: increase timeout for image resizing in worker context
Date: Thu, 13 Aug 2026 11:06:10 +0200	[thread overview]
Message-ID: <DKNP34CD3AL6.2X6MIVPG9I8BU@proxmox.com> (raw)
In-Reply-To: <20260811073740.100398-3-j.klocker@proxmox.com>

Tested again using 

pvesh set /nodes/{node}/qemu/{vmid}/resize --disk scsi0 --size +{num}G

and the GUI option VM->Disk Action->Resize

Which correctly set the $timeout=3600 in the worker context as intended.

Reviewed-by: Elias Huhsovitz <e.huhsovitz@proxmox.com>
Tested-by: Elias Huhsovitz <e.huhsovitz@proxmox.com>

On Tue Aug 11, 2026 at 9:37 AM CEST, Jakob Klocker wrote:
> Mirror ZFS behaviour and increase timeout to an hour when in a worker
> context. This fixes issues some users [0] have with slow disks where a
> resize would fail.
>
> [0] https://bugzilla.proxmox.com/show_bug.cgi?id=7598
>
> Signed-off-by: Jakob Klocker <j.klocker@proxmox.com>
> ---
>  src/PVE/Storage/Common.pm | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/PVE/Storage/Common.pm b/src/PVE/Storage/Common.pm
> index 3932aee..1c3fdad 100644
> --- a/src/PVE/Storage/Common.pm
> +++ b/src/PVE/Storage/Common.pm
> @@ -3,6 +3,7 @@ package PVE::Storage::Common;
>  use v5.36;
>  
>  use PVE::JSONSchema;
> +use PVE::RPCEnvironment;
>  use PVE::Syscall;
>  use PVE::Tools qw(run_command);
>  
> @@ -262,8 +263,8 @@ sub qemu_img_measure {
>      qemu_img_resize($path, $format, $size, $preallocation, $timeout)
>  
>  Resize a qemu image C<$path> with format C<$format> to a target Kb size C<$size>.
> -Default timeout C<$timeout> is 10s if not specified.
>  C<$preallocation> allows to specify the preallocation option for the resize operation.
> +If no C<$timeout> is provided, it defaults to 10 seconds, or 1 hour when running in a worker context.
>  
>  =cut
>  
> @@ -276,7 +277,8 @@ sub qemu_img_resize {
>      push $cmd->@*, "--preallocation=$preallocation" if $preallocation;
>      push $cmd->@*, '-f', $format, $path, $size;
>  
> -    $timeout = 10 if !$timeout;
> +    $timeout = PVE::RPCEnvironment->is_worker() ? 60 * 60 : 10
> +        if !$timeout;
>      run_command($cmd, timeout => $timeout);
>  }
>  





      reply	other threads:[~2026-08-13  9:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-11  7:37 [PATCH storage v3 0/2] fix #7598: qemu-img: increase timeout for image resize Jakob Klocker
2026-08-11  7:37 ` [PATCH pve-storage v3 1/2] qemu-img: drop redundant timeout argument at resize call Jakob Klocker
2026-08-13  9:04   ` Elias Huhsovitz
2026-08-11  7:37 ` [PATCH pve-storage v3 2/2] fix #7598: qemu-img: increase timeout for image resizing in worker context Jakob Klocker
2026-08-13  9:06   ` Elias Huhsovitz [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=DKNP34CD3AL6.2X6MIVPG9I8BU@proxmox.com \
    --to=e.huhsovitz@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