This is a cache of https://docs.openshift.com/container-platform/4.5/storage/container_storage_interface/persistent-storage-csi-manila.html. It is a snapshot of the page at 2024-11-28T00:20:56.044+0000.
OpenStack Manila CSI Driver Operator - Using Container Storage Interface (CSI) | Storage | OpenShift Container Platform 4.5
×

Overview

OpenShift Container Platform is capable of provisioning persistent volumes (PVs) using the Container Storage Interface (CSI) driver for the OpenStack Manila shared file system service.

Before PVCs can be created, you must install the Manila CSI Driver Operator. The Operator creates the required storage classes for all available Manila share types needed for dynamic provisioning.

After the Operator is installed, you must also create the ManilaDriver Custom Resource (CR) that is required in the OpenShift Container Platform cluster.

Installing the Manila CSI Driver Operator

The Manila Container Storage Interface (CSI) Driver Operator is not installed in OpenShift Container Platform by default. Use the following procedure to install and configure this Operator to enable the OpenStack Manila CSI driver in your cluster.

Prerequisites
  • You have access to the OpenShift Container Platform web console.

  • The underlying Red Hat OpenStack Platform (RHOSP) infrastructure cloud deploys Manila serving NFS shares.

Procedure

To install the Manila CSI Driver Operator from the web console, follow these steps:

  1. Log in to the OpenShift Container Platform web console.

  2. Navigate to OperatorsOperatorHub.

  3. Type Manila CSI Driver Operator into the filter box to locate the Operator.

  4. click Install.

  5. On the Install Operator page, select openshift-manila-csi-driver-operator from the Installed Namespace drop-down menu.

  6. Adjust the values for Update Channel and Approval Strategy to the values that you want. The only supported Installation Mode is All namespaces on the cluster.

  7. click Install.

Once finished, the Manila CSI Driver Operator is listed in the Installed Operators section of the web console.

Installing the OpenStack Manila CSI driver

The OpenStack Manila Container Storage Interface (CSI) driver is a custom resource (CR) that enables you to create and mount OpenStack Manila shares. It also supports creating snapshots, and recovering shares from snapshots.

The driver is not installed in OpenShift Container Platform by default, and must be installed after the Manila CSI Driver Operator has been installed.

Prerequisites
  • The Manila CSI Driver Operator has been installed.

  • Access to the OpenShift Container Platform web console or command-line interface (cli).

UI procedure

To install the Manila CSI driver from the web console, complete the following steps:

  1. Log in to the OpenShift Container Platform web console.

  2. Navigate to OperatorsInstalled Operators.

  3. Locate the Manila CSI Driver Operator from the list and click on the Operator link.

  4. Create the driver:

    1. From the Details tab, click Create Instance.

    2. Optional: Select YAML view to make modifications, such as adding notations, to the ManilaDriver object template.

    3. click Create to finalize.

      Renaming the cluster and specifying a certain namespace are not supported functions.

cli procedure

To install the Manila CSI driver from the cli, complete the following steps:

  1. Create an object YAML file, such as maniladriver.yaml, to define the ManilaDriver:

    Example maniladriver
      apiVersion: csi.openshift.io/v1alpha1
      kind: ManilaDriver
      metadata:
        name: cluster (1)
    1 Renaming the cluster and specifying a certain namespace are not supported functions.
  2. Create the ManilaDriver CR object in your OpenShift Container Platform cluster by specifying the file you created in the previous step:

    $ oc create -f maniladriver.yaml

When the Operator installation is finished, the Manila CSI driver is deployed on OpenShift Container Platform for dynamic provisioning of RWX persistent volumes on Red Hat OpenStack Platform (RHOSP).

Verification
  1. Verify that the ManilaDriver CR was created successfully by entering the following command:

    $ oc get all -n openshift-manila-csi-driver
    Example output
    NAME                                                              READY   STATUS    RESTARTS   AGE
    pod/csi-nodeplugin-nfsplugin-lzvpm                                1/1     Running   0          18h
    pod/csi-nodeplugin-nfsplugin-slvg2                                1/1     Running   0          18h
    pod/csi-nodeplugin-nfsplugin-xmps9                                1/1     Running   0          18h
    pod/openstack-manila-csi-controllerplugin-7d4f5d985b-mw4x5        3/3     Running   0          17h
    pod/openstack-manila-csi-nodeplugin-6xchs                         2/2     Running   0          18h
    pod/openstack-manila-csi-nodeplugin-bkcmz                         2/2     Running   0          18h
    pod/openstack-manila-csi-nodeplugin-rlpps                         2/2     Running   0          18h
    
    NAME                                                              DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
    daemonset.apps/csi-nodeplugin-nfsplugin                           3       3       3     3          3                       18h
    daemonset.apps/openstack-manila-csi-nodeplugin                    3       3       3     3          3                       18h
    
    NAME                                                              READY UP-TO-DATE AVAILABLE AGE
    deployment.apps/openstack-manila-csi-controllerplugin             1/1   1          1         18h
    
    NAME                                                              DESIRED CURRENT READY AGE
    replicaset.apps/openstack-manila-csi-controllerplugin-7d4f5d985b  1       1       1     17h
    
  2. Verify that the storage class was created successfully by entering the following command:

    $ oc get storageclasses | grep -E "NAME|csi-manila-"
    Example output
    NAME              PROVISIONER               RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION  AGE
    csi-manila-gold   manila.csi.openstack.org  Delete          Immediate           false                 18h

