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 Sep 24, 2023

any reason not to install the dashboard in say a privileged debian 12 LXC? (to keep the host os clean)

I think it needs to be on a host, activating CEPH DASHBOARD, because it’s a Ceph Module. ‘ceph mgr module enable dashboard’

@scyto
Copy link

scyto commented Sep 24, 2023

I think it needs to be on a host, activating CEPH DASHBOARD, because it’s a Ceph Module. ‘ceph mgr module enable dashboard’

Got it. I see i need to install the dashboard on all nodes.

do i also do this stuff on all nodes?

ceph mgr module enable dashboard --force  <this is my add, won't enable without this.
echo "thepassword" > /root/password
ceph dashboard ac-user-create cephdash -i ./password administrator --force
ceph config-key set mgr/dashboard/server_addr 127.0.0.1
ceph dashboard create-self-signed-cert
ceph mgr module disable dashboard
ceph mgr module enable dashboard
systemctl restart ceph-mgr@[hostname].service
systemctl status [email protected]
rm password

--edit-- oh i see, just read the docs - dashboard has to be on all nodes, ok will do on all nodes

oh interesting i can't execute any of the ceph dashboard commands or any command like ceph config-key get mgr/dashboard/crt - i get EONT errors

dashboard seems borked on my install (PVE8 + reef) https://forum.proxmox.com/threads/ceph-warning-post-upgrade-to-v8.129371/post-591377

@scyto
Copy link

scyto commented Apr 8, 2024

finally got the dashboard working, fixes went into promox packages ~Feb

@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