]> git.proxmox.com Git - pve-storage.git/commitdiff
lvmplugin : volume_resize
authorAlexandre Derumier <aderumier@odiso.com>
Mon, 6 Aug 2012 09:57:28 +0000 (11:57 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 7 Aug 2012 06:09:06 +0000 (08:09 +0200)
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 <aderumier@odiso.com>
PVE/Storage/LVMPlugin.pm

index 8c0b61361a696f2c1d3ef62db6ae033f6ca9ac4b..d49a2b98233fba0e175b5cf3863a1d69cc5f58a5 100644 (file)
@@ -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;