Ceph: find who's mapping a RBD device

shan

Curious? Wanna know who has a RBD device mapped?

W Important note: this method only works with the Emperor version of Ceph and above.

Grab the image information:

1
2
3
4
5
6
$ rbd info boot
rbd image 'boot':
    size 10240 MB in 2560 objects
    order 22 (4096 kB objects)
    block_name_prefix: rb.0.89ee.2ae8944a
    format: 1

Then list the objects part of the pool and get the image header. Eventually run:

1
2
$ rados -p rbd listwatchers boot.rbd
watcher=192.168.251.102:0/2550823152 client.35321 cookie=1

As we can see the machine: 192.168.251.102 has the device boot mapped.