[pve-devel] [PATCH manager v2 1/2] ceph: extend the pool view

Alwin Antreich a.antreich at proxmox.com
Wed Jun 3 15:28:58 CEST 2020


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 at proxmox.com>
---
v1 -> v2: split addition of pg_autoscale_mode and pveceph pool
          output format

 PVE/API2/Ceph.pm          | 13 ++++++++++++-
 www/manager6/ceph/Pool.js | 19 +++++++++++++++----
 2 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/PVE/API2/Ceph.pm b/PVE/API2/Ceph.pm
index afc1bdbd..d872c7c0 100644
--- a/PVE/API2/Ceph.pm
+++ b/PVE/API2/Ceph.pm
@@ -607,6 +607,7 @@ __PACKAGE__->register_method ({
 		pool => { type => 'integer' },
 		pool_name => { type => 'string' },
 		size => { type => 'integer' },
+		pg_autoscale_mode => { type => 'string', optional => 1 },
 	    },
 	},
 	links => [ { rel => 'child', href => "{pool_name}" } ],
@@ -636,9 +637,19 @@ __PACKAGE__->register_method ({
 	}
 
 	my $data = [];
+	my $attr_list = [
+	    'pool',
+	    'pool_name',
+	    'size',
+	    'min_size',
+	    'pg_num',
+	    'crush_rule',
+	    'pg_autoscale_mode',
+	];
+
 	foreach my $e (@{$res->{pools}}) {
 	    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});
 	    }
 
diff --git a/www/manager6/ceph/Pool.js b/www/manager6/ceph/Pool.js
index e81b5974..db1828a6 100644
--- a/www/manager6/ceph/Pool.js
+++ b/www/manager6/ceph/Pool.js
@@ -107,10 +107,21 @@ Ext.define('PVE.node.CephPoolList', {
 	    dataIndex: 'size'
 	},
 	{
-	    text: '# Placement Groups', // pg_num',
-	    width: 180,
-	    align: 'right',
-	    dataIndex: 'pg_num'
+	    text: 'Placement Groups',
+	    columns: [
+		{
+		    text: '# of PGs', // pg_num',
+		    width: 100,
+		    align: 'right',
+		    dataIndex: 'pg_num'
+		},
+		{
+		    text: 'Autoscale Mode',
+		    width: 140,
+		    align: 'right',
+		    dataIndex: 'pg_autoscale_mode'
+		},
+	    ]
 	},
 	{
 	    text: 'CRUSH Rule',
-- 
2.26.2





More information about the pve-devel mailing list