Chapter 2. Deploying using local storage devices

Deploying OpenShift Container Storage on OpenShift Container Platform using local storage devices provides you with the option to create internal cluster resources. This will result in the internal provisioning of the base services, which helps to make additional storage classes available to applications.

Use this section to deploy OpenShift Container Storage on VMware where OpenShift Container Platform is already installed.

2.1. Overview of deploying with internal local storage

To deploy Red Hat OpenShift Container Storage using local storage, follow these steps:

2.2. Requirements for installing OpenShift Container Storage using local storage devices

  • You must upgrade to a latest version of OpenShift Container Platform 4.6 before deploying OpenShift Container Storage 4.6. For information, see Updating OpenShift Container Platform clusters guide.
  • The Local Storage Operator version must match the Red Hat OpenShift Container Platform version in order to have the Local Storage Operator fully supported with Red Hat OpenShift Container Storage. The Local Storage Operator does not get upgraded when Red Hat OpenShift Container Platform is upgraded.
  • You must have at least three OpenShift Container Platform worker nodes in the cluster with locally attached storage devices on each of them.

    • Each of the three selected nodes must have at least one raw block device available to be used by OpenShift Container Storage.
    • The devices you use must be empty; the disks must not include physical volumes (PVs), volume groups (VGs), or logical volumes (LVs) remaining on the disk.

2.3. Enabling file system access for containers on Red Hat Enterprise Linux based nodes

Deploying OpenShift Container Storage on an OpenShift Container Platform with worker nodes on a Red Hat Enterprise Linux base in a user provisioned infrastructure (UPI) does not automatically provide container access to the underlying Ceph file system.

Note

This process is not necessary for hosts based on Red Hat Enterprise Linux CoreOS.

Procedure

Perform the following steps on each node in your cluster.

  1. Log in to the Red Hat Enterprise Linux based node and open a terminal.
  2. Verify that the node has access to the rhel-7-server-extras-rpms repository.

    # subscription-manager repos --list-enabled | grep rhel-7-server

    If you do not see both rhel-7-server-rpms and rhel-7-server-extras-rpms in the output, or if there is no output, run the following commands to enable each repository.

    # subscription-manager repos --enable=rhel-7-server-rpms
    # subscription-manager repos --enable=rhel-7-server-extras-rpms
  3. Install the required packages.

    # yum install -y policycoreutils container-selinux
  4. Persistently enable container use of the Ceph file system in SELinux.

    # setsebool -P container_use_cephfs on

2.4. Installing Red Hat OpenShift Container Storage Operator

You can install Red Hat OpenShift Container Storage Operator using the Red Hat OpenShift Container Platform Operator Hub. For information about the hardware and software requirements, see Planning your deployment.

Prerequisites

  • You must be logged into the OpenShift Container Platform (RHOCP) cluster.
  • You must have at least three worker nodes in the RHOCP cluster.
Note
  • When you need to override the cluster-wide default node selector for OpenShift Container Storage, you can use the following command in command line interface to specify a blank node selector for the openshift-storage namespace:

    $ oc annotate namespace openshift-storage openshift.io/node-selector=
  • Taint a node as infra to ensure only Red Hat OpenShift Container Storage resources are scheduled on that node. This helps you save on subscription costs. For more information, see How to use dedicated worker nodes for Red Hat OpenShift Container Storage chapter in Managing and Allocating Storage Resources guide.

Procedure

  1. Click Operators → OperatorHub in the left pane of the OpenShift Web Console.
  2. Use Filter by keyword text box or the filter list to search for OpenShift Container Storage from the list of operators.
  3. Click OpenShift Container Storage.
  4. On the OpenShift Container Storage operator page, click Install.
  5. On the Install Operator page, ensure the following options are selected by default::

    1. Update Channel as stable-4.6
    2. Installation Mode as A specific namespace on the cluster
    3. Installed Namespace as Operator recommended namespace openshift-storage. If Namespace openshift-storage does not exist, it will be created during the operator installation.
    4. Select Enable operator recommended cluster monitoring on this namespace checkbox as this is required for cluster monitoring.
    5. Select Approval Strategy as Automatic or Manual. Approval Strategy is set to Automatic by default.

      • Approval Strategy as Automatic.

        Note

        When you select the Approval Strategy as Automatic, approval is not required either during fresh installation or when updating to the latest version of OpenShift Container Storage.

        1. Click Install
        2. Wait for the install to initiate. This may take up to 20 minutes.
        3. Click Operators → Installed Operators
        4. Ensure the Project is openshift-storage. By default, the Project is openshift-storage.
        5. Wait for the Status of OpenShift Container Storage to change to Succeeded.
      • Approval Strategy as Manual.

        Note

        When you select the Approval Strategy as Manual, approval is required during fresh installation or when updating to the latest version of OpenShift Container Storage.

        1. Click Install
        2. On the Manual approval required page, you can either click Approve or View Installed Operators in namespace openshift-storage to install the operator.

          Important

          Before you click either of the options, wait for a few minutes on the Manual approval required page until the install plan gets loaded in the window.

          Important

          If you choose to click Approve, you must review the install plan before you proceed.

          • If you click Approve.

            • Wait for a few minutes while the OpenShift Container Storage Operator is getting installed.
            • On the Installed operator - ready for use page, click View Operator.
            • Ensure the Project is openshift-storage. By default, the Project is openshift-storage.
            • Click Operators → Installed Operators
            • Wait for the Status of OpenShift Container Storage to change to Succeeded.
          • If you click View Installed Operators in namespace openshift-storage .

            • On the Installed Operators page, click ocs-operator.
            • On the Subscription Details page, click the Install Plan link.
            • On the InstallPlan Details page, click Preview Install Plan.
            • Review the install plan and click Approve.
            • Wait for the Status of the Components to change from Unknown to either Created or Present.
            • Click Operators → Installed Operators
            • Ensure the Project is openshift-storage. By default, the Project is openshift-storage.
            • Wait for the Status of OpenShift Container Storage to change to Succeeded.

