ceph: extend the pool view

to add the pg_autoscale_mode since its activated in Ceph Octopus by
default and emmits a waring (ceph status) if a pool has too many PGs.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
This commit is contained in:
Alwin Antreich 2020-06-03 15:28:58 +02:00 committed by Thomas Lamprecht
parent fdf79b4e66
commit 06bd1c5215
2 changed files with 27 additions and 5 deletions

View File

@ -607,6 +607,7 @@ __PACKAGE__->register_method ({
pool => { type => 'integer' }, pool => { type => 'integer' },
pool_name => { type => 'string' }, pool_name => { type => 'string' },
size => { type => 'integer' }, size => { type => 'integer' },
pg_autoscale_mode => { type => 'string', optional => 1 },
}, },
}, },
links => [ { rel => 'child', href => "{pool_name}" } ], links => [ { rel => 'child', href => "{pool_name}" } ],
@ -636,9 +637,19 @@ __PACKAGE__->register_method ({
} }
my $data = []; my $data = [];
my $attr_list = [
'pool',
'pool_name',
'size',
'min_size',
'pg_num',
'crush_rule',
'pg_autoscale_mode',
];
foreach my $e (@{$res->{pools}}) { foreach my $e (@{$res->{pools}}) {
my $d = {}; my $d = {};
foreach my $attr (qw(pool pool_name size min_size pg_num crush_rule)) { foreach my $attr (@$attr_list) {
$d->{$attr} = $e->{$attr} if defined($e->{$attr}); $d->{$attr} = $e->{$attr} if defined($e->{$attr});
} }

View File

@ -107,11 +107,22 @@ Ext.define('PVE.node.CephPoolList', {
dataIndex: 'size' dataIndex: 'size'
}, },
{ {
text: '# Placement Groups', // pg_num', text: 'Placement Groups',
width: 180, columns: [
{
text: '# of PGs', // pg_num',
width: 100,
align: 'right', align: 'right',
dataIndex: 'pg_num' dataIndex: 'pg_num'
}, },
{
text: 'Autoscale Mode',
width: 140,
align: 'right',
dataIndex: 'pg_autoscale_mode'
},
]
},
{ {
text: 'CRUSH Rule', text: 'CRUSH Rule',
columns: [ columns: [