[pve-devel] [PATCH pve-manager 1/2] pvestatd : broadcast sdn transportzone status

Alexandre DERUMIER aderumier at odiso.com
Tue Jun 25 19:02:42 CEST 2019


>>I am not sure if json is a good idea here. We use colon separated lists for 
>>everything else, so I would prefer that. It is easier to parse inside C, which 
>>is important when you want to generate RRD databases from inside pmxcfs ... 


>>Also, consider that it is quite hard to change that format later, because all cluster nodes 
>>reads/write that data. 

>>So do we want to generate some RRD databases with that data? 

I don't think we need a rrd here, it's a simple status (ok/error/pending/...) on the transportzone.

I don't want to stream vnet status, because it could be really huge.
(like 20 servers broadcasting 300vnets for example).

I the gui, I would like to display transportzone like a storage in the left tree.
Then for detail, click on the transportzone (like the volumes display on the storage on right pane),
then query vnets status on the specific node at this time only.


But I can use implement colon lists, no problem.


----- Mail original -----
De: "dietmar" <dietmar at proxmox.com>
À: "pve-devel" <pve-devel at pve.proxmox.com>, "aderumier" <aderumier at odiso.com>
Envoyé: Mardi 25 Juin 2019 08:37:18
Objet: Re: [pve-devel] [PATCH pve-manager 1/2] pvestatd : broadcast sdn transportzone status

I am not sure if json is a good idea here. We use colon separated lists for 
everything else, so I would prefer that. It is easier to parse inside C, which 
is important when you want to generate RRD databases from inside pmxcfs ... 

Also, consider that it is quite hard to change that format later, because all cluster nodes 
reads/write that data. 

So do we want to generate some RRD databases with that data? 

> On 25 June 2019 00:04 Alexandre Derumier <aderumier at odiso.com> wrote: 
> 
> 
> Signed-off-by: Alexandre Derumier <aderumier at odiso.com> 
> --- 
> PVE/Service/pvestatd.pm | 22 ++++++++++++++++++++++ 
> 1 file changed, 22 insertions(+) 
> 
> diff --git a/PVE/Service/pvestatd.pm b/PVE/Service/pvestatd.pm 
> index e138b2e8..bad1b73d 100755 
> --- a/PVE/Service/pvestatd.pm 
> +++ b/PVE/Service/pvestatd.pm 
> @@ -37,6 +37,12 @@ PVE::Status::Plugin->init(); 
> 
> use base qw(PVE::Daemon); 
> 
> +my $have_sdn; 
> +eval { 
> + require PVE::API2::Network::SDN; 
> + $have_sdn = 1; 
> +}; 
> + 
> my $opt_debug; 
> my $restart_request; 
> 
> @@ -457,6 +463,16 @@ sub update_ceph_version { 
> } 
> } 
> 
> +sub update_sdn_status { 
> + 
> + if($have_sdn) { 
> + my ($transport_status, $vnet_status) = PVE::Network::SDN::status(); 
> + 
> + my $status = $transport_status ? encode_json($transport_status) : undef; 
> + PVE::Cluster::broadcast_node_kv("sdn", $status); 
> + } 
> +} 
> + 
> sub update_status { 
> 
> # update worker list. This is not really required and 
> @@ -524,6 +540,12 @@ sub update_status { 
> $err = $@; 
> syslog('err', "error getting ceph services: $err") if $err; 
> 
> + eval { 
> + update_sdn_status(); 
> + }; 
> + $err = $@; 
> + syslog('err', "sdn status update error: $err") if $err; 
> + 
> } 
> 
> my $next_update = 0; 
> -- 
> 2.20.1 
> 
> _______________________________________________ 
> 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