rbd : volume_resize

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>
This commit is contained in:
Alexandre Derumier
2012-08-06 11:57:31 +02:00
committed by Dietmar Maurer
parent 3bac137c9f
commit e7a42a764e

View 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;