Create and use a CephFS Type share

Warning

CephFS shares are available only on the GAIA cloud.

Note

To create shares, the project must be allowed to use Manila Service. If you don’t have access yet, please request it following instructions at this page.

Attatch the VMs to the storage network

Before creating the share, it is necessary to have at least one virtual machine connected to a storage network that will be able to see the vast shares.

To attach the VM on a storage network, on the Horizon Dashboard, open the tab Project > Compute > Instances. Select the desired VM and click on “Attach Interface”. In the popup menu, select the network GAIA_OS_CEPHFS.

Repeat the same operation for each VM that will mount the shared filesystem.

Create the share

On the Share > Shares tab, create the share clicking on the button Create share. In the popup menu set:

  • share name: the name you want to give to the share

  • share protocol: select “CephFS”

  • size: the size of your shared filesystem

  • type: cephfs

  • Availability Zone, Share Group and Make visible for all projects: leave blank

../../../_images/op_share_cephfs_g_img1.png

Set access rule

On the tab Share > Shares select the share just created and in the dropdown menu select Manage Rules.

../../../_images/op_share_cephfs_img2.png

Click on Add rule and set:

  • access type: cephx

  • access level: read-write or read-only (depending on your needs)

  • access to: write the name of the client (in our example “charlie”)

../../../_images/op_share_cephfs_img3.png

After clicking on the “add” button, go back to the Share > Shares. Click on the brand new share to display the Share Overview. The “Export locations: Path” and “access key” and “access to” keys are displayed. This information will be used to mount the share on the virtual machines.

Mount the share on the VMs

To mount the share on the virtual machines, it is necessary to have:

  • a kernel version higher than 7.0.0

  • the package “ceph-common” installed on the VMs, either Squid release v19.2.6 or Tentacle release v20.2.4,

If you are using ceph-csi for your workflow, use a version >= 3.18 (github release).

Note

To install the correct version of the package, please refer to the ceph user manual.

If you are unable to update the kernel of your VM, you can evaluate to mount the share using ceph-fuse command.

In the following example, we will consider two VM with Ubuntu. Please refer to the network guide of the operating system of your VM to be sure about the operations to be done.

  • Login on the VM

  • Update the kernel to >= 7.0.0 version.

  • Reboot the VM to use the new kernel.

  • Install the correct ceph-common version.

  • Under /etc/ceph/ create the file ceph.conf with the following content:

    [client]
    client quota = true
    mon host = 10.137.64.187:6789, 10.137.64.186:6789, 10.137.64.185:6789
    
  • Under /etc/ceph/ create the file ceph.client.<CLIENT_ACCESS_TO>.keyring (where <CLIENT_ACCESS_TO> is the value of the field “Access to” in the Share Overview page) with the following content:

    [client.<CLIENT_ACCESS_TO>]
    key = <ACCESS_KEY>
    
  • Login to the second VM and repeat the same steps to create the files ceph.conf and ceph.client.<CLIENT_ACCESS_TO>.keyring with the same content as in the first VM.

  • Create the mount point in the virtual machines (in our example /mnt/share_manila) and mount the share

  • To mount the share you will need some information contained in the “Share Overview” page on OpenStack dashboard, in particular you will need the values of PATH, ACCESS_TO and ACCESS KEY (here an example):

    ../../../_images/op_share_cephfs_img6.png

The command is:

sudo mount -t ceph <PATH> <MOUNT_POINT> -o name=<NAME>

Where <PATH>, <MOUNT_POINT> and <NAME> are the following:

  • <PATH> is the value of the field “Export locations: Path” in the Share Overview page

  • <MOUNT_POINT> is the path to the mount point on the VM (in our example “/mnt/share_manila”)

  • <NAME> is the value of the field “Access to” in the Share Overview page

NOTE: If you are using a different Linux distribution, please refer to the ceph user manual to be sure that the syntax you are using is appropriate for the ceph version installed.

  • Then repeat the same steps for the second VM as well. Now the two VMs share the same filesystem