diff --git a/src/pybind/mgr/dashboard/rbd_ls.py b/src/pybind/mgr/dashboard/rbd_ls.py index 87315a91bb4..ba27b3ab3d2 100644 --- a/src/pybind/mgr/dashboard/rbd_ls.py +++ b/src/pybind/mgr/dashboard/rbd_ls.py @@ -10,20 +10,8 @@ class RbdPoolLs(RemoteViewCache): osd_map = self._module.get_sync_object(OsdMap).data - osd_pools = [pool['pool_name'] for pool in osd_map['pools']] - - rbd_pools = [] - for pool in osd_pools: - self.log.debug("Constructing IOCtx " + pool) - try: - ioctx = self._module.rados.open_ioctx(pool) - ioctx.stat("rbd_directory") - rbd_pools.append(pool) - except (rados.PermissionError, rados.ObjectNotFound): - self.log.debug("No RBD directory in " + pool) - except: - self.log.exception("Failed to open pool " + pool) - + rbd_pools = [pool['pool_name'] for pool in osd_map['pools'] if \ + 'rbd' in pool.get('application_metadata', {})] return rbd_pools class RbdLs(RemoteViewCache): diff --git a/src/pybind/mgr/dashboard/rbd_mirroring.html b/src/pybind/mgr/dashboard/rbd_mirroring.html index 2720685474a..c59b9bfbf1c 100644 --- a/src/pybind/mgr/dashboard/rbd_mirroring.html +++ b/src/pybind/mgr/dashboard/rbd_mirroring.html @@ -78,8 +78,8 @@
ID | Instance | +ID | Hostname | Version | Health | @@ -87,8 +87,8 @@
---|---|---|---|---|---|
{daemon.id} | {daemon.instance_id} | +{daemon.id} | {daemon.server_hostname} | {daemon.version | short_version} | {daemon.health} | diff --git a/src/pybind/mgr/dashboard/rbd_mirroring.py b/src/pybind/mgr/dashboard/rbd_mirroring.py index d8a5241d601..e549ed51727 100644 --- a/src/pybind/mgr/dashboard/rbd_mirroring.py +++ b/src/pybind/mgr/dashboard/rbd_mirroring.py @@ -18,19 +18,23 @@ class DaemonsAndPools(RemoteViewCache): 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, @@ -41,7 +45,7 @@ class DaemonsAndPools(RemoteViewCache): 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 = { diff --git a/src/tools/rbd_mirror/ServiceDaemon.cc b/src/tools/rbd_mirror/ServiceDaemon.cc index 2f4873912b9..5b8a87ca136 100644 --- a/src/tools/rbd_mirror/ServiceDaemon.cc +++ b/src/tools/rbd_mirror/ServiceDaemon.cc @@ -71,15 +71,15 @@ template