die "Not allowed to select version '$cephver'\n" if !$param->{'allow-experimental'};
$repolist = "deb http://download.proxmox.com/debian/ceph-luminous buster main\n";
} elsif ($cephver eq 'octopus') {
- die "Not allowed to select version '$cephver'\n" if !$param->{'allow-experimental'};
- $repolist = "deb http://download.proxmox.com/debian/ceph-octopus buster test\n";
- # FIXME: use production component once available
- #$repolist = "deb http://download.proxmox.com/debian/ceph-octopus buster main\n";
+ $repolist = "deb http://download.proxmox.com/debian/ceph-octopus buster main\n";
} else {
die "not implemented ceph version: $cephver";
}
local $ENV{DEBIAN_FRONTEND} = 'noninteractive';
print "update available package list\n";
- eval { run_command(['apt', '-q', 'update'], outfunc => sub {}, errfunc => sub { print STDERR "$_[0]\n" }) };
+ eval { run_command(['apt-get', '-q', 'update'], outfunc => sub {}, errfunc => sub { print STDERR "$_[0]\n" }) };
- my @apt_install = qw(apt --no-install-recommends -o Dpkg::Options::=--force-confnew install --);
+ my @apt_install = qw(apt-get --no-install-recommends -o Dpkg::Options::=--force-confnew install --);
my @ceph_packages = qw(
ceph
ceph-common
return undef;
}});
+__PACKAGE__->register_method ({
+ name => 'status',
+ path => 'status',
+ method => 'GET',
+ description => "Get Ceph Status.",
+ parameters => {
+ additionalProperties => 0,
+ },
+ returns => { type => 'null' },
+ code => sub {
+ PVE::Ceph::Tools::check_ceph_inited();
+
+ run_command(
+ ['ceph', '-s'],
+ outfunc => sub { print "$_[0]\n" },
+ errfunc => sub { print STDERR "$_[0]\n" }
+ );
+ return undef;
+ }});
+
our $cmddef = {
init => [ 'PVE::API2::Ceph', 'init', [], { node => $nodename } ],
pool => {
}, $PVE::RESTHandler::standard_output_options],
create => [ 'PVE::API2::Ceph', 'createpool', ['name'], { node => $nodename }],
destroy => [ 'PVE::API2::Ceph', 'destroypool', ['name'], { node => $nodename } ],
+ set => [ 'PVE::API2::Ceph', 'setpool', ['name'], { node => $nodename } ],
},
lspools => { alias => 'pool ls' },
createpool => { alias => 'pool create' },
stop => [ 'PVE::API2::Ceph', 'stop', [], { node => $nodename }, $upid_exit],
install => [ __PACKAGE__, 'install', [] ],
purge => [ __PACKAGE__, 'purge', [] ],
- status => [ 'PVE::API2::Ceph', 'status', [], { node => $nodename }, sub {
- my $res = shift;
- my $json = JSON->new->allow_nonref;
- print $json->pretty->encode($res) . "\n";
- }],
+ status => [ __PACKAGE__, 'status', []],
};
1;