]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/mirroring: Display remote fsid and mon_host in daemon status
authorKotresh HR <khiremat@redhat.com>
Tue, 17 Feb 2026 18:43:21 +0000 (00:13 +0530)
committerKotresh HR <khiremat@redhat.com>
Wed, 25 Feb 2026 02:43:42 +0000 (08:13 +0530)
The cephfs_mirror daemon returns the basic remote info.
Fetch the remote fsid and mon_host from the monitor
config map and append it.

Sample output:
[
  {
    "daemon_id": 4153,
    "filesystems": [
      {
        "filesystem_id": 1,
        "name": "a",
        "directory_count": 0,
        "peers": [
          {
            "uuid": "29304477-1fd7-4709-b9f7-8153acebbafd",
            "remote": {
              "client_name": "client.mirror_remote",
              "cluster_name": "remote-site",
              "fs_name": "a",
              "mon_host": "[v2:192.168.64.5:40183,v1:192.168.64.5:40184]",
              "fsid": "5682c8e5-50cd-4cfd-b75c-5354dcdda487"
            },
            "stats": {
              "failure_count": 0,
              "recovery_count": 0
            }
          }
        ]
      }
    ]
  }
]

Fixes: https://tracker.ceph.com/issues/73455
Signed-off-by: Kotresh HR <khiremat@redhat.com>
src/pybind/mgr/mirroring/fs/snapshot_mirror.py

index c348ce82de1f46f3c6dcd8205e11cc3daaac50c0..d34e10295f4ea904c9e3e3f93702ac65f2447ed8 100644 (file)
@@ -790,9 +790,23 @@ class FSSnapshotMirror:
                                 'peers'           : []
                             } # type: Dict[str, Any]
                             for peer_uuid, peer_desc in fs_desc['peers'].items():
+                                # Get basic peer info from daemon status (FSMap data)
+                                remote = peer_desc['remote'].copy()  # Don't modify original
+
+                                # Fetch mon_host and fsid from config database
+                                config_key = FSSnapshotMirror.peer_config_key(fs_desc['name'], peer_uuid)
+                                try:
+                                    remote_config = self.config_get(config_key)
+                                    if remote_config:
+                                        if 'mon_host' in remote_config:
+                                            remote['mon_host'] = remote_config['mon_host']
+                                        if 'fsid' in remote_config:
+                                            remote['fsid'] = remote_config['fsid']
+                                except Exception as e:
+                                    log.warning(f'failed to fetch config for fs={fs_desc["name"]}, peer={peer_uuid}: {e}')
                                 peer = {
                                     'uuid'   : peer_uuid,
-                                    'remote' : peer_desc['remote'],
+                                    'remote' : remote,
                                     'stats'  : peer_desc['stats']
                                 }
                                 fs['peers'].append(peer)