From e7a42a764e622c9a6db2f1db839ab6f6a14a4310 Mon Sep 17 00:00:00 2001 From: Alexandre Derumier Date: Mon, 6 Aug 2012 11:57:31 +0200 Subject: [PATCH] rbd : volume_resize resize disk with rbd command if vm is offline otherwise we can use qmp block_resize if vm is online Signed-off-by: Alexandre Derumier --- PVE/Storage/RBDPlugin.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm index 76ab9b2..2b36cc9 100644 --- a/PVE/Storage/RBDPlugin.pm +++ b/PVE/Storage/RBDPlugin.pm @@ -266,4 +266,14 @@ sub volume_size_info { return $size; } +sub volume_resize { + my ($class, $scfg, $storeid, $volname, $size, $running) = @_; + + return 1 if $running; + + my $cmd = &$rbd_cmd($scfg, $storeid, 'resize', '--size', ($size/1024/1024), $volname); + run_command($cmd, errmsg => "rbd resize $volname' error", errfunc => sub {}); + return undef; +} + 1; -- 2.39.2