so that we have a list of all existing ceph services in the cluster

Signed-off-by: Dominik Csapak <d.csa...@proxmox.com>
---
 PVE/Service/pvestatd.pm | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/PVE/Service/pvestatd.pm b/PVE/Service/pvestatd.pm
index ce2adbbd..b8abc8f2 100755
--- a/PVE/Service/pvestatd.pm
+++ b/PVE/Service/pvestatd.pm
@@ -22,6 +22,7 @@ use PVE::RPCEnvironment;
 use PVE::API2::Subscription;
 use PVE::AutoBalloon;
 use PVE::AccessControl;
+use PVE::Ceph::Services;
 
 use PVE::Status::Plugin;
 use PVE::Status::Graphite;
@@ -445,6 +446,13 @@ sub rotate_authkeys {
     PVE::AccessControl::rotate_authkey() if 
!PVE::AccessControl::check_authkey(1);
 }
 
+sub update_ceph_services {
+    my $services = PVE::Ceph::Services::get_local_services();
+    for my $type (keys %$services) {
+       PVE::Cluster::broadcast_data("ceph-$type", $services->{$type});
+    }
+}
+
 sub update_status {
 
     # update worker list. This is not really required and
@@ -503,6 +511,12 @@ sub update_status {
     $err = $@;
     syslog('err', "authkey rotation error: $err") if $err;
 
+    eval {
+       update_ceph_services();
+    };
+    $err = $@;
+    syslog('err', "error getting ceph services: $err") if $err;
+
 }
 
 my $next_update = 0;
-- 
2.11.0


_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to