Member-only story

Ceph Libvirt Volume Management

DaeGon Kim
2 min readJan 26, 2023

In the previous article, we explained how to set up a libvirt pool using a Ceph rbd pool. We ended it with this command.

virsh vol-create-as "libvirt-pool" "[image-name]" --capacity "128G" --format raw

Now, we will cover a basic management of volumes. The first set of commands are listing and deleting commands.

virsh pool-list --all                  # list pools
virsh vol-list --pool [pool name] # list volumes in a pool
virsh vol-delete --pool [pool name] [volume name] # delete a volume

The following screenshot shows these commands in action.

listing pods, listing volumes and volume deletion

A major benefit of using Ceph rbd images is taking snapshots. This feature enables a VM to roll back to a certain state. But once snapshots are created, the original deletion command failed with the following errors.

error: Failed to delete vol metro-std-log-vm-attached
error: failed to remove volume 'libvirt-pool/[image-name]': No such file or directory

The error messages do not reflect the root cause. The screenshot below shows a sequence of commands and a working deletion command.

snapshot creation and volume deletions
virsh vol-delete…

--

--

No responses yet