and use 'rbd' by default, since we cannot create a cephfs or
rgw from the gui currently

Signed-off-by: Dominik Csapak <d.csa...@proxmox.com>
---
 PVE/API2/Ceph.pm | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/PVE/API2/Ceph.pm b/PVE/API2/Ceph.pm
index 7cf07b70..c4d6ffcb 100644
--- a/PVE/API2/Ceph.pm
+++ b/PVE/API2/Ceph.pm
@@ -1532,6 +1532,12 @@ __PACKAGE__->register_method ({
                type => 'string',
                optional => 1,
            },
+           application => {
+               description => "The application of the pool, 'rbd' by default.",
+               type => 'string',
+               enum => ['rbd', 'cephfs', 'rgw'],
+               optional => 1,
+           }
        },
     },
     returns => { type => 'null' },
@@ -1549,6 +1555,7 @@ __PACKAGE__->register_method ({
        my $size = $param->{size} || 3;
        my $min_size = $param->{min_size} || 2;
        my $rados = PVE::RADOS->new();
+       my $application = $param->{application} // 'rbd';
 
        $rados->mon_command({
            prefix => "osd pool create",
@@ -1583,6 +1590,12 @@ __PACKAGE__->register_method ({
            });
        }
 
+       $rados->mon_command({
+               prefix => "osd pool application enable",
+               pool => $param->{name},
+               app => $application,
+       });
+
        return undef;
     }});
 
-- 
2.11.0


_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to