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

index 76ab9b2f3f981f38c9a0e8cdfbdf7b6da785ac76..2b36cc9d736a4f021e5f7583e964f893d4fb7405 100644 (file)
@@ -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;