Git Product home page Git Product logo

ceph-scripts's Issues

Exception with ceph-gentle-reweight

I tried this invocation of ceph-gentle-reweight:
ceph-gentle-reweight -o 151,153,155,157,159,161,163,165,167,169,171,173,175,177,179 -l 15 -d -0.01 -t 0
and saw this traceback:

reweight_osds: changing all osds by weight -0.01 (target 0.0)
check current time: 02:00:11
check current day: 2
get_num_backfilling: PGs currently backfilling: 0
measure_latency: measuring 4kB write latency
Traceback (most recent call last):
  File "./ceph-gentle-reweight", line 191, in <module>
    main(sys.argv[1:])
  File "./ceph-gentle-reweight", line 186, in main
    reweight_osds(drain_osds, max_pgs_backfilling, max_latency, delta_weight, target_weight, test_pool, start_time, end_time, allowed_days, interval, really)
  File "./ceph-gentle-reweight", line 90, in reweight_osds
    latency = measure_latency(test_pool)
  File "./ceph-gentle-reweight", line 46, in measure_latency
    latency_ms = 1000*float(latency)
ValueError: could not convert string to float:

This is with the system Python 2.7.5 on CentOS 7.9.

upmap-remapped.py : Issues with python 3

Hello,
First of all, thank you for this script !
I had a few issues running the script with python 3 on Centos 7.

$ python3 -V
Python 3.6.8
  1. Error loading remapped pgs
$ python3 scripts/upmap-remapped.py
Error loading remapped pgs

The output of subprocess.check_output is of type byte, so it needs to be decoded before being able to use split:

for line in subprocess.check_output(['ceph', 'osd', 'pool', 'ls', 'detail']).split('\n'):
  1. OSDS is not a list
    For the same reason, OSDS is byte and not list :
OSDS = subprocess.check_output(['ceph', 'osd', 'ls', '-f', 'json'])
  1. Harmful cast in valid_osds
    Casting osds to str is useless and breaks the lookup in :
def valid_osds(osds):
  valid = []
  for osd in osds:
    if str (osd) in OSDS:
      valid.append(osd)
  return valid

I'll submit a PR with the various fixes.

crush-reweight-by-utilization.py after upgrade to Nautilus

Hi,

thank you for creating such a great collection of scripts. After upgrade my Ceph cluster to Nautilus the crush-reweight-by-utilization.py script stopped working.

# python crush-reweight-by-utilization.py --verbose --max-change=0.05 
Traceback (most recent call last):
  File "crush-reweight-by-utilization.py", line 211, in <module>
    if VERBOSE: raise(e)
KeyError: 'osd_stats'

Need a "ceph-whatami" kind of utility that returns the type of ceph node {mon|mgr|mds|rgw|osd}

It would be nice to have a utility that can run on any node and return what node it is (mon/mgr/mds/osd/rgw)

For a script, it's difficult to be sure what node it is running on. For example, if someone is writing a script that needs to do different things depending on whether it's run on a mon or osd node, for eg., there's no easy way to be sure unless you do a combination of things like check running services, examine /var/lib/ceph/XXX for non empty folders, etc.

So for example the expected behavior would be, when run on a OSD node,
$ceph-whatami
OSD

When run on a mon+mgr node
$ceph-whatami
MON
MGR

When run on a RGW node,
$ceph-whatami
RGW

This would come in handy for any scripts that need to behave differently depending on whether they're running on mon/osd/mgr/rgw/mds ceph nodes.

Got error when running script

Hi there,

I'm newbie to ceph and python. Got some error when I try the script.
Kindly advice how to fix that. Thanks in advance.

Traceback (most recent call last):
File "./ceph-gentle-reweight.py", line 190, in
main(sys.argv[1:])
File "./ceph-gentle-reweight.py", line 185, in main
reweight_osds(drain_osds, max_pgs_backfilling, max_latency, delta_weight, target_weight, test_pool, start_time, end_time, allowed_days, interval, really)
File "./ceph-gentle-reweight.py", line 90, in reweight_osds
latency = measure_latency(test_pool)
File "./ceph-gentle-reweight.py", line 46, in measure_latency
latency_ms = 1000*float(latency)
ValueError: could not convert string to float:

Thanks,
Allen

problem with allowed days detection in ceph-gentle-reweight script

There's a bug in the "in_timeframe" routine in the ceph-gentle-reweight script.

If the current_day is not in allowed_days but the current_time does fall between start_time and end_time it still allows the script to run. It shouldn't because the current_day is not allowed.

ceph-leader script returns incorrect result when jq version < 1.4

jq supports -e option since version 1.4, run previous versions with -e will result in:

$ ceph daemon mon.$(hostname -s) mon_status 2>/dev/null | jq -e '.state == "leader"'
jq: Unknown option -e
Use jq --help for help with command-line options,
or see the jq documentation at http://stedolan.github.com/jq

$ jq --version
jq version 1.3

The script redirects that error message to /dev/null:

$ ceph daemon mon.$(hostname -s) mon_status 2>/dev/null | jq -e '.state == "leader"' &>/dev/null

which leads to incorrect result.

Problem running ceph-pool-pg-distribution.py

Hi,
I cannot run script "ceph-pool-pg-distribution.py".
There's this error:

root@ld3955:~
# ./ceph-pool-pg-distribution.py
Traceback (most recent call last):
  File "./ceph-pool-pg-distribution.py", line 7, in <module>
    from cephinfo import cephinfo
ImportError: No module named cephinfo
root@ld3955:~

Please advise how to fix this.

Map PG to RBD

Do you know, or have a tool, to take a pg ID that can then map to a specific RBD?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.