Support setting a CRUSH weight on new OSDs

This commit is contained in:
2018-11-01 23:03:27 -04:00
parent 2ea8a14ba4
commit 9fcce4b09a
4 changed files with 59 additions and 31 deletions

View File

@ -669,13 +669,13 @@ def cmd(data, stat, event=''):
# Adding a new OSD
if command == 'osd_add':
node, device = args.split(',')
node, device, weight = args.split(',')
if node == this_node.name:
# Lock the command queue
lock = zkhandler.writelock(zk_conn, '/ceph/cmd')
with lock:
# Add the OSD
result = CephInstance.add_osd(zk_conn, logger, node, device)
result = CephInstance.add_osd(zk_conn, logger, node, device, weight)
# Command succeeded
if result:
# Update the command queue
@ -967,6 +967,7 @@ def update_zookeeper():
'utilization': osd['utilization'],
'var': osd['var'],
'pgs': osd['pgs'],
'kb': osd['kb'],
}
})
# Parse the status data