If you run a VM with Ceph as backing storage, you use RDB storage. In Proxmox this will be configured (almost) automatically. Ceph RDB is a block storage layer. CephFS is a file-system layer on top of that. This makes it possible to use Ceph as a (shared) file-system.
Now, why do I want to use CephFS inside a VM? In Proxmox it is much easier to attach a second virtual disk (RDB backed). In my case it was towfold:
Configuration is in two parts. Host config and client config. In this example the client is vm3012 (the vmid in Proxmox). I assume CephFS is configured and setup as storage in Proxmox. For this example it is named: cephfs-vms.
mkdir -p /mnt/pve/cephfs-vms/vm3012
sudo ceph fs authorize cephfs-vms client.vm3012 /vm3012 rw \
-o /etc/ceph/ceph.client.vm3012.keyring
sudo apt update
sudo apt install ceph-common
sudo nano /etc/ceph/ceph.conf
[global]
fsid = ***-***
mon_host = ip1 ip2 ip3
[client]
keyring = /etc/ceph/$cluster.$name.keyring
sudo nano /etc/ceph/ceph.client.vm3012.keyring
Add only the key:
***
sudo mkdir -p /mnt/cephfs
/etc/fstab::/3012 /mnt/cephfs ceph _netdev,name=vm3012,secretfile=/etc/ceph/ceph.client.vm3012.keyring,fs=cephfs-vms 0 0