.. automethod:: Orchestrator.describe_service
.. autoclass:: ServiceDescription
-.. autoclass:: ServiceLocation
OSD management
--------------
When viewing a CephFS filesystem in the dashboard, we would use this
to display the pods being currently run for MDS daemons.
+
+ Returns a list of ServiceDescription objects.
"""
raise NotImplementedError()
self.label = None
-class ServiceLocation(object):
+class ServiceDescription(object):
"""
- See ServiceDescription
+ For responding to queries about the status of a particular service,
+ stateful or stateless.
+
+ This is not about health or performance monitoring of services: it's
+ about letting the orchestrator tell Ceph whether and where a
+ service is scheduled in the cluster. When an orchestrator tells
+ Ceph "it's running on node123", that's not a promise that the process
+ is literally up this second, it's a description of where the orchestrator
+ has decided the service should run.
"""
def __init__(self):
# Node is at the same granularity as InventoryNode
self.service_type = None
-class ServiceDescription(object):
- """
- For responding to queries about the status of a particular service,
- stateful or stateless.
-
- This is not about health or performance monitoring of services: it's
- about letting the orchestrator tell Ceph whether and where a
- service is scheduled in the cluster. When an orchestrator tells
- Ceph "it's running on node123", that's not a promise that the process
- is literally up this second, it's a description of where the orchestrator
- has decided the service should run.
- """
-
- def __init__(self):
- self.locations = []
-
-
class DriveGroupSpec(object):
"""
Describe a drive group in the same form that ceph-volume
self._wait([completion])
- service_description = completion.result
- #assert isinstance(service_description, orchestrator.ServiceDescription)
+ service_list = completion.result
- if len(service_description.locations) == 0:
+ if len(service_list) == 0:
return 0, "", "No locations reported"
else:
lines = []
- for l in service_description.locations:
+ for l in service_list:
lines.append("{0}.{1} {2} {3}".format(
svc_type,
l.daemon_name,
pods = self.rook_cluster.describe_pods(service_type, service_id, nodename)
- result = orchestrator.ServiceDescription()
+ result = []
for p in pods:
- sl = orchestrator.ServiceLocation()
- sl.nodename = p['nodename']
- sl.container_id = p['name']
- sl.service_type = p['labels']['app'].replace('rook-ceph-', '')
-
- if sl.service_type == "osd":
- sl.daemon_name = "%s" % p['labels']["ceph-osd-id"]
- elif sl.service_type == "mds":
- sl.daemon_name = p['labels']["rook_file_system"]
- elif sl.service_type == "mon":
- sl.daemon_name = p['labels']["mon"]
- elif sl.service_type == "mgr":
- sl.daemon_name = p['labels']["mgr"]
+ sd = orchestrator.ServiceDescription()
+ sd.nodename = p['nodename']
+ sd.container_id = p['name']
+ sd.service_type = p['labels']['app'].replace('rook-ceph-', '')
+
+ if sd.service_type == "osd":
+ sd.daemon_name = "%s" % p['labels']["ceph-osd-id"]
+ elif sd.service_type == "mds":
+ sd.daemon_name = p['labels']["rook_file_system"]
+ elif sd.service_type == "mon":
+ sd.daemon_name = p['labels']["mon"]
+ elif sd.service_type == "mgr":
+ sd.daemon_name = p['labels']["mgr"]
else:
# Unknown type -- skip it
continue
- result.locations.append(sl)
+ result.append(sd)
return result