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

Fabian Grünbichler f.gruenbichler at proxmox.com
Mon Aug 7 15:10:39 CEST 2017


On Fri, Aug 04, 2017 at 04:28:49PM +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>
> ---
> changes from v1:
> none
>  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};
> +		} 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