[pve-devel] applied: [PATCH v2 qemu-server 1/2] resize_vm: request new size from storage after resizing

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Feb 7 13:38:38 CET 2020


On 1/13/20 11:47 AM, Fabian Ebner wrote:
> Because of alignment and rounding in the storage backend, the effective
> size might not match the 'newsize' parameter we passed along.
> 
> Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
> ---
> 
> Turns out that this happens in basically every storage backend that has
> 'volume_resize': LVM and RBD round down, ZFS and DIR for '.raw' align
> 
>  PVE/API2/Qemu.pm | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
> index 5bae513..b83ce07 100644
> --- a/PVE/API2/Qemu.pm
> +++ b/PVE/API2/Qemu.pm
> @@ -3607,7 +3607,8 @@ __PACKAGE__->register_method({
>  
>  	    PVE::QemuServer::qemu_block_resize($vmid, "drive-$disk", $storecfg, $volid, $newsize);
>  
> -	    $drive->{size} = $newsize;
> +	    my $effective_size = eval { PVE::Storage::volume_size_info($storecfg, $volid, 3); };
> +	    $drive->{size} = $effective_size // $newsize;
>  	    $conf->{$disk} = PVE::QemuServer::print_drive($drive);
>  
>  	    PVE::QemuConfig->write_config($vmid, $conf);
> 

applied this one, thanks!




More information about the pve-devel mailing list