[pve-devel] [PATCH manager 2/5] ceph: add application parameter to createpool

Dominik Csapak d.csapak at proxmox.com
Wed Aug 9 11:42:53 CEST 2017


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

Signed-off-by: Dominik Csapak <d.csapak at 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





More information about the pve-devel mailing list