[pve-devel] applied: [PATCH manager] pveceph: createosd: allow to create bluestore OSDs

Fabian Grünbichler f.gruenbichler at proxmox.com
Tue Jun 27 16:22:02 CEST 2017


Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
 PVE/API2/Ceph.pm | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/PVE/API2/Ceph.pm b/PVE/API2/Ceph.pm
index 4402eb80..7656d5f1 100644
--- a/PVE/API2/Ceph.pm
+++ b/PVE/API2/Ceph.pm
@@ -180,12 +180,18 @@ __PACKAGE__->register_method ({
 		type => 'string',
 	    },
 	    fstype => {
-		description => "File system type.",
+		description => "File system type (filestore only).",
 		type => 'string',
 		enum => ['xfs', 'ext4', 'btrfs'],
 		default => 'xfs',
 		optional => 1,
 	    },
+	    bluestore => {
+		description => "Use bluestore instead of filestore.",
+		type => 'boolean',
+		default => 0,
+		optional => 1,
+	    },
 	},
     },
     returns => { type => 'string' },
@@ -196,6 +202,9 @@ __PACKAGE__->register_method ({
 
 	my $authuser = $rpcenv->get_user();
 
+	raise_param_exc({ 'bluestore' => "conflicts with parameter 'fstype'" })
+	    if (defined($param->{fstype}) && defined($param->{bluestore}) && $param->{bluestore});
+
 	PVE::CephTools::check_ceph_inited();
 
 	PVE::CephTools::setup_pve_symlinks();
@@ -240,13 +249,20 @@ __PACKAGE__->register_method ({
 
 	    my $fstype = $param->{fstype} || 'xfs';
 
-	    print "create OSD on $devpath ($fstype)\n";
 
 	    my $ccname = PVE::CephTools::get_config('ccname');
 
-	    my $cmd = ['ceph-disk', 'prepare', '--zap-disk', '--fs-type', $fstype,
+	    my $cmd = ['ceph-disk', 'prepare', '--zap-disk',
 		       '--cluster', $ccname, '--cluster-uuid', $fsid ];
 
+	    if ($param->{bluestore}) {
+		print "create OSD on $devpath (bluestore)\n";
+		push @$cmd, '--bluestore';
+	    } else {
+		print "create OSD on $devpath ($fstype)\n";
+		push @$cmd, '--fs-type', $fstype;
+	    }
+
 	    if ($journal_dev) {
 		print "using device '$journal_dev' for journal\n";
 		push @$cmd, '--journal-dev', $devpath, $journal_dev;
-- 
2.11.0





More information about the pve-devel mailing list