Assumptions:

Introduction:

If you have a variety of Ceph pools on different hardware, you may want to be able to find out which Ceph pools each instance is on for either performance or billing purposes.

Here's how I go about it...

Obtain the Volume ID

If your OpenStack service is configured to boot instances from volumes, then you can get the volume ID from the os-extended-volumes:volumes_attached field:

$ nova show Tutorial0 | grep volumes
| os-extended-volumes:volumes_attached | [{"id": "96321d31-27f7-47e5-b2a8-fcd1c0c30767"}]

Query the Ceph Cluster

I've not found an elegant way to go about this yet, so log into one of your Ceph servers and query the Ceph pools...

Grab a list of your Ceph pools:

 # ceph osd lspools
 10 poola,11 poolb,

Then query each pool to locate your volume:

# rbd -p poola ls | grep 96321d31-27f7-47e5-b2a8-fcd1c0c30767
# rbd -p poolb ls | grep 96321d31-27f7-47e5-b2a8-fcd1c0c30767
volume-96321d31-27f7-47e5-b2a8-fcd1c0c30767

Viola! The volume for your instance Tutorial0 is in the Ceph pool, poolb.