此内容没有您所选择的语言版本。

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 oc command 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-admin privileges.
  • 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 true or false, based on the custom resource (CR) configuration.

Procedure

  1. Access the remote shell for the openstackclient pod from your workstation:

    $ oc rsh -n openstack openstackclient
    Copy to Clipboard Toggle word wrap
  2. Run the following command to create a share type:

    $ openstack share type create default <driver_handles_share_servers>
    Copy to Clipboard Toggle word wrap
    • Replace <driver_handles_share_servers> with true or false.
  3. 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=true back 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'
    Copy to Clipboard Toggle word wrap
  4. Exit the openstackclient pod:

    $ exit
    Copy to Clipboard Toggle word wrap

You can create share types to define the capabilities of shares. The following table describes share types and their capabilities.

Expand
Table 10.1. Share types
Share typeValuesDescription

driver_handles_share_servers

true or false

Grants permission to use share networks to create shares.

snapshot_support

true or false

Grants permission to create snapshots of shares.

create_share_from_snapshot_support

true or false

Grants permission to create clones of share snapshots.

revert_to_snapshot_support

true or false

Grants permission to revert your shares to the most recent snapshot.

mount_snapshot_support

true or false

Grants permission to export and mount your snapshots.

replication_type

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.

availability_zones

a list of one or more availability zones

Grants permission to create shares only on the availability zones listed.

10.4. Adding and removing shares by using manage/unmanage

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

  1. Access the remote shell for the openstackclient pod from your workstation:

    $ oc rsh -n openstack openstackclient
    Copy to Clipboard Toggle word wrap
  2. 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>
    Copy to Clipboard Toggle word wrap
    • 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.
  3. Verify that the share is available:

    $ openstack share show <name>
    Copy to Clipboard Toggle word wrap
  4. Unmanage a share:

    $ openstack share abandon [--wait] <name>
    Copy to Clipboard Toggle word wrap
  5. Exit the openstackclient pod:

    $ exit
    Copy to Clipboard Toggle word wrap

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.

Expand
Table 10.2. Quotas
QuotaDescription

shares

Number of shares you can create

snapshots

Number of snapshots you can create

share-groups

Total number of share groups you can create

share-group-snapshots

Total number of share group snapshots you can create

share-networks

Total number of share networks you can create

share-replicas

Total number of share replicas you can create

gigabytes

Total size in GB that you can allocate for all shares

snapshot-gigabytes

Total size in GB that you can allocate for all snapshots of shares

replica-gigabytes

Total size in GB that you can allocate across all share replicas

10.5.1. Viewing quotas for projects, users, and share types

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 --user option, you can view the quota for a user in the project.
  • If you omit the --user option, you can view the quotas that apply to all users in the project.
  • If you include the --share-type option, 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

  1. Access the remote shell for the openstackclient pod from your workstation:

    $ oc rsh -n openstack openstackclient
    Copy to Clipboard Toggle word wrap
  2. Use the following commands to view quotas:

    • View the quotas for a project:

      $ openstack share quota show <af2838436f3f4cf6896399dd97c4c050>
      Copy to Clipboard Toggle word wrap
      • Replace <af2838436f3f4cf6896399dd97c4c050> with the project ID.
    • View the quotas for a project user:

      $ openstack share quota show <af2838436f3f4cf6896399dd97c4c050> \
        --user <81ebb491dd0e4c2aae0775dd564e76d1>
      Copy to Clipboard Toggle word wrap
      • Replace <81ebb491dd0e4c2aae0775dd564e76d1> with the user ID.
    • View the quotas for a specific share type in a project:

      $ openstack share quota show <af2838436f3f4cf6896399dd97c4c050> \
        --share-type <dhss_false>
      Copy to Clipboard Toggle word wrap
      • Replace <dhss_false> with the share type you want to check.
  3. Exit the openstackclient pod:

    $ exit
    Copy to Clipboard Toggle word wrap

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

  1. Access the remote shell for the openstackclient pod from your workstation:

    $ oc rsh -n openstack openstackclient
    Copy to Clipboard Toggle word wrap
  2. 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> \
        …]
      Copy to Clipboard Toggle word wrap
      • 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.
    • Update quotas for a specific user in a project:

      $ openstack share quota set <project_id> \
        --user <user_id> \
        [--shares <share_quota> \
        --gigabytes <gigabytes_quota> \
        …]
      Copy to Clipboard Toggle word wrap
      • 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.
    • 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> \
        …]
      Copy to Clipboard Toggle word wrap
      • 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.

