pveceph: createosd: allow to create bluestore OSDs

This commit is contained in:
Fabian Grünbichler 2017-06-27 16:12:13 +02:00
parent 207f493293
commit 50239dba68

View File

@ -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;