Rbd pool setup
This skill should be used when the user asks to create RBD (RADOS Block Device) storage on an existing Ceph cluster — e.g. "create an RBD pool", "set up block storage on Ceph", "rbd create image", "map an RBD device". Covers pool creation, image creation, scoped cephx client auth, and mapping/mounting.From its SKILL.md
npx -y skills add sserkanml/ceph-cookbook --skill rbd-pool-setupAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
3.3 KB, as published. Nobody here has run it
RBD Pool & Image Setup
Overview
Setting up RBD (RADOS Block Device) storage on an already-healthy Ceph cluster: create a dedicated pool, initialize it for RBD use, create one or more images, grant a client identity least-privilege access scoped to that pool, then map/mount the image.
Placeholders
| Placeholder | Meaning | Example |
|---|---|---|
<POOL_NAME> | RBD pool name | rbd-pool |
<PG_NUM> | Placement group count for the pool | 128 |
<IMAGE_NAME> | RBD image name | vol01 |
<IMAGE_SIZE> | Image size | 50G |
<CLIENT_ID> | cephx client id (without the client. prefix) | rbd-client |
<FEATURES> | RBD image features to enable | layering,exclusive-lock,object-map,fast-diff |
Prerequisites
- A healthy Ceph cluster reachable via
ceph/rbdCLI (native client orcephadm shell) with an admin keyring. - Enough free OSD capacity for the new pool at the target
<PG_NUM>. - On consumer hosts: the kernel
rbdmodule (for kernel-mapped block devices) orlibrbd(for QEMU/libvirt-attached images).
1. Create and Initialize the Pool
ceph osd pool create <POOL_NAME> <PG_NUM> <PG_NUM>
ceph osd pool application enable <POOL_NAME> rbd
rbd pool init <POOL_NAME>
2. Create the Image
rbd create <IMAGE_NAME> --size <IMAGE_SIZE> --pool <POOL_NAME> --image-feature <FEATURES>
rbd info <POOL_NAME>/<IMAGE_NAME>
3. Create a Scoped Client
Least-privilege: this client can only touch <POOL_NAME>, nothing else in the cluster.
ceph auth get-or-create client.<CLIENT_ID> \
mon 'profile rbd' \
osd 'profile rbd pool=<POOL_NAME>' \
-o /etc/ceph/ceph.client.<CLIENT_ID>.keyring
ceph auth get client.<CLIENT_ID>
4. Map and Mount (kernel client)
rbd map <IMAGE_NAME> --pool <POOL_NAME> --id <CLIENT_ID>
mkfs.xfs /dev/rbd/<POOL_NAME>/<IMAGE_NAME>
mkdir -p /mnt/<IMAGE_NAME>
mount /dev/rbd/<POOL_NAME>/<IMAGE_NAME> /mnt/<IMAGE_NAME>
For QEMU/libvirt consumers, skip the kernel map and attach the image directly via a
<disk type='network'>libvirt XML stanza (or-drive file=rbd:<POOL_NAME>/<IMAGE_NAME>for raw QEMU) using the same<CLIENT_ID>keyring.
5. Verify
rbd ls -p <POOL_NAME>
rbd showmapped
ceph osd pool stats <POOL_NAME>
df -h /mnt/<IMAGE_NAME>