[pve-devel] [PATCH 8/8] nexenta: volume_resize

Alexandre Derumier aderumier at odiso.com
Mon Aug 6 11:57:33 CEST 2012


resize volume using nexenta api. (online or offline).

we can't use qmp block_resize with libiscsi to online update disk size in guest (throw error), so return undef;

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/Storage/NexentaPlugin.pm |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/PVE/Storage/NexentaPlugin.pm b/PVE/Storage/NexentaPlugin.pm
index 523adac..6ad92d9 100644
--- a/PVE/Storage/NexentaPlugin.pm
+++ b/PVE/Storage/NexentaPlugin.pm
@@ -319,4 +319,12 @@ sub volume_size_info {
     return $size;
 }
 
+sub volume_resize {
+    my ($class, $scfg, $storeid, $volname, $size, $running) = @_;
+
+    my $json = '{"method": "set_child_prop","object" : "zvol","params": ["'.$scfg->{pool}.'/'.$volname.'", "volsize", "'.($size/1024).'KB"]}';
+    die "error resize" if !nexenta_request($scfg, $json);
+    return undef;
+}
+
 1;
-- 
1.7.2.5




More information about the pve-devel mailing list