Set up Shared Filesystems service with CephFS driver

This section provides the necessary steps to prepare your environment for working with the MOSK Shared Filesystems service (OpenStack Manila), create a share network, configure share file systems, and grant access to clients. By following these instructions, you will ensure that your system is properly set up to manage and mount shared resources using Manila with the CephFS driver.

Create a share file system and grant access to it

  1. Create a 1 GB CephFS share:

    openstack share create --name <SHARE-NAME> CEPHFS 1
    

    For example, to create the demo_share share:

    openstack share create --name demo_share CEPHFS 1
    

    Example of a positive system response:

    +---------------------------------------+--------------------------------------+
    | Field                                 | Value                                |
    +---------------------------------------+--------------------------------------+
    | access_rules_status                   | active                               |
    | availability_zone                     | None                                 |
    | create_share_from_snapshot_support    | False                                |
    | created_at                            | 2024-12-13T08:20:59.703889           |
    | description                           | None                                 |
    | has_replicas                          | False                                |
    | host                                  |                                      |
    | id                                    | b968c5ef-7a6a-4a8f-84e0-342a76de80d9 |
    | is_public                             | False                                |
    | is_soft_deleted                       | False                                |
    | metadata                              | {}                                   |
    | mount_snapshot_support                | False                                |
    | name                                  | demo_share                           |
    | progress                              | None                                 |
    | project_id                            | be1404609fe54cb5b2bd4f12f1b3ed2a     |
    | replication_type                      | None                                 |
    | revert_to_snapshot_support            | False                                |
    | scheduled_to_be_deleted_at            | None                                 |
    | share_group_id                        | None                                 |
    | share_network_id                      | None                                 |
    | share_proto                           | CEPHFS                               |
    | share_server_id                       | None                                 |
    | share_type                            | ccf51f3b-75ac-4adb-a32b-9d0347fa1792 |
    | share_type_name                       | cephfs                               |
    | size                                  | 1                                    |
    | snapshot_id                           | None                                 |
    | snapshot_support                      | False                                |
    | source_share_group_snapshot_member_id | None                                 |
    | status                                | creating                             |
    | task_state                            | None                                 |
    | user_id                               | ce48b513f71146e5be1e88408dd8eb70     |
    | volume_type                           | cephfs                               |
    +---------------------------------------+--------------------------------------+
    
  2. Verify that the share creation has been finalized:

    openstack share list
    

    Example of a positive system response:

    +--------------------------------------+------------+------+-------------+-----------+-----------+-----------------+-----------------------------------------------------------------------+-------------------+
    | ID                                   | Name       | Size | Share Proto | Status    | Is Public | Share Type Name | Host                                                                  | Availability Zone |
    +--------------------------------------+------------+------+-------------+-----------+-----------+-----------------+-----------------------------------------------------------------------+-------------------+
    | b968c5ef-7a6a-4a8f-84e0-342a76de80d9 | demo_share |    1 | CEPHFS      | available | False     | cephfs          | mk-rs-rqynaqf3c2pc-1-mhanefopfeik-server-anhd4o6mj5nz@cephfs#cephfs   | nova              |
    +--------------------------------------+------------+------+-------------+-----------+-----------+-----------------+-----------------------------------------------------------------------+-------------------+
    
  3. Grant the rw access to the virtual machine:

    openstack share access create <SHARE-NAME> cephx <ACCESS-ID>
    

    For example:

    openstack share access create demo_share cephx bob
    

    Example of a positive system response:

    +--------------+--------------------------------------+
    | Field        | Value                                |
    +--------------+--------------------------------------+
    | id           | 955fe3ba-2c12-41b3-ad40-b58d9df55200 |
    | share_id     | b968c5ef-7a6a-4a8f-84e0-342a76de80d9 |
    | access_level | rw                                   |
    | access_to    | bob                                  |
    | access_type  | cephx                                |
    | state        | queued_to_apply                      |
    | access_key   | None                                 |
    | created_at   | 2024-12-13T08:26:53.227445           |
    | updated_at   | None                                 |
    | properties   |                                      |
    +--------------+--------------------------------------+
    
  4. List access details for the share you created:

    openstack share access list <SHARE-NAME>
    

    For example, to list the credentials for the demo_share share:

    openstack share access list demo_share
    
    +--------------------------------------+-------------+-----------+--------------+--------+------------------------------------------+----------------------------+----------------------------+
    | ID                                   | Access Type | Access To | Access Level | State  | Access Key                               | Created At                 | Updated At                 |
    +--------------------------------------+-------------+-----------+--------------+--------+------------------------------------------+----------------------------+----------------------------+
    | 955fe3ba-2c12-41b3-ad40-b58d9df55200 | cephx       | bob       | rw           | active | AQDQ71tnDsXXLBAAyxn4MoM4rL7uU5Y0Suvabg== | 2024-12-13T08:26:53.227445 | 2024-12-13T08:26:56.954220 |
    +--------------------------------------+-------------+-----------+--------------+--------+------------------------------------------+----------------------------+----------------------------+
    

    The Access to and Access key values will be used later to mount the share.

Connect the share to the virtual machine

  1. Obtain the share URL:

    openstack share export location list <SHARE-NAME> -c Path -f value
    

    For example, to obtain the demo_share URL:

    openstack share export location list demo_share -c Path -f value
    

    Example of a positive system response:

    10.10.0.51:6789,10.10.0.8:6789,10.10.0.170:6789:/volumes/_nogroup/949aea62-2193-4320-bd67-0f068c20a643/20f32471-e2ca-4288-b47e-5d5e857a9ba9
    
  2. Log in to the virtual machine using the share URL obtained in the previous step and run as root:

    Note

    To use the mount utility, it is necessary to install the CephFS mount helper. For example, on Ubuntu, the ceph-common package provides this helper.

    mount -t ceph <SHARE-URL> /mnt/ -o name=<ACCESS-TO>,secret=<ACCESS-KEY>
    
  3. Verify that the share is mounted and has a property size:

    df -h /mnt
    

    Example of a positive system response:

    Filesystem                                                                                                                                   Size  Used Avail Use% Mounted on
    10.10.0.51:6789,10.10.0.8:6789,10.10.0.170:6789:/volumes/_nogroup/949aea62-2193-4320-bd67-0f068c20a643/20f32471-e2ca-4288-b47e-5d5e857a9ba9  1.0G     0  1.0G   0% /mnt