lambda: self.rook_cluster.rm_service(service_type, service_id), None,
"Removing {0} services for {1}".format(service_type, service_id))
+ def update_mons(self, num, hosts):
+ if hosts:
+ raise RuntimeError("Host list is not supported by rook.")
+
+ return RookWriteCompletion(
+ lambda: self.rook_cluster.update_mon_count(num), None,
+ "Updating mon count to {0}".format(num))
+
def create_osds(self, drive_group, all_hosts):
# type: (orchestrator.DriveGroupSpec, List[str]) -> RookWriteCompletion
else:
return True
+ def update_mon_count(self, newcount):
+ patch = [{"op": "replace", "path": "/spec/mon/count", "value": newcount}]
+
+ try:
+ self.rook_api_patch(
+ "cephclusters/{0}".format(self.cluster_name),
+ body=patch)
+ except ApiException as e:
+ log.exception("API exception: {0}".format(e))
+ raise ApplyException(
+ "Failed to update mon count in Cluster CRD: {0}".format(e))
+
+ return "Updated mon count to {0}".format(newcount)
+
def add_osds(self, drive_group, all_hosts):
# type: (orchestrator.DriveGroupSpec, List[str]) -> None
"""