Project

General

Profile

Fix #9639

ceph salt module: get fsid from daemon commands

Added by Dan Mick almost 7 years ago. Updated almost 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Backend (services)
Target version:
% Done:

0%

Source:
Development
Tags:
Backport:
Reviewed:
Affected Versions:
ceph-qa-suite:
Crash signature (v1):
Crash signature (v2):

Description

cluster fsid currently comes from 'config get' commands, but the config may not have the information; however, daemons always do:

ceph daemon mon.a mon_status -> ['monmap']['fsid']
ceph daemon osd.0 status -> ['cluster_fsid']
ceph daemon mds.a status -> ['cluster_fsid']

ceph.py should populate it from there.

(sometimes one sees an all-zero fsid in the heartbeat reports; this is probably why.)

Associated revisions

Revision 49c7a106 (diff)
Added by Dan Mick almost 7 years ago

Get fsid for daemons from asok (the true daemon field)

Sometimes fsid would appear to be full of 0s; we were getting it
from the ceph.conf value, which isn't required to be present.
Get it instead from the daemons themselves.

Signed-off-by: Dan Mick <>
Fixes: #9639

History

#1 Updated by Dan Mick almost 7 years ago

  • Status changed from New to In Progress
  • Assignee set to Dan Mick

Hacked around at this a bit. Untested as yet:

--- a/salt/srv/salt/_modules/ceph.py
+++ b/salt/srv/salt/_modules/ceph.py
@@ -512,9 +512,10 @@ def service_status(socket_path):
     Given an admin socket path, learn all we can about that service
     """ 
     cluster_name, service_type, service_id = re.match("^(.+)-(mon|osd|mds)\.(.+)\.asok$", os.path.basename(socket_path)).groups()
+
     # Interrogate the service for its FSID
-    config = json.loads(admin_socket(socket_path, ['config', 'get', 'fsid'], 'json'))
-    fsid = config['fsid']
+    if service_type != 'mon':
+        fsid = json.loads(admin_socket(socket_path, ['status'], 'json')['cluster_fsid']

     status = None
     if service_type == 'mon':
@@ -522,6 +523,7 @@ def service_status(socket_path):
         # of quorum we may not find out from the cluster heartbeats, so
         # need to use the service heartbeats to detect that.
         status = json.loads(admin_socket(socket_path, ['mon_status'], 'json'))
+        fsid = status['monmap']['fsid']

     version_response = admin_socket(socket_path, ['version'], 'json')
     if version_response is not None:

#2 Updated by Dan Mick almost 7 years ago

  • Tracker changed from Bug to Fix
  • Target version set to 1.3-dev6
  • translation missing: en.field_story_points set to 3.0

#3 Updated by Dan Mick almost 7 years ago

  • Status changed from In Progress to Fix Under Review

#4 Updated by yaguang wang almost 7 years ago

It resolves my issue with a minor syntax error in Dan's workaroud:

- fsid = json.loads(admin_socket(socket_path, ['status'], 'json')['cluster_fsid']
+ fsid = json.loads(admin_socket(socket_path, ['status'], 'json'))['cluster_fsid']

Signed-off-by: ywang19 &lt;&gt;

#5 Updated by Christina Meno almost 7 years ago

  • Target version changed from 1.3-dev6 to 1.3-dev7

#6 Updated by Dan Mick almost 7 years ago

  • Status changed from Fix Under Review to Resolved

Also available in: Atom PDF