]> git.proxmox.com Git - pve-storage.git/blobdiff - PVE/Storage/RBDPlugin.pm
cifs: check connection: bubble up NT_STATUS_LOGON_FAILURE
[pve-storage.git] / PVE / Storage / RBDPlugin.pm
index 2607d259d1ab20f0f430ee7d0083bcd77289c2ac..e287e286c9a3e1a275f84a5e6bd7ac1bd8988de3 100644 (file)
@@ -289,6 +289,10 @@ sub properties {
            description => "Pool.",
            type => 'string',
        },
+       'data-pool' => {
+           description => "Data Pool (for erasure coding only)",
+           type => 'string',
+       },
        namespace => {
            description => "RBD Namespace.",
            type => 'string',
@@ -318,6 +322,7 @@ sub options {
        disable => { optional => 1 },
        monhost => { optional => 1},
        pool => { optional => 1 },
+       'data-pool' => { optional => 1 },
        namespace => { optional => 1 },
        username => { optional => 1 },
        content => { optional => 1 },
@@ -492,16 +497,13 @@ sub clone_image {
     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;
@@ -516,7 +518,13 @@ sub alloc_image {
 
     $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;