[pve-devel] [PATCH] allow --allow-shrink on RBD resize

Stefan Priebe - Profihost AG s.priebe at profihost.ag
Thu Nov 17 08:11:27 CET 2016


Am 17.11.2016 um 06:44 schrieb Dietmar Maurer:
> This is dangerous and can destroy data. So is there a real reason
> to allow that?

Yes it can. That's the reason i've not exported this to the GUI. But it
is a real use case today. More and more FS supports shrinking.

f.e. Windows ntfs, ext4, btrfs, ...

So there are several cases where you want to shrink a volume. Without a
downtime of the server.

Greets,
Stefan

> 
>> On November 16, 2016 at 8:13 PM Stefan Priebe <s.priebe at profihost.ag> wrote:
>>
>>
>> Signed-off-by: Stefan Priebe <s.priebe at profihost.ag>
>> ---
>>  PVE/Storage/RBDPlugin.pm | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm
>> index 09562fe..eb0c256 100644
>> --- a/PVE/Storage/RBDPlugin.pm
>> +++ b/PVE/Storage/RBDPlugin.pm
>> @@ -602,7 +602,7 @@ sub volume_resize {
>>  
>>      my ($vtype, $name, $vmid) = $class->parse_volname($volname);
>>  
>> -    my $cmd = &$rbd_cmd($scfg, $storeid, 'resize', '--size',
>> ($size/1024/1024), $name);
>> +    my $cmd = &$rbd_cmd($scfg, $storeid, 'resize', '--allow-shrink',
>> '--size', ($size/1024/1024), $name);
>>      run_rbd_command($cmd, errmsg => "rbd resize '$volname' error");
>>      return undef;
>>  }
>> -- 
>> 2.1.4
>>
>> _______________________________________________
>> pve-devel mailing list
>> pve-devel at pve.proxmox.com
>> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 



More information about the pve-devel mailing list