Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[doctor][stack] check ceph.config #208

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion eayunstack_tools/doctor/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@
'/etc/mongodb.conf'
]

controller_ceph_p = [
'/etc/ceph/ceph.conf'
]

ceph_osd_ceph_p = [
'/etc/ceph/ceph.conf'
]

# 'XXX_s' for XXX's services list

keystone_s = [
Expand Down Expand Up @@ -77,6 +85,12 @@
'mongod'
]

controller_ceph_s = [
]

ceph_osd_ceph_s = [
]

# component db profile list

component_db_p = {
Expand Down Expand Up @@ -107,7 +121,8 @@
'nova',
'neutron',
'cinder',
'ceilometer'
'ceilometer',
'ceph'
]

compute_c = [
Expand All @@ -118,6 +133,10 @@
'mongo'
]

ceph_osd_c = [
'ceph'
]

# return profile list

def get_keystone_profiles():
Expand All @@ -141,6 +160,12 @@ def get_ceilometer_profiles():
def get_mongo_profiles():
return mongo_p

def get_controller_ceph_profiles():
return controller_ceph_p

def get_ceph_osd_ceph_profiles():
return ceph_osd_ceph_p

# return services list

def get_keystone_services():
Expand All @@ -167,6 +192,12 @@ def get_ceilometer_services():
def get_mongo_services():
return mongo_s

def get_controller_ceph_services():
return controller_ceph_s

def get_ceph_osd_ceph_services():
return ceph_osd_ceph_s

# return db profile

def get_db_profile():
Expand All @@ -183,6 +214,9 @@ def get_compute_component():
def get_mongo_component():
return mongo_c

def get_ceph_osd_component():
return ceph_osd_c

# return a list of commands for check component availability

def get_component_check_cmd():
Expand Down
39 changes: 32 additions & 7 deletions eayunstack_tools/doctor/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,38 @@ def stack(parser):
if not NODE_ROLE.is_mongo():
cmd_warn('mongo')
return
if parser.CONTROLLER or parser.COMPUTE or parser.MONGO:
if parser.CEPHOSD:
if not NODE_ROLE.is_ceph_osd():
cmd_warn('ceph-osd')
return
if parser.CONTROLLER or parser.COMPUTE or parser.MONGO or parser.CEPHOSD:
if parser.PROFILE and not parser.SERVICE and not parser.CHECK_ALL:
if parser.CONTROLLER:
check('controller', 'profile')
if parser.COMPUTE:
check('compute', 'profile')
if parser.MONGO:
check('mongo', 'profile')
if parser.CEPHOSD:
check('ceph_osd', 'profile')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ceph-osd

if parser.SERVICE and not parser.PROFILE and not parser.CHECK_ALL:
if parser.CONTROLLER:
check('controller', 'service')
if parser.COMPUTE:
check('compute', 'service')
if parser.MONGO:
check('mongo', 'service')
if parser.CEPHOSD:
check('ceph_osd', 'service')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ceph-osd

if parser.SERVICE and parser.PROFILE or parser.CHECK_ALL or not parser.PROFILE and not parser.SERVICE:
if parser.CONTROLLER:
check('controller', 'all')
if parser.COMPUTE:
check('compute', 'all')
if parser.MONGO:
check('mongo', 'all')
if parser.CEPHOSD:
check('ceph_osd', 'all')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ceph-osd

return
# check all
if parser.CHECK_ALL and parser.PROFILE and parser.SERVICE:
Expand Down Expand Up @@ -109,13 +119,20 @@ def make(parser):
default=False,
help='Check All Mongo Node',
)
parser.add_argument(
'--ceph-osd',
dest='CEPHOSD',
action='store_true',
default=False,
help='Check All Ceph-OSD Node',
)
common.add_common_opt(parser)
parser.set_defaults(func=stack)

# check all component

# IMPORTANT: node include fuel
all_roles = ('controller','compute','mongo')
all_roles = ('controller','compute','mongo','ceph_osd')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ceph-osd