Verification steps

  • Verify that OpenShift Container Storage Operator shows a green tick indicating successful installation.
  • Click View Installed Operators in namespace openshift-storage link to verify that OpenShift Container Storage Operator shows the Status as Succeeded on the Installed Operators dashboard.

2.5. Installing Local Storage Operator

Use this procedure to install the Local Storage Operator from the Operator Hub before creating OpenShift Container Storage clusters on local storage devices.

Procedure

  1. Log in to the OpenShift Web Console.
  2. Click Operators → OperatorHub.
  3. Search for Local Storage Operator from the list of operators and click on it.
  4. Click Install.

    Figure 2.1. Install Operator page

    Screenshot of Install Operator page.
  5. Set the following options on the Install Operator page:

    1. Update Channel as 4.6
    2. Installation Mode as A specific namespace on the cluster
    3. Installed Namespace as Operator recommended namespace openshift-local-storage.
    4. Approval Strategy as Automatic
  6. Click Install.
  7. Verify that the Local Storage Operator shows the Status as Succeeded.

2.6. Creating OpenShift Container Storage cluster on VMware

Use this procedure to create storage cluster on VMware infrastructure when a storage class does not exist.

If you already have a storage class created, you can directly create a storage cluster as described in Creating a storage cluster on VMware when a storage class exists section.

VMware supports the following three types of local storage:

  • Virtual machine disk (VMDK)
  • Raw device mapping (RDM)
  • VMDirectPath I/O

Prerequisites

