Lab 2.3 - Ceph Operational (RADOS Block Device)


Before you begin, run the nusactl login command to login your account. Credentials for login is same with your registered credentials in this platform (ADINUSA).

student@ceph1:~$ nusactl login

After login, run the nusactl start cpadm-002-3 command. This command runs the start script and pre-configures your lab environment.

student@ceph1:~$ nusactl start cpadm-002-3


Note: Execute on pod-<username>-ceph1 node

1. Create pool and block device image.

su - ceph-adm

# Create a pool
sudo ceph osd pool create pool-test2 128
# Initialize the pool
sudo rbd pool init pool-test2
# To create a block device image, execute the following:
sudo rbd create pool-test2/block0 --size 5120

2. Export & Import RBD Image.

# Export image
sudo rbd export pool-test2/block0 /tmp/img
# Import image
sudo rbd import /tmp/img pool-test2/block1

3. Verify the pool.

# To list block devices in a particular pool, execute the following:
sudo rbd list pool-test2
# To retrieve information from an image within a pool, execute the following
sudo rbd info pool-test2/block0
sudo rbd info pool-test2/block1

4. Mapping image to block device.

sudo rbd map pool-test2/block0 -m pod-<username>-ceph1 -k /etc/ceph/ceph.client.admin.keyring
sudo rbd showmapped

5. Format filesystem.

sudo mkfs.xfs /dev/rbd0

6. Mount block device.

sudo mkdir /mnt/block0
sudo mount /dev/rbd0 /mnt/block0

7. Verify it

# show mounted block storage

# verify the usage
df -h