From 530defb603af4fc0a36292939b20a8050ceba9ad Mon Sep 17 00:00:00 2001 From: Alexandre Derumier Date: Mon, 6 Aug 2012 11:57:28 +0200 Subject: [PATCH] lvmplugin : volume_resize resize the lvm device (online or offline) return 1 to use qmp block_resize to online update size in guest Signed-off-by: Alexandre Derumier --- PVE/Storage/LVMPlugin.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/PVE/Storage/LVMPlugin.pm b/PVE/Storage/LVMPlugin.pm index 8c0b613..d49a2b9 100644 --- a/PVE/Storage/LVMPlugin.pm +++ b/PVE/Storage/LVMPlugin.pm @@ -408,4 +408,16 @@ sub deactivate_volume { run_command($cmd, errmsg => "can't deactivate LV '$path'"); } +sub volume_resize { + my ($class, $scfg, $storeid, $volname, $size, $running) = @_; + + $size = ($size/1024/1024) . "M"; + + my $path = $class->path($scfg, $volname); + my $cmd = ['/sbin/lvextend', '-L', $size, $path]; + run_command($cmd, errmsg => "error resizing volume '$path'"); + + return 1; +} + 1; -- 2.39.2