Verification

  1. The openstack share quota set command does not produce any output. Use the openstack share quota show command to verify that a quota was successfully updated.
  2. Exit the openstackclient pod:

    $ exit
    Copy to Clipboard Toggle word wrap

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

  1. Access the remote shell for the openstackclient pod from your workstation:

    $ oc rsh -n openstack openstackclient
    Copy to Clipboard Toggle word wrap
  2. Use the following commands to reset quotas:

    • Reset project quotas:

      $ openstack share quota delete <project_id>
      Copy to Clipboard Toggle word wrap
      • Replace <project_id> with the project ID. This value must be the project ID, not the project name.
    • Reset quotas for a specific user:

      $ openstack share quota delete <project_id> --user <user_id>
      Copy to Clipboard Toggle word wrap
      • Replace <user_id> with the user ID. The value must be the user ID, not the user name.
    • Reset quotas for a share type that is used by project users:

      $ openstack share quota delete <project_id> --share-type <share_type>
      Copy to Clipboard Toggle word wrap
      • Replace <share_type> with the share type you want to reset.

Verification

  1. The openstack share quota delete command does not produce any output. Use the openstack share quota show command to verify that a quota was successfully reset.
  2. List the default quotas for all projects. Default quotas apply to projects that have no overrides.

    $ openstack share quota show <project> --defaults
    Copy to Clipboard Toggle word wrap
  3. Exit the openstackclient pod:

    $ exit
    Copy to Clipboard Toggle word wrap

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:

Expand
Table 10.3. Quota options
OptionDescription

--shares <shares>

Adds a new value for the shares quota

--snapshots <snapshots>

Adds a new value for the snapshots quota

--share-groups <share_groups>

Adds a new value for the share-groups quota

--share-group-snapshots <share_group_snapshots

Adds a new value for the share-group-snapshots quota

--share-networks <share_networks>

Adds a new value for the share-networks quota.

--share-replicas <share_replicas>

Adds a new value for the share-replicas quota

--gigabytes <gigabytes>

Adds a new value for the gigabytes quota

--snapshot-gigabytes <snapshot_gigabytes>

Adds a new value for the snapshot-gigabytes quota

--replica-gigabytes <replica_gigabytes>

Adds a new value for the replica-gigabytes quota

Procedure

  1. Access the remote shell for the openstackclient pod from your workstation:

    $ oc rsh -n openstack openstackclient
    Copy to Clipboard Toggle word wrap
  2. View the usage statement of the openstack share quota update --class command:

    $ 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 Toggle word wrap
    Note

    The parameter <class_name> is a positional argument. It identifies the quota class for which the quotas are set. Set the value of this parameter to default. No other quota classes are supported.

  3. Use the information from the usage statement to update the default quotas. The following example updates the default quotas for shares and gigabytes:

    $ openstack share quota set --class default \
      --shares 30 \
      --gigabytes 512
    Copy to Clipboard Toggle word wrap

Verification

  1. List the default quotas for all projects to verify that the default quota values have been reset:

    $ openstack share quota show <project> --defaults
    Copy to Clipboard Toggle word wrap
  2. Exit the openstackclient pod:

    $ exit
    Copy to Clipboard Toggle word wrap

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

  1. Open your OpenStackControlPlane CR file, openstack_control_plane.yaml, and add the notificationsBusInstance parameter to the manila template:

    kind: OpenStackControlPlane
    spec:
      ...
      manila:
        template:
          ...
          notificationsBusInstance: rabbitmq
          customServiceConfig: |
    ...
    Copy to Clipboard Toggle word wrap
  2. Update the control plane:

    $ oc apply -f openstack_control_plane.yaml -n openstack
    Copy to Clipboard Toggle word wrap
  3. Wait until Red Hat OpenShift Container Platform (RHOCP) creates the resources related to the OpenStackControlPlane CR. Run the following command to check the status:

    $ oc get openstackcontrolplane -n openstack
    Copy to Clipboard Toggle word wrap

    The OpenStackControlPlane resources are created when the status is "Setup complete".

    Tip

    Append the -w option to the end of the get command to track deployment progress.

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部