<table id="daemons" class="table table-condensed">
<thead>
<tr>
- <th>ID</th>
<th>Instance</th>
+ <th>ID</th>
<th>Hostname</th>
<th>Version</th>
<th>Health</th>
</thead>
<tbody>
<tr rv-each-daemon="daemons">
- <td>{daemon.id}</td>
<td>{daemon.instance_id}</td>
+ <td>{daemon.id}</td>
<td>{daemon.server_hostname}</td>
<td>{daemon.version | short_version}</td>
<td><span rv-class="daemon.health_color | mirror_health_color">{daemon.health}</span></td>
for server in self._module.list_servers():
for service in server['services']:
if service['type'] == 'rbd-mirror':
- metadata = self._module.get_metadata('rbd-mirror',
- service['id'])
- status = self._module.get_daemon_status('rbd-mirror',
- service['id'])
+ id = service['id']
+ metadata = self._module.get_metadata('rbd-mirror', id)
+ status = self._module.get_daemon_status('rbd-mirror', id)
try:
status = json.loads(status['json'])
except:
status = {}
+ instance_id = metadata['instance_id']
+ if (id == instance_id):
+ # new version that supports per-cluster leader elections
+ id = metadata['id']
+
# extract per-daemon service data and health
daemon = {
- 'id': service['id'],
- 'instance_id': metadata['instance_id'],
+ 'id': id,
+ 'instance_id': instance_id,
'version': metadata['ceph_version'],
'server_hostname': server['hostname'],
'service': service,
daemon = dict(daemon, **self.get_daemon_health(daemon))
daemons.append(daemon)
- return sorted(daemons, key=lambda k: k['id'])
+ return sorted(daemons, key=lambda k: k['instance_id'])
def get_daemon_health(self, daemon):
health = {