Skip to main content

List RBD images, snapshots, and clones in Ceph pools

·126 words·1 min
Vimal A R
Author
Vimal A R
Still figuring it out!

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.

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

This will print an output similar to the following:

1POOL : 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 -----