RBD storing images in Ceph for the beginner

Ceph is the open source Software Defined Storage (SDS) king. By default Ceph stores objects, how can you use it to store block devices such as virtual machines disks? For that purpose you can use RBD, let’s take a look.

I don’t have a Ceph cluster

Any sufficiently advanced technology is indistinguishable from magic.

Arthur C. Clarke

Ceph is pretty complicated as it is, I highly suggest you to follow this guide with a Ceph test cluster beneath your keyboard.

Ceph pools and RBD

RBD (Rados Block Device) is a way to store block devices in a RADOS cluster. Block devices stored using RBD are often called RBD images or (sometimes) RBD devices. RBD is an abstraction layer built on RADOS, this means that RBD images stored in Ceph are still stored using objects.

To store RBD images you will need a Ceph pool dedicated to RBD, this is commonly referred to as “RBD pool“. You should never use a RBD pool for any other purpose. If you upload objects directly to an RBD pool you may experience incoherent behaviors.

Now that you know what RBD is and what it needs to work: let’s get started. You will need to have a Ceph keyring on the host you’re using. The fastest way to get started is to ssh into a monitor node. Once you have it you will need an empty Ceph pool dedicated to RBD.

Important
I take NO responsibility of what you do with your machine; use this tutorial as a guide and remember you can possibly cause data loss if you touch things carelessly.

Initializing a RBD pool

The first thing in order to start using RBD is to initialize a pool:

Shrinking an image

$rbd trash ls {pool-name} Restoring an image $ rbd trash restore {pool-name}/{image-id}

Image courtesy of mark | marksei

The following two tabs change content below.

mark

The IT guy with a slight look of boredom in his eyes. Freelancer. Current interests: Kubernetes, Tensorflow, shiny new things.

You may also like...

This site uses Akismet to reduce spam. Learn how your comment data is processed.