[pve-devel] [PATCH pve-manager 1/2] pvestatd : broadcast sdn transportzone status
Dietmar Maurer
dietmar at proxmox.com
Tue Jun 25 08:37:18 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?
> 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