Member-only story

Ceph RBD for Virtual Machine Images

How to set up a virsh pool backed by a RDB pool

DaeGon Kim
3 min readJan 7, 2023

One of most commonly used cases for Ceph rbd images is for virtual machine images. Here we will go through a sequence of steps to set up a virsh pool using a rbd pool. The overview of these steps are as follows.

  1. Create a rbd pool
  2. Create a user for the rbd pool
  3. Client Setup, Part 1: Install packages
  4. Client Setup, Part 2: Define a virsh pool

Please note that we assume that kvm package and environment is already set. We do not address how to set up kvm/libvirt environments.

Create a rbd pool

We covered this step in the Ceph RBD Image mount article. We chose libvirt-pool as a rbd pool name.

sudo ceph osd pool create libvirt-pool
sudo rbd pool init libvirt-pool

These commands need to be run on the node where ceph admin credentials are available, usually, one of ceph monitor nodes.

Create a Ceph user for the rbd pool

All the nodes that will use this pool, nodes where virtual machines are running, need a Ceph credential to operate this pool. So we do not want to use Ceph admin credenitals. We will create a Ceph client for this pool only.

sudo ceph auth get-or-create client.libvirt mon 'profile rbd' osd 'profile rbd pool=libvirt-pool' mgr…

--

--

No responses yet