[pve-devel] [PATCH manager] api: ceph: automatically create manager after the first monitor

Tim Marx t.marx at proxmox.com
Wed Jul 3 14:40:10 CEST 2019


Signed-off-by: Tim Marx <t.marx at proxmox.com>
---
 PVE/API2/Ceph/MON.pm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/PVE/API2/Ceph/MON.pm b/PVE/API2/Ceph/MON.pm
index e8963264..4090612d 100644
--- a/PVE/API2/Ceph/MON.pm
+++ b/PVE/API2/Ceph/MON.pm
@@ -16,6 +16,7 @@ use PVE::RESTHandler;
 use PVE::RPCEnvironment;
 use PVE::Tools qw(run_command file_set_contents);
 use PVE::CephConfig;
+use PVE::API2::Ceph::MGR;
 
 use base qw(PVE::RESTHandler);
 
@@ -282,6 +283,14 @@ __PACKAGE__->register_method ({
 		PVE::Ceph::Services::broadcast_ceph_services();
 	    });
 	    die $@ if $@;
+	    # automatically create manager after the first monitor is created
+	    if (scalar(keys %$monhash) eq 0) {
+
+		PVE::API2::Ceph::MGR->createmgr({
+		    node => $param->{node},
+		    id => $param->{node}
+		})
+	    }
 	};
 
 	return $rpcenv->fork_worker('cephcreatemon', $monsection, $authuser, $worker);
-- 
2.20.1




More information about the pve-devel mailing list