description => "Pool.",
type => 'string',
},
+ 'data-pool' => {
+ description => "Data Pool (for erasure coding only)",
+ type => 'string',
+ },
namespace => {
description => "RBD Namespace.",
type => 'string',
disable => { optional => 1 },
monhost => { optional => 1},
pool => { optional => 1 },
+ 'data-pool' => { optional => 1 },
namespace => { optional => 1 },
username => { optional => 1 },
content => { optional => 1 },
my $newvol = "$basename/$name";
$newvol = $name if length($snapname);
- my $cmd = $rbd_cmd->(
- $scfg,
- $storeid,
- 'clone',
+ my @options = (
get_rbd_path($scfg, $basename),
- '--snap',
- $snap,
- get_rbd_path($scfg, $name),
+ '--snap', $snap,
);
+ push @options, ('--data-pool', $scfg->{'data-pool'}) if $scfg->{'data-pool'};
+ my $cmd = $rbd_cmd->($scfg, $storeid, 'clone', @options, get_rbd_path($scfg, $name));
run_rbd_command($cmd, errmsg => "rbd clone '$basename' error");
return $newvol;
$name = $class->find_free_diskname($storeid, $scfg, $vmid) if !$name;
- my $cmd = $rbd_cmd->($scfg, $storeid, 'create', '--image-format' , 2, '--size', int(($size+1023)/1024), $name);
+ my @options = (
+ '--image-format' , 2,
+ '--size', int(($size + 1023) / 1024),
+ );
+ push @options, ('--data-pool', $scfg->{'data-pool'}) if $scfg->{'data-pool'};
+
+ my $cmd = $rbd_cmd->($scfg, $storeid, 'create', @options, $name);
run_rbd_command($cmd, errmsg => "rbd create '$name' error");
return $name;