此内容没有您所选择的语言版本。
Chapter 10. Customizing the Shared File Systems service (manila)
With the Shared File Systems service (manila), you can provision shared file systems that multiple cloud user instances, bare-metal nodes, or containers can consume. You can create share types to prepare the share service and enable cloud users to create and manage shares. You use the OpenStack command-line interface (CLI) to manage shared file systems.
10.1. Prerequisites 复制链接链接已复制到粘贴板!
-
You have the
occommand line tool installed on your workstation. -
You are logged on to a workstation that has access to the RHOSO control plane as a user with
cluster-adminprivileges. - An end user requires at least one share type to use the Shared File Systems service.
- For a Compute instance to connect to the shared provider network, the user must add an additional Networking service (neutron) port.
10.2. Creating Shared File Systems service share types 复制链接链接已复制到粘贴板!
You can create share types to define the type of service that the Shared File Systems service (manila) scheduler uses to make scheduling decisions and that drivers use to control share creation.
Share types include a description and extra specifications, for example, driver_handles_share_servers and snapshot_support, to filter back ends.
Users require at least one share type to use the Shared File Systems service, and users can only create shares that match the available share types.
By default, share types are public, which means they are available to all cloud projects. However, you can create private share types for use in specific projects.
In the following example procedure, you use the driver_handles_share_servers parameter (DHSS), which you can set to true or false:
-
For CephFS-NFS and native CephFS, you set DHSS to
false. -
For other back ends, you can set DHSS to
trueorfalse, based on the custom resource (CR) configuration.
Procedure
Access the remote shell for the
openstackclientpod from your workstation:oc rsh -n openstack openstackclient
$ oc rsh -n openstack openstackclientCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run the following command to create a share type:
openstack share type create default <driver_handles_share_servers>
$ openstack share type create default <driver_handles_share_servers>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<driver_handles_share_servers>withtrueorfalse.
-
Replace
Add specifications to the default share type or create additional share types to use with different back ends. In this example, configure the default share type to select a CephFS back end and an additional share type that uses a NetApp
driver_handles_share_servers=trueback end:openstack share type create default false \ --extra-specs share_backend_name='cephfs' openstack share type create netapp true \ --extra-specs share_backend_name='netapp_ontap'
$ openstack share type create default false \ --extra-specs share_backend_name='cephfs' $ openstack share type create netapp true \ --extra-specs share_backend_name='netapp_ontap'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Exit the
openstackclientpod:exit
$ exitCopy to Clipboard Copied! Toggle word wrap Toggle overflow
You can create share types to define the capabilities of shares. The following table describes share types and their capabilities.
| Share type | Values | Description |
|---|---|---|
|
| true or false | Grants permission to use share networks to create shares. |
|
| true or false | Grants permission to create snapshots of shares. |
|
| true or false | Grants permission to create clones of share snapshots. |
|
| true or false | Grants permission to revert your shares to the most recent snapshot. |
|
| true or false | Grants permission to export and mount your snapshots. |
|
| dr | Grants permission to create replicas for disaster recovery. Only one active export is allowed at a time. |
| readable | Grants permission to create read-only replicas. Only one writable, active export is allowed at a time. | |
| writable | Grants permission to create read/write replicas. Any number of active exports are allowed at a time per share. | |
|
| a list of one or more availability zones | Grants permission to create shares only on the availability zones listed. |
You can manage file shares that already exist in storage by using the manage/unmanage feature of the Shared File Systems service (manila). Users can perform operations on managed shares, such as granting access, mounting, and resizing, in the same way that they perform these operations on Shared File Systems service shares.
You can manage the lifecycle of shares that have the driver_handles_share_servers (DHSS) parameter set to true and shares that have DHSS set to false. To manage DHSS=true shares, you must also manage the share server that contains the share.
When you unmanage a share, you remove the share from the management of the Shared File Systems service without deleting the share. If shares have dependent snapshots or share replicas, you can only remove the shares from the Shared File Systems service when the snapshots or share replicas have been removed.
- Limitations
- The driver must support manage/unmanage functionality.
- The manage/unmanage feature does not support native CephFS or CephFS-NFS back ends. You can remove CephFS shares from the management of the Shared File Systems service. However, you cannot bring existing CephFS shares under the management of the Shared File Systems service.
- When you bring a share under the management of the Shared File Systems service, existing clients are disconnected. When you remove a share from the management of the Shared File Systems service, existing clients remain connected.
Procedure
Access the remote shell for the
openstackclientpod from your workstation:oc rsh -n openstack openstackclient
$ oc rsh -n openstack openstackclientCopy to Clipboard Copied! Toggle word wrap Toggle overflow Manage a share:
openstack share adopt --name <name> --description <description> --share-type <share_type> --driver-options [<key=value> [<key=value> ...]] [--public] [--share-server-id <share_server_id>] \ [--wait] <service_host> <protocol> <export_path>$ openstack share adopt --name <name> --description <description> --share-type <share_type> --driver-options [<key=value> [<key=value> ...]] [--public] [--share-server-id <share_server_id>] \ [--wait] <service_host> <protocol> <export_path>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<name>with a descriptive name for the share. -
Replace
<description>with a description of the share. -
Replace
<share_type>with the share type of the share. -
Replace
<key=value>with the key-value pair of the driver property you want to associate to your share. You can use multiple key-value pairs you want to associate to your image. -
Replace
<share_server_id>with ID of your share server. -
Replace
<service_host>with the host server. -
Replace
<protocol>with the NAS protocol of the share, for example,nfs. -
Replace
<export_path>with the export path of the share.
-
Replace
Verify that the share is available:
openstack share show <name>
$ openstack share show <name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Unmanage a share:
openstack share abandon [--wait] <name>
$ openstack share abandon [--wait] <name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Exit the
openstackclientpod:exit
$ exitCopy to Clipboard Copied! Toggle word wrap Toggle overflow
To prevent system capacities from being exhausted without notification, you can configure quotas for the Shared File Systems service (manila). The Shared File Systems service enforces some default quotas, but you can override the default quotas so that individual projects have different consumption limits.
You can update the following quotas for all users in a project, a specific project user, or a share type that is used by the project users. You can only set share-type quotas at the project level. You cannot set share-type quotas for specific project users.
| Quota | Description |
|---|---|
|
| Number of shares you can create |
|
| Number of snapshots you can create |
|
| Total number of share groups you can create |
|
| Total number of share group snapshots you can create |
|
| Total number of share networks you can create |
|
| Total number of share replicas you can create |
|
| Total size in GB that you can allocate for all shares |
|
| Total size in GB that you can allocate for all snapshots of shares |
|
| Total size in GB that you can allocate across all share replicas |
You can view the quotas for a project, user, or share type in the Shared File Systems service (manila) by using the openstack share quota show command. The --user and --share-type command options are mutually exclusive.
-
If you include the
--useroption, you can view the quota for a user in the project. -
If you omit the
--useroption, you can view the quotas that apply to all users in the project. -
If you include the
--share-typeoption, you can view the quota for a specific share type in the project.
In the following procedure, enter the values carefully. The Shared File Systems service does not detect or report incorrect values.
Procedure
Access the remote shell for the
openstackclientpod from your workstation:oc rsh -n openstack openstackclient
$ oc rsh -n openstack openstackclientCopy to Clipboard Copied! Toggle word wrap Toggle overflow Use the following commands to view quotas:
View the quotas for a project:
openstack share quota show <af2838436f3f4cf6896399dd97c4c050>
$ openstack share quota show <af2838436f3f4cf6896399dd97c4c050>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<af2838436f3f4cf6896399dd97c4c050>with the project ID.
-
Replace
View the quotas for a project user:
openstack share quota show <af2838436f3f4cf6896399dd97c4c050> \ --user <81ebb491dd0e4c2aae0775dd564e76d1>
$ openstack share quota show <af2838436f3f4cf6896399dd97c4c050> \ --user <81ebb491dd0e4c2aae0775dd564e76d1>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<81ebb491dd0e4c2aae0775dd564e76d1>with the user ID.
-
Replace
View the quotas for a specific share type in a project:
openstack share quota show <af2838436f3f4cf6896399dd97c4c050> \ --share-type <dhss_false>
$ openstack share quota show <af2838436f3f4cf6896399dd97c4c050> \ --share-type <dhss_false>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<dhss_false>with the share type you want to check.
-
Replace
Exit the
openstackclientpod:exit
$ exitCopy to Clipboard Copied! Toggle word wrap Toggle overflow
You can update quotas for all project users, a specific project user, or a share type in a project by using the openstack share quota set command. You can only set share-type quotas at the project level, not for specific project users.
In the following procedure, enter the values carefully. The Shared File Systems service does not detect or report incorrect values.
Procedure
Access the remote shell for the
openstackclientpod from your workstation:oc rsh -n openstack openstackclient
$ oc rsh -n openstack openstackclientCopy to Clipboard Copied! Toggle word wrap Toggle overflow Use the following commands to update quotas:
Update quotas for all users in a project:
openstack share quota set <project_id> \ [--shares <share_quota> \ --gigabytes <gigabytes_quota> \ …]
$ openstack share quota set <project_id> \ [--shares <share_quota> \ --gigabytes <gigabytes_quota> \ …]Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<project_id>with the project ID. This value must be the project ID, not the project name. -
Replace
<share_quota>with the total number of shares you want to set as the quota for the project. -
Replace
<gigabytes_quota>with the total size in GB that you want to allocate for all shares in the project.
-
Replace
Update quotas for a specific user in a project:
openstack share quota set <project_id> \ --user <user_id> \ [--shares <share_quota> \ --gigabytes <gigabytes_quota> \ …]
$ openstack share quota set <project_id> \ --user <user_id> \ [--shares <share_quota> \ --gigabytes <gigabytes_quota> \ …]Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<user_id>with the user ID. The value must be the user ID, not the username. -
Replace
<share_quota>with the total number of shares you want to set as the quota for the user in the project. -
Replace
<gigabytes_quota>with the total size in GB that you want to allocate for the user’s shares in the project.
-
Replace
Update quotas for all users who use a specific share type:
openstack share quota set <project_id> \ --share-type <share_type> \ [--shares <share_quota> --gigabytes <gigabytes_quota> \ …]
$ openstack share quota set <project_id> \ --share-type <share_type> \ [--shares <share_quota> --gigabytes <gigabytes_quota> \ …]Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<share_type>with the share type you want to apply the quota to. -
Replace
<share_quota>with the total number of shares you want to set as the quota for the share type. -
Replace
<gigabytes_quota>with the total size in GB that you want to allocate for the shares that are that share type in the project.
-
Replace
Verification
-
The
openstack share quota setcommand does not produce any output. Use theopenstack share quota showcommand to verify that a quota was successfully updated. Exit the
openstackclientpod:exit
$ exitCopy to Clipboard Copied! Toggle word wrap Toggle overflow
You can remove quota overrides for projects, users, and share types in the Shared File Systems service (manila) to return quotas to their default values. Reset quotas to their default values by using the openstack share quota delete command.
In the following procedure, enter the values carefully. The Shared File Systems service does not detect or report incorrect values.
Procedure
Access the remote shell for the
openstackclientpod from your workstation:oc rsh -n openstack openstackclient
$ oc rsh -n openstack openstackclientCopy to Clipboard Copied! Toggle word wrap Toggle overflow Use the following commands to reset quotas:
Reset project quotas:
openstack share quota delete <project_id>
$ openstack share quota delete <project_id>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<project_id>with the project ID. This value must be the project ID, not the project name.
-
Replace
Reset quotas for a specific user:
openstack share quota delete <project_id> --user <user_id>
$ openstack share quota delete <project_id> --user <user_id>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<user_id>with the user ID. The value must be the user ID, not the user name.
-
Replace
Reset quotas for a share type that is used by project users:
openstack share quota delete <project_id> --share-type <share_type>
$ openstack share quota delete <project_id> --share-type <share_type>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<share_type>with the share type you want to reset.
-
Replace
Verification
-
The
openstack share quota deletecommand does not produce any output. Use theopenstack share quota showcommand to verify that a quota was successfully reset. List the default quotas for all projects. Default quotas apply to projects that have no overrides.
openstack share quota show <project> --defaults
$ openstack share quota show <project> --defaultsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Exit the
openstackclientpod:exit
$ exitCopy to Clipboard Copied! Toggle word wrap Toggle overflow
10.5.4. Updating the default quota values for projects 复制链接链接已复制到粘贴板!
You can update the default value of quotas that apply to the Shared File System service (manila) in all projects that do not already have quota overrides.
You can update the default values for any of the following quota options:
| Option | Description |
|---|---|
|
|
Adds a new value for the |
|
|
Adds a new value for the |
|
|
Adds a new value for the |
|
|
Adds a new value for the |
|
|
Adds a new value for the |
|
|
Adds a new value for the |
|
|
Adds a new value for the |
|
|
Adds a new value for the |
|
|
Adds a new value for the |
Procedure
Access the remote shell for the
openstackclientpod from your workstation:oc rsh -n openstack openstackclient
$ oc rsh -n openstack openstackclientCopy to Clipboard Copied! Toggle word wrap Toggle overflow View the usage statement of the
openstack share quota update --classcommand:openstack share quota set --class usage: openstack share quota update --class [--shares <shares>] [--snapshots <snapshots>] [--gigabytes <gigabytes>] [--snapshot-gigabytes <snapshot_gigabytes>] [--share-networks <share_networks>] [--share-replicas <share_replicas>] [--replica-gigabytes <replica_gigabytes>] <class_name>$ openstack share quota set --class usage: openstack share quota update --class [--shares <shares>] [--snapshots <snapshots>] [--gigabytes <gigabytes>] [--snapshot-gigabytes <snapshot_gigabytes>] [--share-networks <share_networks>] [--share-replicas <share_replicas>] [--replica-gigabytes <replica_gigabytes>] <class_name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe parameter
<class_name>is a positional argument. It identifies the quota class for which the quotas are set. Set the value of this parameter todefault. No other quota classes are supported.Use the information from the usage statement to update the default quotas. The following example updates the default quotas for
sharesandgigabytes:openstack share quota set --class default \ --shares 30 \ --gigabytes 512
$ openstack share quota set --class default \ --shares 30 \ --gigabytes 512Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
List the default quotas for all projects to verify that the default quota values have been reset:
openstack share quota show <project> --defaults
$ openstack share quota show <project> --defaultsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Exit the
openstackclientpod:exit
$ exitCopy to Clipboard Copied! Toggle word wrap Toggle overflow
10.6. Enabling Shared File Systems change notifications 复制链接链接已复制到粘贴板!
You can enable notifications in the Shared File Systems service (manila) for various events that occur during the share lifecycle. These notifications provide telemetry data that you can use for the following:
- Auditing, troubleshooting, and monitoring operations
- Integrating with other services such as Ceilometer for metrics collection and processing
The Shared File Systems service uses the RabbitMQ message broker software for notification delivery to a configured message queue.
To enable notifications in the Shared File Systems service, you add the notificationsBusInstance parameter to the manila template in your OpenStackControlPlane custom resource (CR) file. You use this parameter to specify the RabbitMQ instance name to use for requesting a transport URL.
You can turn off notifications by removing the notificationsBusInstance parameter from the manila template and updating the control plane.
Procedure
Open your
OpenStackControlPlaneCR file,openstack_control_plane.yaml, and add thenotificationsBusInstanceparameter to themanilatemplate:kind: OpenStackControlPlane spec: ... manila: template: ... notificationsBusInstance: rabbitmq customServiceConfig: | ...kind: OpenStackControlPlane spec: ... manila: template: ... notificationsBusInstance: rabbitmq customServiceConfig: | ...Copy to Clipboard Copied! Toggle word wrap Toggle overflow Update the control plane:
oc apply -f openstack_control_plane.yaml -n openstack
$ oc apply -f openstack_control_plane.yaml -n openstackCopy to Clipboard Copied! Toggle word wrap Toggle overflow Wait until Red Hat OpenShift Container Platform (RHOCP) creates the resources related to the
OpenStackControlPlaneCR. Run the following command to check the status:oc get openstackcontrolplane -n openstack
$ oc get openstackcontrolplane -n openstackCopy to Clipboard Copied! Toggle word wrap Toggle overflow The
OpenStackControlPlaneresources are created when the status is "Setup complete".TipAppend the
-woption to the end of thegetcommand to track deployment progress.