def check(role, obj):
if NODE_ROLE.is_fuel():
Expand Down Expand Up @@ -146,18 +163,15 @@ def check_all_profile():
check_nodes(role, 'profile', multi_role=True)
else:
for node_role in node_roles:
# print node_role
if node_role != 'ceph_osd':
eval('check_%s_profile' % node_role)()
eval('check_%s_profile' % node_role)()

def check_all_service():
if NODE_ROLE.is_fuel():
for role in all_roles:
check_nodes(role, 'service', multi_role=True)
else:
for node_role in node_roles:
if node_role != 'ceph_osd':
eval('check_%s_service' % node_role)()
eval('check_%s_service' % node_role)()

# check controller profile & service
@userful_msg()
Expand Down Expand Up @@ -193,5 +207,16 @@ def check_mongo_profile():
def check_mongo_service():
check_node_services('mongo')

# check ceph-osd node profile & service
@userful_msg()
@register
def check_ceph_osd_profile():
check_node_profiles('ceph_osd')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ceph-osd


@userful_msg()
@register
def check_ceph_osd_service():
check_node_services('ceph_osd')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ceph-osd


def cmd_warn(node_role):
LOG.warn('This command can only run on fuel or %s node !' % node_role)
9 changes: 6 additions & 3 deletions eayunstack_tools/doctor/stack_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,10 @@ def check_node_profiles(role):
component_list = eval('get_%s_component' % role)()
for c in component_list:
LOG.info('Checking "%s" Component' % c.capitalize())
profile_list = eval('get_%s_profiles' % c)()
if c == 'ceph':
profile_list = eval('get_%s_%s_profiles' % (role, c))()
else:
profile_list = eval('get_%s_profiles' % c)()
for p in profile_list:
LOG.debug('Profile: ' + p)
check_profile(p, role)
Expand All @@ -273,14 +276,14 @@ def check_node_services(node):
for c in component_list:
LOG.info('Checking "%s" Component' % c.capitalize())
LOG.debug('-Service Status')
if c == 'nova':
if c == 'nova' or c == 'ceph':
service_list = eval('get_%s_%s_services' % (node, c))()
else:
service_list = eval('get_%s_services' % c)()
for s in service_list:
# utils.check_service(s)
check_service(s)
if node != 'controller':
if node != 'controller' or c == 'ceph':
continue
LOG.debug('-DB Connectivity')
check_db_connect(c)
Expand Down
12 changes: 0 additions & 12 deletions template/ceph_osd/ceph.conf.template
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
[global]
## filter options
fsid =
cluster_network =
mon_host =
public_network =
mon_initial_members =
##
log_to_syslog_level = info
log_to_syslog = False
log_to_syslog_facility = LOG_LOCAL0
auth_cluster_required = cephx
auth_service_required = cephx
auth_client_required = cephx
filestore_xattr_use_omap = true
osd_pool_default_size = 2
osd_pool_default_min_size = 1
osd_pool_default_pg_num = 1024
osd_journal_size = 2048
auth_supported = cephx
osd_pool_default_pgp_num = 1024
osd_mkfs_type = xfs
[client]
rbd_cache_writethrough_until_flush = True
Expand Down
5 changes: 5 additions & 0 deletions template/ceph_osd/ceph.conf.template.filter
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@ cluster_network =
mon_host =
public_network =
mon_initial_members =
osd_pool_default_pg_num =
osd_pool_default_pgp_num =
osd_journal_size =
osd_pool_default_size =
osd_pool_default_min_size =
13 changes: 13 additions & 0 deletions template/controller/ceph.conf.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[global]
auth_cluster_required = cephx
auth_service_required = cephx
auth_client_required = cephx
filestore_xattr_use_omap = true
log_to_syslog_level = info
log_to_syslog = False
log_to_syslog_facility = LOG_LOCAL0
auth_supported = cephx
osd_mkfs_type = xfs
[client]
rbd_cache_writethrough_until_flush = True
rbd_cache = True
11 changes: 11 additions & 0 deletions template/controller/ceph.conf.template.filter
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[global]
cluster_network =
mon_host =
public_network =
mon_initial_members =
fsid =
osd_pool_default_pg_num =
osd_pool_default_pgp_num =
osd_journal_size =
osd_pool_default_size =
osd_pool_default_min_size =