Dynamically provisioning Manila CSI volumes

OpenShift Container Platform installs a StorageClass for each available Manila share type.

The YAML files that are created are completely decoupled from Manila and from its Container Storage Interface (CSI) plug-in. As an application developer, you can dynamically provision ReadWriteMany (RWX) storage and deploy Pods with applications that safely consume the storage using YAML manifests. You can also provision other access modes, such as ReadWriteOnce (RWO).

You can use the same Pod and persistent volume claim (PVC) definitions on-premise that you use with OpenShift Container Platform on AWS, GCP, Azure, and other platforms, with the exception of the storage class reference in the PVC definition.

Prerequisites
  • Red Hat OpenStack Platform (RHOSP) is deployed with appropriate Manila share infrastructure so that it can be used to dynamically provision and mount volumes in OpenShift Container Platform.

Procedure (UI)

To dynamically create a Manila CSI volume using the web console:

  1. In the OpenShift Container Platform console, click StoragePersistent Volume Claims.

  2. In the persistent volume claims overview, click Create Persistent Volume Claim.

  3. Define the required options on the resulting page.

    1. Select the appropriate StorageClass.

    2. Enter a unique name for the storage claim.

    3. Select the access mode to specify read and write access for the PVC you are creating.

      • Use RWX if you want the persistent volume (PV) that fulfills this PVC to be mounted to multiple Pods on multiple nodes in the cluster.

      • Use RWO mode if you want to prevent additional Pods from being dynamically provisioned.

  4. Define the size of the storage claim.

  5. click Create to create the persistent volume claim and generate a persistent volume.

Procedure (cli)

To dynamically create a Manila CSI volume using the command-line interface (cli):

  1. Create and save a file with the PersistentVolumeClaim object described by the following YAML:

    pvc-manila.yaml
    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: pvc-manila
    spec:
      accessModes: (1)
        - ReadWriteMany
      resources:
        requests:
      	storage: 10Gi
      storageClassName: csi-manila-gold (2)
    1 Use RWX if you want the persistent volume (PV) that fulfills this PVC to be mounted to multiple Pods on multiple nodes in the cluster. Use ReadWriteOnce (RWO) mode to prevent additional Pods from being dynamically provisioned.
    2 The name of the storage class that provisions the storage back end. Manila StorageClasses are provisioned by the Operator and have the csi-manila- prefix.
  2. Create the object you saved in the previous step by running the following command:

    $ oc create -f pvc-manila.yaml

    A new PVC is created.

  3. To verify that the volume was created and is ready, run the following command:

    $ oc get pvc pvc-manila

    The pvc-manila shows that it is Bound.

You can now use the new PVC to configure a Pod.

Uninstalling the Manila CSI Driver Operator

Before you uninstall the Manila Container Storage Interface (CSI) Driver Operator, you must delete all persistent volume claims (PVCs) that are in use by the Operator.

Prerequisites
  • Access to the OpenShift Container Platform web console.

Procedure

To uninstall the Manila CSI Driver Operator from the web console:

  1. Log in to the web console.

  2. Navigate to StoragePersistent Volume Claims.

  3. Select any PVCs that are in use by the Manila CSI Driver Operator and click Delete.

  4. From the OperatorsInstalled Operators page, scroll or type Manila CSI into the Filter by name field to find the Operator. Then, click on it.

  5. On the right-hand side of the Installed Operators details page, select Uninstall Operator from the Actions drop-down menu.

  6. When prompted by the Uninstall Operator window, click the Uninstall button to remove the Operator from the namespace. Any applications deployed by the Operator on the cluster will need to be cleaned up manually.

Once finished, the Manila CSI Driver Operator is no longer listed in the Installed Operators section of the web console.

Additional resources