Procedure

  1. Log into the OpenShift Web Console.
  2. Click Operators → Installed Operators to view all the installed operators.

    Ensure that the Project selected is openshift-storage.

    Figure 2.2. OpenShift Container Storage Operator page

    Screenshot of OpenShift Container Storage operator dashboard.
  3. Click OpenShift Container Storage.

    Figure 2.3. Details tab of OpenShift Container Storage

    Screenshot of selected operator details tab.
  4. Click Create Instance link of Storage Cluster.

    Figure 2.4. Create Storage Cluster page

    Screenshot of Create Storage Cluster page
  5. Select Internal-Attached devices for the Select Mode. By default, Internal is selected.
  6. Create a storage cluster using the wizard that includes disk discovery, storage class creation, and storage cluster creation.

    You are prompted to install the Local Storage Operator if it is not already installed. Click Install and install the operator as described in Installing Local Storage Operator.

    Discover Disks

    You can discover a list of potentially usable disks on the selected nodes. Block disks and partitions that are not in use and available for provisioning persistent volumes (PVs) are discovered.

    Figure 2.5. Discovery Disks wizard page

    Screenshot of discovering disks in select nodes.
    1. Choose one of the following:

      • All nodes to discover disks in all the nodes.
      • Select nodes to discover disks from a subset of the listed nodes.

        To find specific worker nodes in the cluster, you can filter nodes on the basis of Name or Label. Name allows you to search by name of the node and Label allows you to search by selecting the predefined label.

        If the nodes selected do not match the OpenShift Container Storage cluster requirement of an aggregated 30 CPUs and 72 GiB of RAM, a minimal cluster will be deployed. For minimum starting node requirements, see Resource requirements section in Planning guide.

        Note

        If the nodes to be selected are tainted and not discovered in the wizard, follow the steps provided in the Red Hat Knowledgebase Solution as a workaround.

    2. Click Next.
    Create Storage Class

    You can create a dedicated storage class to consume storage by filtering a set of storage volumes.

    Figure 2.6. Create Storage Class wizard page

    Screenshot of entering the storage class details.
    1. Enter the Volume Set Name.
    2. Enter the Storage Class Name. By default, the volume set name appears for the storage class name.
    3. The nodes selected for disk discovery in the earlier step are displayed in the Filter Disks section. Choose one of the following:

      • All nodes to select all the nodes for which you discovered the available disks.
      • Select nodes to choose a subset of the nodes for which you discovered the available disks.

        To find specific worker nodes in the cluster, you can filter nodes on the basis of Name or Label. Name allows you to search by name of the node and Label allows you to search by selecting the predefined label.

        It is recommended that the worker nodes are spread across three different physical nodes, racks or failure domains for high availability.

        Note

        Ensure OpenShift Container Storage rack labels are aligned with physical racks in the datacenter to prevent a double node failure at the failure domain level.

    4. Select the required Disk Type. The following options are available:

      All

      Selects all types of disks present on the nodes. By default, this option is selected.

      SSD/NVME

      Selects only SSD or NVME type of disks.

      HDD

      Selects only HDD type of disks.

      Note

      If the SSD/NVME disks are detected as HDD due to the underlying abstraction of storage, select the disk type as All or HDD. For example, local storage device as VMDK.

    5. In the Advanced section, you can set the following:

      Disk Mode

      Block is selected by default.

      Disk Size

      Minimum and maximum avaialable size of the device that needs to be included.

      Note

      You must set a minimum size of 100GB for the device.

      Max Disk Limit

      This indicates the maximum number of PVs that can be created on a node. If this field is left empty, then PVs are created for all the available disks on the matching nodes.

    6. (Optional) You can view the selected capacity of the disks on the selected nodes using the Select Capacity chart.

      This chart might take a few minutes to reflect the disks that are discovered in the previous step.

      You can click on the Nodes and Disks links on the chart to bring up the list of nodes and disks to view more details.

      Figure 2.7. List of selected nodes

      Screenshot of list of nodes displayed from the selected capacity chart.

      Figure 2.8. List of selected disks

      Screenshot of list of disks displayed from the selected capacity chart.
    7. Click Next.
    8. Click Yes in the message alert to confirm the creation of the storage class.

      After the local volume set and storage class are created, it is not possible to go back to the step.

    Create Storage Cluster

    Figure 2.9. Create Storage Cluster wizard page

    Screenshot of storage cluster creation.
    1. Select the required storage class.

      You might need to wait a couple of minutes for the storage nodes corresponding to the selected storage class to get populated.

    2. (Optional) In the Encryption section, set the toggle to Enabled to enable data encryption on the cluster.
    3. The nodes corresponding to the storage class are displayed based on the storage class that you selected from the drop down list.
    4. Click Create.

      The Create button is enabled only when a minimum of three nodes are selected. A new storage cluster of three volumes will be created with one volume per worker node. The default configuration uses a replication factor of 3.

To expand the capacity of the initial cluster, see Scaling Storage guide.

2.7. Creating a storage cluster on VMware when a storage class exists

You can create a Openshift Container Storage Cluster using the existing storage class that is created through the Local Storage Operator page.

Prerequisites

  • Ensure that all the requirements in the Requirements for installing OpenShift Container Storage using local storage devices section are met.
  • You must have a minimum of three worker nodes with the same storage type and size attached to each node (for example, 2TB NVMe hard drive) to use local storage devices on bare metal.
  • You must have created a storage class that consists of a minimum of three nodes and volume attached to it.

Procedure

  1. Log into the OpenShift Web Console.
  2. Click Operators → Installed Operators to view all the installed operators.

    Ensure that the Project selected is openshift-storage.

    Figure 2.10. OpenShift Container Storage Operator page

    Screenshot of OpenShift Container Storage operator dashboard.
  3. Click OpenShift Container Storage.

    Figure 2.11. Details tab of OpenShift Container Storage

    Screenshot of selected operator details tab.
  4. Click Create Instance link of Storage Cluster.

    Figure 2.12. Create Storage Cluster page

    Screenshot of Create Cluster Service page
  5. Select Internal-Attached devices for the Select Mode. By default, Internal is selected.

    Figure 2.13. Create Storage Cluster page

    Screenshot of storage cluster creation page.
  6. (Optional) In the Encryption section, set the toggle to Enabled to enable data encryption on the cluster.
  7. The nodes corresponding to the selected storage class are displayed.

    The selected nodes are labeled with cluster.ocs.openshift.io/openshift-storage=’’ if they are not already labeled. Three of the selected nodes are used for initial deployment and the remaining nodes are used as the scheduling targets for OpenShift Container Storage scaling.

  8. Click Create.

    The Create button is enabled only when a minimum of three nodes are selected.

    A new storage cluster of three volumes will be created with one volume per worker node. The default configuration uses a replication factor of 3.

To expand the capacity of the initial cluster, see Scaling Storage guide.