From: Alfredo Deza Date: Wed, 10 Sep 2014 17:54:15 +0000 (-0400) Subject: implement a check for dangerous number of OSDs per host X-Git-Tag: v1.5.15~4^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b735e79b560b65ccfdc413f659034c6cdf40e026;p=ceph-deploy.git implement a check for dangerous number of OSDs per host Signed-off-by: Alfredo Deza --- diff --git a/ceph_deploy/osd.py b/ceph_deploy/osd.py index a86a7bd..69f9ef9 100644 --- a/ceph_deploy/osd.py +++ b/ceph_deploy/osd.py @@ -244,6 +244,31 @@ def prepare_disk( ) +def exceeds_max_osds(args, reasonable=20): + """ + A very simple function to check against multiple OSDs getting created and + warn about the possibility of more than the recommended which would cause + issues with max allowed PIDs in a system. + + The check is done against the ``args.disk`` object that should look like:: + + [ + ('cephnode-01', '/dev/sdb', '/dev/sda5'), + ('cephnode-01', '/dev/sdc', '/dev/sda6'), + ... + ] + """ + hosts = [item[0] for item in args.disk] + per_host_count = dict( + ( + (h, hosts.count(h)) for h in set(hosts) + if hosts.count(h) > reasonable + ) + ) + + return per_host_count + + def prepare(args, cfg, activate_prepared_disk): LOG.debug( 'Preparing cluster %s disks %s', @@ -251,6 +276,14 @@ def prepare(args, cfg, activate_prepared_disk): ' '.join(':'.join(x or '' for x in t) for t in args.disk), ) + hosts_in_danger = exceeds_max_osds(args) + + if hosts_in_danger: + LOG.warning('if ``kernel.pid_max`` is not increased to a high enough value') + LOG.warning('the following hosts will encounter issues:') + for host, count in hosts_in_danger.items(): + LOG.warning('Host: %8s, OSDs: %s' % (host, count)) + key = get_bootstrap_osd_key(cluster=args.cluster) bootstrapped = set()