Member-only story
Ceph RBD for Virtual Machine Images
How to set up a virsh pool backed by a RDB pool
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.
- Create a rbd pool
- Create a user for the rbd pool
- Client Setup, Part 1: Install packages
- 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…