From: Wolfgang Bumiller Date: Mon, 7 May 2018 12:52:47 +0000 (+0200) Subject: copy_volume: get the real volume size X-Git-Url: https://git.proxmox.com/?p=pve-container.git;a=commitdiff_plain;h=5154e3e9efea601c22c8ef93a20fd728d11f1cd2 copy_volume: get the real volume size Since we're not supposed to rely on this property being there or even correct. Signed-off-by: Wolfgang Bumiller --- diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index 423ce21..de3c91f 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -1679,6 +1679,8 @@ sub copy_volume { # (not-mounted) directory. my $new_volid; eval { + # Make sure $mp contains a correct size. + $mp->{size} = PVE::Storage::volume_size_info($storage_cfg, $mp->{volume}); my $needs_chown; ($new_volid, $needs_chown) = alloc_disk($storage_cfg, $vmid, $storage, $mp->{size}/1024, $rootuid, $rootgid); if ($needs_chown) {