Skip to content

Instantly share code, notes, and snippets.

@Drallas
Last active May 13, 2024 01:11
Show Gist options
  • Save Drallas/6069c5fc96f3570a9c8d573fc9c6d44c to your computer and use it in GitHub Desktop.
Save Drallas/6069c5fc96f3570a9c8d573fc9c6d44c to your computer and use it in GitHub Desktop.

Create Erasure Coded CephFS Pools

Part of collection: Hyper-converged Homelab with Proxmox

How to create a Erasure Coded Pool in Ceph and use 'directory pinning' to connect it to the CephFS filesystem.

To use a Erasure Coded Pool with CephFS, a directory inside the CephFS filesystem needs to be connected to a Erasure Coded Pool, this is called 'directory pinning'.


Create a Directory

The directory needs to be created inside the CephFS filesystem folder on one of the Proxmox Hosts.

mkdir /mnt/pve/cephfs/test-pool

This only has to be done only on one of the Proxmox Ceph cluster nodes!


Create a Pool

Now create an Erasure Coded Ceph Pool, this example uses the Ceph Dashboard; but it can also be done via the command-line.

Open the Ceph Dashboard, if it's installed, it can be found at: http://192.168.1.11:8443

Create a Erasure code profile

Screenshot 2023-09-23 at 10 19 11

Create the pool

Add an EC Profile

Fill in the details and click + next to 'Erasure code profile'.

Screenshot 2023-09-23 at 10 22 05

Create EC Profile 1

Create EC Profile

Select the desired settings; this example stores the Data on large but slower SSD drives, avoiding storing it on the faster NVMe in the cluster.

Screenshot 2023-09-23 at 10 21 30

Create EC Profile 2


Directory Pinning

Add the folder to the CepFS File system using 'directory pinning'.

Open the terminal on a Host:

Add the Data Pool to CephFS

ceph fs add_data_pool cephfs test-pool

Connect the Data Pool to the directory.

setfattr -n ceph.dir.layout -v pool=test-pool /mnt/pve/cephfs/test-pool/


Now the folder is ready to be used with Proxmox VM's via Virtio-fs or other methods.

@Drallas
Copy link
Author

Drallas commented Apr 9, 2024

@scyto Better late than never 👊🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment