Manage filesystems
This service is provided by Manila and offer network accessible filesystem. These filesystems can be used to share data within a project and between VMs. At CC-IN2P3 this storage is backed by a CephFS cluster.
To use Manila’s commands it’s required to install package python3-manilaclient
.
List shares
To list shares in your project.
% manila list
+---------+-------------+------+-------------+-----------+-----------+-----------------+-------------------+
| ID | Name | Size | Share Proto | Status | Is Public | Share Type Name | Availability Zone |
+---------+-------------+------+-------------+-----------+-----------+-----------------+-------------------+
| [...] | Share-test2 | 40 | CEPHFS | available | False | rad.regular | nova |
| [...] | Share-test | 30 | CEPHFS | available | False | rad.regular | nova |
+---------+-------------+------+-------------+-----------+-----------+-----------------+-------------------+
List share types
Share types provide the ability to choose the storage type we can use and where the data will be stored. To list share types available in a project.
% manila type-list
+---------+-------------+------------+
| id | name | visibility |
+---------+-------------+------------+
| [...] | ha.regular | private |
| [...] | rad.regular | private |
+---------+-------------+------------+
For a production infrastructure share type ha.regular
is recommended. For R&D, rad.regular
will be prefered.
By default project only have acces to rad.regular
. Don’t hesitate to inform us if you need the share type for production.
Create and use a share
This will create a share named Test_share1
with the protocol cephfs and with a size of 10GB and the type rad.regular
.
% manila create --share-type rad.regular --name Test_share1 cephfs 10
+---------------------------------------+--------------------------------+
| Property | Value |
+---------------------------------------+--------------------------------+
| status | creating |
| share_type_name | rad.regular |
| description | None |
| availability_zone | None |
| share_network_id | None |
| share_server_id | None |
| share_group_id | None |
| host | |
| revert_to_snapshot_support | False |
| access_rules_status | active |
| snapshot_id | None |
| create_share_from_snapshot_support | False |
| is_public | False |
| task_state | None |
| snapshot_support | False |
| id | [...] |
| size | 10 |
| source_share_group_snapshot_member_id | None |
| user_id | [...] |
| name | Test_share1 |
| share_type | [...] |
| has_replicas | False |
| replication_type | None |
| created_at | 2021-01-28T09:09:45.000000 |
| share_proto | CEPHFS |
| mount_snapshot_support | False |
| project_id | [...] |
| metadata | {} |
+---------------------------------------+--------------------------------+
Give access to a share
Once the share has been created you must specify from which user you want to access it. This user is not bound to the OpenStack account, it is known only from Ceph and will be created automatically. It will be used to mount the share in a VM.
% manila access-allow Test_share1 cephx alice
To verify rights on the share and obtain the acces key that will allow the use of the share.
% manila access-list Test_share1
+---------+-------------+----------+--------------+--------+------------------------------------------+
| Id | Access_Type | Acces_To | Access_Level | State | Access_Key |
+---------+-------------+----------+--------------+--------+------------------------------------------+
| [...] | cephx | alice | rw | active | AQA8+ANW/4ZWNRAAOtWJMFPEihBA1unFImJczA== |
+---------+-------------+----------+--------------+--------+------------------------------------------+
Export share path
You need to retrieve the share path. This path will be used to configure VM to connect to the share.
% manila share-export-location-list Test_share1
+---------+--------------------------------------------------------------------------------------------------------------+-----------+
| ID | Path | Preferred |
+---------+--------------------------------------------------------------------------------------------------------------+-----------+
| [...] | 10.0.0.1:6789,10.0.0.2:6789,10.0.0.3:6789:/volumes/recherche/_nogroup/c183cdef-3adc-4c7f-9f4b-741ba6895025 | False |
+---------+--------------------------------------------------------------------------------------------------------------+-----------+
Mount the share in a VM
To mount a share in a VM you will need the previous information. The access key and the share path. There are two ways to mount a share, via Fuse or via the kernel module.
Create a file alice.keyring
in which you must place the access key.
[client.alice]
key = AQA8+ANW/4ZWNRAAOtWJMFPEihBA1unFImJczA==
Then create an another file ceph.conf
containing part of the share path.
[client]
client quota = true
mon host = 10.0.0.1:6789,10.0.0.2:6789,10.0.0.3:6789
Use the ceph-fuse
command to mount the share. You have to install the corresponding package.
You may have to add Ceph RPMs to solve some conflicts on package.
% ceph-fuse /mnt --id=alice --conf=./ceph.conf --keyring=./alice.keyring --client-mountpoint=/volumes/recherche/_nogroup/c183cdef-3adc-4c7f-9f4b-741ba6895025
The share is now available on the VM. Repeat this step on any other VM to add the share.
Note
More information on the official documentation : Fuse.
With the kernel module just use the mount
command.
% sudo mount -t ceph 10.0.0.1:6789,10.0.0.2:6789,10.0.0.3:6789:/volumes/recherche/_nogroup/c183cdef-3adc-4c7f-9f4b-741ba6895025 /mnt -o name=alice,secret=AQA8+ANW/4ZWNRAAOtWJMFPEihBA1unFImJczA==
In order to avoid leaving the secrect in your shell’s command history it’s possible to place it in a file. Replace the option secret=
by secretfile=
followed by the file path.
Note
More information on the official documentation : kernel module.
Delete a share
% manila delete Test_share1
Attention
The destruction of a share will result in the stored data permanent removal.
Other useful commands
Extend the size of a share.
% manila extend Test_share1 20
Shrink the size of a share. Caution, shrinking can lead to data loss.
% manila shrink Test_share1 10
Revoke rights of a user on a share thus preventing him any access.
% manila access-deny Test_share1 alice