List RBD images, snapshots, and clones in Ceph pools


This is a crude bash one-liner I did to get the details of all the RBD images, as well as the information on snapshots and clones created from them.

# for pool in `rados lspools`;
    do echo "POOL :" $pool;
       rbd ls -l $pool;
       echo "-----";
    done

This will print an output similar to the following:

POOL : rbd
NAME                             SIZE        PARENT  FMT PROT LOCK
test_img                        10240M                    1
test_img2                      1024M                      2
test_img2@snap2      1024M                      2                    yes
-----
POOL : .rgw.root
-----
POOL : .rgw.control
-----
POOL : .rgw
-----
POOL : .rgw.gc
-----
POOL : .users.uid
-----
POOL : .users
-----
POOL : .users.swift
-----
POOL : .users.email
-----
POOL : .rgw.buckets.index
-----
POOL : images
NAME           SIZE      PARENT                               FMT PROT LOCK
clone1           1024M  rbd/test_img2@snap2             2
-----

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s