Mon compte clientContact commercialWebmailOVHcloud Blog

Bienvenue chez OVHcloud !

Identifiez-vous pour commander, gérez vos produits et services et suivre vos commandes

Me connecter
Documentation OVH

CephFS distributed filesystem

This guide will show how to enable and manage CephFS on your CDA

What is CephFS?

CephFS is a distributed POSIX filesystem built on top of Ceph. To use CephFS you need a client with support for it - all modern Linux distributions include CephFS driver by default.

You can enable and manage CephFS on your CDA through API. After enabling CephFS you can use in a similar manner to CDA - it's a private, dedicated filesystem for your own use. You can use both RBD and CephFS at the same time - just keep in mind that they share the same hardware underneath.

Enabling CephFS

Enabling and management is possible only through API. For now it's only possible to enable single filesystem which must be named fs-default.

First step is to list your current CephFS:

GET /dedicated/ceph/{serviceName}/cephfs
[ ]

By default you'll get an empty list. Let's enable (create) a filesystem:

GET /dedicated/ceph/{serviceName}/cephfs/{fsName}/enable
"352f999d-a191-4420-825d-0cae0980baae"

Your CephFS should be available within few minutes. You can verify that directly on your cluster by using:

ceph --id CEPH_USER fs ls

If you would like to get some details about you CephFS, use:

ceph --id CEPH_USER fs get fs-default

Disabling and removing CephFS

You can remove your filesystem when no longer needed. There are two steps here:

  • disable your filesystem - this will block access to CephFS but your data will be intact, if you change your mind you can just enable it again
POST /dedicated/ceph/{serviceName}/cephfs/{fsName}/disable
  • purge filesystem data - this can only be done on disabled filesystem
DELETE /dedicated/ceph/{serviceName}/cephfs/{fsName}

CephFS access management

To manage access to CephFS the same set of IP ACL is used as for whole CDA. However, you'll need a user to write to a CephFS. Use following API call to create user:

POST /dedicated/ceph/{serviceName}/user

You'll also need to grant that user write access to CephFS data pool, which is called cephfs.fs-default.data. Do it using following API call:

POST /dedicated/ceph/{serviceName}/user/{userName}/pool

Grants you need are read, write.

Mounting CephFS on your host

Install ceph-common package that contains /sbin/mount.ceph binary. Package name may be different for your disribution. In example below we use Debian based one:

apt install --no-install-recommends ceph-common

Now we need to point client to CDA cluster. Edit (or create) /etc/ceph/ceph.conf, it should look like below:

[global]
  fsid = 12345678-dead-beef-cafe-0123456789ab
  mon host = A.B.X.6 A.B.Y.6 A.B.Z.6

FSID is the service name of your CDA. mon host IPs can be fetched using following API call:

GET /dedicated/ceph/{serviceName}

You will also need second file with key for user used to connect to cluster. Fetch his key using:

GET /dedicated/ceph/{serviceName}/user/{userName}

Create a file called /etc/ceph/ceph.client.CEPHFS_USER.keyring with following content:

[client.CEPHFS_USER]
    key = AQBm7o8fhns1HBAAgaLzICzJfjgU/U2lkVy+zA==

Finally you can mount your filesystem:

mkdir /mnt/cephfs
mount -t ceph -o name=CEPHFS_USER :/ /mnt/cephfs/

Cette documentation vous a-t-elle été utile ?

N’hésitez pas à nous proposer des suggestions d’amélioration afin de faire évoluer cette documentation.

Images, contenu, structure… N’hésitez pas à nous dire pourquoi afin de la faire évoluer ensemble !

Vos demandes d’assistance ne seront pas traitées par ce formulaire. Pour cela, utilisez le formulaire "Créer un ticket" .

Merci beaucoup pour votre aide ! Vos retours seront étudiés au plus vite par nos équipes..


Ces guides pourraient également vous intéresser...