Fix some bugs and add RBD volume stats

This commit is contained in:
2019-06-19 10:25:22 -04:00
parent db0b382b3d
commit a940d03959
3 changed files with 31 additions and 27 deletions

View File

@ -504,11 +504,15 @@ def add_volume(zk_conn, logger, pool, name, size):
print(stderr)
raise
# Get volume stats
retcode, stdout, stderr = common.run_os_command('rbd info {}/{}'.format(pool, name))
volstats = stdout
# Add the new volume to ZK
zkhandler.writedata(zk_conn, {
'/ceph/volumes/{}/{}'.format(pool, name): '',
'/ceph/volumes/{}/{}/size'.format(pool, name): size,
'/ceph/volumes/{}/{}/stats'.format(pool, name): '{}',
'/ceph/volumes/{}/{}/stats'.format(pool, name): volstats,
'/ceph/snapshots/{}/{}'.format(pool, name): '',
})
@ -857,7 +861,7 @@ def run_command(zk_conn, logger, this_node, data, d_osd):
# Removing a snapshot
elif command == 'snapshot_remove':
pool, name, name = args.split(',')
pool, volume, name = args.split(',')
if this_node.router_state == 'primary':
# Lock the command queue