[pve-devel] [PATCH 1/5] DRBD: Implement "resize".
Philipp Marek
philipp.marek at linbit.com
Thu Oct 8 10:24:45 CEST 2015
Needs a recent DRBDmanage and DRBD 9 version - 9.0.0 has a known bug.
---
PVE/Storage/DRBDPlugin.pm | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/PVE/Storage/DRBDPlugin.pm b/PVE/Storage/DRBDPlugin.pm
index b780829..565fb4c 100644
--- a/PVE/Storage/DRBDPlugin.pm
+++ b/PVE/Storage/DRBDPlugin.pm
@@ -365,17 +365,14 @@ sub deactivate_volume {
sub volume_resize {
my ($class, $scfg, $storeid, $volname, $size, $running) = @_;
- $size = ($size/1024/1024) . "M";
-
- my $path = $class->path($scfg, $volname);
+ $size = int($size/1024);
+ my $hdl = connect_drbdmanage_service();
- # fixme: howto implement this
- die "drbd volume_resize is not implemented";
-
- #my $cmd = ['/sbin/lvextend', '-L', $size, $path];
- #run_command($cmd, errmsg => "error resizing volume '$path'");
+ # FIXME if there's ever more than one volume in a resource
+ my ($rc) = $hdl->resize_volume($volname, 0, 0, $size, 0);
+ check_drbd_res($rc);
- return 1;
+ return undef;
}
sub volume_snapshot {
--
2.6.1
More information about the pve-devel
mailing list