[pve-devel] [PATCH manager 1/3] add bluestore information to osd api call

Fabian Grünbichler f.gruenbichler at proxmox.com
Fri Aug 4 12:04:36 CEST 2017


On Tue, Aug 01, 2017 at 02:59:35PM +0200, Dominik Csapak wrote:
> this adds information about bluestore (which devices and if
> bluestore/filestore) to show in the gui
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  PVE/API2/Ceph.pm | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/PVE/API2/Ceph.pm b/PVE/API2/Ceph.pm
> index 929604d2..601f852e 100644
> --- a/PVE/API2/Ceph.pm
> +++ b/PVE/API2/Ceph.pm
> @@ -92,6 +92,13 @@ __PACKAGE__->register_method ({
>  
>  	my $usagehash = &$get_osd_usage($rados);
>  
> +	my $osdmetadata_tmp = $rados->mon_command({ prefix => 'osd metadata' });
> +
> +	my $osdmetadata = {};
> +	foreach my $osd (@$osdmetadata_tmp) {
> +	    $osdmetadata->{$osd->{id}} = $osd;
> +	}
> +
>  	my $nodes = {};
>  	my $newnodes = {};
>  	foreach my $e (@{$res->{nodes}}) {
> @@ -121,6 +128,18 @@ __PACKAGE__->register_method ({
>  		}
>  	    }
>  
> +	    my $osdmd = $osdmetadata->{$e->{id}};
> +	    if ($e->{type} eq 'osd' && $osdmd) {
> +		if ($osdmd->{bluefs}) {
> +		    $new->{osdtype} = 'bluestore';
> +		    $new->{blfsdev} = $osdmd->{bluestore_bdev_dev_node};
> +		    $new->{dbdev} = $osdmd->{bluefs_db_dev_node};
> +		    $new->{waldev} = $osdmd->{bluefs_wal_dev_node};

the default of putting all on one device means that waldev is undefined,
but db is not. that looks weird on the GUI IMHO.

> +		} else {
> +		    $new->{osdtype} = 'filestore';
> +		}
> +	    }
> +
>  	    $newnodes->{$e->{id}} = $new;
>  	}
>  
> -- 
> 2.11.0
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel




More information about the pve-devel mailing list