[pve-devel] [PATCH container] Always determine the size of the volume in volume_rescan
Oguz Bektas
o.bektas at proxmox.com
Mon Dec 9 14:12:45 CET 2019
this fixes the issue
however, after discussing off-list with wolfgang b., it seems like it
might be a better option to disable resizing on pending mps in general
(backend & gui).
for example when you switch an existing mp with a new one, and you try
to resize it, it's not exactly clear which mp the user intends to resize
so it's a good idea to disable the button, but also there needs to be
something for backend to stop it (like when you try to do `pct resize`
f.e.) (also for VMs?)
another note, calling volume_size_info unnecessarily might make things a
bit slower, but i guess this may not be that big of an issue since
apply_pending_mountpoint is only called for the mps in $conf->{pending}
if someone to apply this anyway, you can apply with my tested tag
Tested-by: Oguz Bektas <o.bektas at proxmox.com>
On Tue, Dec 03, 2019 at 09:31:28AM +0100, Fabian Ebner wrote:
> Otherwise there is an issue when resizing a volume with pending changes:
> 1. Have a running container with a mount point
> 2. Edit the mount point and change the path
> 3. Resize the mount point
> 4. Reboot the container
> Result: the old size is written to the config.
>
> Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
> ---
>
> An other solution would be to disable the resize button when there are
> pending changes. This is what we do for VMs.
>
> src/PVE/LXC/Config.pm | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm
> index ffc5911..760ec23 100644
> --- a/src/PVE/LXC/Config.pm
> +++ b/src/PVE/LXC/Config.pm
> @@ -1307,8 +1307,7 @@ sub vmconfig_apply_pending {
> my $rescan_volume = sub {
> my ($storecfg, $mp) = @_;
> eval {
> - $mp->{size} = PVE::Storage::volume_size_info($storecfg, $mp->{volume}, 5)
> - if !defined($mp->{size});
> + $mp->{size} = PVE::Storage::volume_size_info($storecfg, $mp->{volume}, 5);
> };
> warn "Could not rescan volume size - $@\n" if $@;
> };
> --
> 2.20.1
>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
>
More information about the pve-devel
mailing list