Chapter 7. 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. 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. 7.1. Creating 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 Access the remote shell for the OpenStackClient pod from your workstation: Run the following command to create a share type: Replace <driver_handles_share_servers> with true or false . 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: Exit the openstackclient pod: 7.2. Comparing share types You can create share types to define the capabilities of shares. The following table describes share types and their capabilities. Table 7.1. Share types Share type Values Description 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. 7.3. 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 Access the remote shell for the OpenStackClient pod from your workstation: Manage a share: 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. Verify that the share is available: Unmanage a share: Exit the openstackclient pod: 7.4. Changing the default quotas for projects, users, and share types 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. Table 7.2. Quotas Quota Description 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 7.4.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 Access the remote shell for the OpenStackClient pod from your workstation: Use the following commands to view quotas: View the quotas for a project: Replace <af2838436f3f4cf6896399dd97c4c050> with the project ID. View the quotas for a project user: Replace <81ebb491dd0e4c2aae0775dd564e76d1> with the user ID. View the quotas for a specific share type in a project: Replace <dhss_false> with the share type you want to check. Exit the openstackclient pod: 7.4.2. Updating quotas for projects, users, and share types 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 OpenStackClient pod from your workstation: Use the following commands to update quotas: Update quotas for all users in a project: 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: 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: 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 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. Exit the openstackclient pod: 7.4.3. Resetting quotas for projects, users, and share types 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 OpenStackClient pod from your workstation: Use the following commands to reset quotas: Reset project quotas: Replace <project_id> with the project ID. This value must be the project ID, not the project name. Reset quotas for a specific user: 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: Replace <share_type> with the share type you want to reset. Verification 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. List the default quotas for all projects. Default quotas apply to projects that have no overrides. Exit the openstackclient pod: 7.4.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: Table 7.3. Quota options Option Description --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 Access the remote shell for the OpenStackClient pod from your workstation: View the usage statement of the openstack share quota update --class command: 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. Use the information from the usage statement to update the default quotas. The following example updates the default quotas for shares and gigabytes : Verification List the default quotas for all projects to verify that the default quota values have been reset: Exit the openstackclient pod:

Commands:
oc rsh -n openstack openstackclient
openstack share type create default <driver_handles_share_servers>
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'
exit
oc rsh -n openstack openstackclient
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 show <name>
openstack share abandon [--wait] <name>
exit
oc rsh -n openstack openstackclient
openstack share quota show <af2838436f3f4cf6896399dd97c4c050>
openstack share quota show <af2838436f3f4cf6896399dd97c4c050> --user <81ebb491dd0e4c2aae0775dd564e76d1>
openstack share quota show <af2838436f3f4cf6896399dd97c4c050> --share-type <dhss_false>
exit
oc rsh -n openstack openstackclient
openstack share quota set <project_id> [--shares <share_quota> --gigabytes <gigabytes_quota> ...]
openstack share quota set <project_id> --user <user_id> [--shares <share_quota> --gigabytes <gigabytes_quota> ...]
openstack share quota set <project_id> --share-type <share_type> [--shares <share_quota> --gigabytes <gigabytes_quota> ...]
exit
oc rsh -n openstack openstackclient
openstack share quota delete <project_id>
openstack share quota delete <project_id> --user <user_id>
openstack share quota delete <project_id> --share-type <share_type>
openstack share quota show <project> --defaults
exit
oc rsh -n openstack openstackclient
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 default --shares 30 --gigabytes 512
openstack share quota show <project> --defaults
exit