Show and modify the replica count (size) in a given pool.
You can do the same with min_size
if needed.
# Show the current replica count
# ceph osd pool get <pool name> size
ceph osd pool get images size
# Set the replica count for a given pool
# ceph osd pool set <pool name> size <number of replicas>
ceph osd pool set images size 2
ceph df
# Show the status right now
ceph -s
# Show the status and watch it
ceph -w
# LIST
# rbd ls -p <pool name>
rbd ls -p volumes
# CREATE
# rbd create --size <size in gb> <pool>/<volume id>
rbd create --size 10 volumes/myVolume
# DELETE
# rbd rm <pool>/<volume id>
rbd rm volumes/myVolume
# PRESENT TO HOST
# rbd map <pool>/<volume id>
rbd map volumes/myVolume
# LIST MAPPED
rbd showmapped
# REMOVE FROM HOST
# rbd unmap <pool>/<volume id>
rbd unmap volumes/myVolume
Once you've presented the volume you can use it like this:
mkfs.ext4 /dev/rbd0
mkdir /data
mount /dev/rbd0 /data
# LIST SNAPSHOTS
# rbd snap ls <pool>/<volume id>
rbd snap ls volumes/myVolume
# REVERT TO SNAPSHOT
# rbd snap rollback <pool>/<volume id>@<snapshot id>
rbd snap rollback volumes/myVolume@sampleSnapshot
# DELETE SNAPSHOT
# rbd snap rm <pool>/<volume id>@<snap id>
rbd snap rm volumes/myVolume@sampleSnapshot
# rbd export <pool>/<volume> <filename>
rbd export volumes/myVolume myVolume.raw