Tendrl / ceph-integration

Extracts all data from a Ceph cluster for consumption by Tendrl
GNU Lesser General Public License v2.1
3 stars 11 forks source link

Use `librbd` for rbd management in ceph-integration #150

Open shtripat opened 7 years ago

shtripat commented 7 years ago

Currently ceph-integration executes rbd CLI commands for performing rbd management works. We should rather use librbd module for more controlled and organized way to handle rbd management.

Refer: http://docs.ceph.com/docs/master/rbd/librbdpy/ for more details.

GowthamShanmugam commented 7 years ago

@r0h4n @shtripat I have checked librbd, i have tested rbd creation it works fine, When is try to display rbd information using some built in function it gives info like

{'parent_name': '', 'parent_pool': 18446744073709551615L, 'num_objs': 256L, 'block_name_prefix': u'rbd_data.106d2ae8944a', 'obj_size': 4194304L, 'order': 22, 'size': 1073741824L} it gives total size but it not give used size. I have trired with different functions but nothing is providing used information.

Current command is: rbd du MyBlockDevice -p MyPool NAME PROVISIONED USED MyBlockDevice 1024M 0

here provisioning size is nothing but a total size of rbd, so librbd command gives szie 1073741824L it nothing but a 1gb. but no used size is present.

i filled some data with rbd then size become [root@dhcp42-230 ~]# rbd du MyBlockDevice -p MyPool NAME PROVISIONED USED MyBlockDevice 1024M 4096k

but no change in rbd_inst.stat() output: {'parent_name': '', 'parent_pool': 18446744073709551615L, 'num_objs': 256L, 'block_name_prefix': u'rbd_data.106d2ae8944a', 'obj_size': 4194304L, 'order': 22, 'size': 1073741824L}

And one more thing is, if cluster is in error state then rbd creation is hanging, no timeout for the create function so we have to timeout using some thread (import multiprocessing) https://codepaste.net/s4jczr.