Attaching RBD Storage Pool to Virt-Manager
Overview
This guide provides step-by-step instructions on how to attach an RBD (RADOS Block Device) storage pool to Virt-Manager using Ceph. You’ll learn how to create a secret, define it, and set its value, as well as how to create and start a Ceph pool XML for use with Virt-Manager. Following these steps will enable seamless integration of Ceph storage with your virtualization environment.
Create Secret 1
- Generate a secret.bash
cat > secret.xml <<EOF <secret ephemeral='no' private='no'> <usage type='ceph'> <name>client.admin secret</name> </usage> </secret> EOF
- Define the secret.Outputbash
sudo virsh secret-define --file secret.xml
<uuid of secret is output here>
- Save the key string to a file.bash
ceph auth get-key client.admin | sudo tee client.admin.key
- Set the UUID of the secretbash
sudo virsh secret-set-value --secret <uuid of secret is output here> --base64 $(cat client.admin.key) && rm client.admin.key secret.xml
Create Ceph Pool XML 2
- Navigate to /etc/libvirt/storage
- Create new pool rbd.xml (nano, vim, etc) 3rbd.xml
1 2 3 4 5 6 7 8 9 10
<pool type="rbd"> <name>rbd</name> <source> <name>rbd</name> <host name='host01.example.com' port='6789'/> <auth username='admin' type='ceph'> <secret uuid='{uuid of secret}'/> </auth> </source> </pool>
- Create a persistent definition of storage pool.bash
virsh pool-define rbd.xml
- Start the RBD storage pool.bash
virsh pool-start rbd
- Verfy RBD pool shows active.bash
virsh pool-list
Last updated on