[pve-devel] [PATCH pve-storage 2/3] Allow Ceph volume resize with krbd enabled.

Dmitry Petuhov mityapetuhov at gmail.com
Fri Jan 13 08:11:34 CET 2017


Resize volume and notify qemu about it with zero-size block_resize message.
Non-zero size notification about block device will cause error.

Signed-off-by: Dmitry Petuhov <mityapetuhov at gmail.com>
---
 PVE/Storage/RBDPlugin.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm
index e5973de..dd40e46 100644
--- a/PVE/Storage/RBDPlugin.pm
+++ b/PVE/Storage/RBDPlugin.pm
@@ -604,13 +604,13 @@ sub volume_size_info {
 sub volume_resize {
     my ($class, $scfg, $storeid, $volname, $size, $running) = @_;
 
-    return $size if $running;
+    return $size if $running && !$scfg->{krbd};
 
     my ($vtype, $name, $vmid) = $class->parse_volname($volname);
 
     my $cmd = &$rbd_cmd($scfg, $storeid, 'resize', '--allow-shrink', '--size', ($size/1024/1024), $name);
     run_rbd_command($cmd, errmsg => "rbd resize '$volname' error");
-    return undef;
+    return ( ($scfg->{krbd})?0:undef );
 }
 
 sub volume_snapshot {
-- 
2.1.4



More information about the pve-devel mailing list