Feature #36760
mgr/dashboard: show info about mirror daemon instance in image mirror status
0%
Description
Recently the rbd cli has been extended to show info about mirror daemon instance in image mirror status output [1]. It would be nice if the dashboard could display this info too.
History
#1 Updated by Mykola Golub over 5 years ago
Implementation details.
The PR [1] added new librbd API methods (and python bindings) to obtain a mirror daemon instance id (which is actually rados client id the daemon is connecting to the cluster (pool) with) for mirrored images:
instance_id = image.mirror_image_get_instance_id() instance_ids = list(RBD().mirror_image_instance_id_list(ioctx))
The rbd-mirror daemon registers its instance_id in the mgr, so it can be found in `service status`:
% ceph service status { "rbd-mirror": { "4826": { "status_stamp": "2018-11-11 10:00:32.543840", "last_beacon": "2018-11-11 10:00:32.543840", "status": { "json": "{\"3\":{\"name\":\"mirror\",\"callouts\":{},\"image_assigned_count\":1,\"image_error_count\":0,\"image_local_count\":1,\"image_remote_count\":1,\"image_warning_count\":0,\"instance_id\":\"4832\",\"leader\":true},\"4\":{\"name\":\"mirror_parent\",\"callouts\":{},\"image_assigned_count\":0,\"image_error_count\":0,\"image_local_count\":0,\"image_remote_count\":0,\"image_warning_count\":0,\"instance_id\":\"4893\",\"leader\":true}}" } } } }
Note "instance_id" field recorded for every mirrored pool (in this example we have two pools: "mirror" with pool id 3 and mirror instance_id 4832, and "mirror_parent" with pool id 4 and mirror instance_id 4893).
Additional information about the mirror daemon can be found in the `service dump`:
% ceph service dump { "epoch": 4, "modified": "2018-11-08 11:15:33.891950", "services": { "rbd-mirror": { "daemons": { "summary": "", "4826": { "start_epoch": 4, "start_stamp": "2018-11-08 11:15:31.890944", "gid": 4826, "addr": "192.168.1.248:46444/1706166585", "metadata": { "arch": "x86_64", "ceph_release": "nautilus", "ceph_version": "ceph version 14.0.1-559-gf5bb54eccd (f5bb54eccd5bac91b444488340812ac5707b400a) nautilus (dev)", "ceph_version_short": "14.0.1-559-gf5bb54eccd", "cpu": "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", "distro": "opensuse-tumbleweed", "distro_description": "openSUSE Tumbleweed", "distro_version": "20181022", "hostname": "maha", "id": "mirror.0", "instance_id": "4826", "kernel_description": "#1 SMP PREEMPT Thu Oct 18 08:56:17 UTC 2018 (5a53676)", "kernel_version": "4.18.15-1-default", "mem_swap_kb": "44050224", "mem_total_kb": "32499676", "os": "Linux" } } } } } }
Combining all this data together one can obtain information similar to what `rbd` tool displays now:
% rbd mirror image status mirror/test test: global_id: 8ac9fa30-b591-406e-89fd-33804b977842 state: up+replaying description: replaying, master_position=[object_number=3, tag_tid=1, entry_tid=3], mirror_position=[object_number=3, tag_tid=1, entry_tid=3], entries_behind_master=0 service: mirror.0 on maha last_update: 2018-11-11 09:59:04 % rbd mirror image status mirror/test --format json --pretty-format { "name": "test", "global_id": "8ac9fa30-b591-406e-89fd-33804b977842", "state": "up+replaying", "description": "replaying, master_position=[object_number=3, tag_tid=1, entry_tid=3], mirror_position=[object_number=3, tag_tid=1, entry_tid=3], entries_behind_master=0", "daemon_service": { "service_id": "4826", "instance_id": "4832", "daemon_id": "mirror.0", "hostname": "maha" }, "last_update": "2018-11-11 09:59:04" }
Note "service" field in the plain output and "daemon_service" section in the json output.
The dashboard should use mgr's in-memory `service dump` and `service status`.
#2 Updated by Ernesto Puerta almost 3 years ago
- Project changed from mgr to Dashboard
#3 Updated by Ernesto Puerta almost 2 years ago
- Category set to Component - RBD Mirroring