Setting up storage for OpenShift Virtualization

Virtual Private Cloud 4.17 and later Bare metal worker nodes only RHCOS only

OpenShift Virtualization requires storage that supports ReadWriteMany (RWX) access mode for VM disks, live migration, and snapshots. You can use OpenShift Data Foundation (ODF) or File Storage for VPC as your storage solution.

OpenShift Virtualization Service includes pre-configured storage - no manual setup required.

Before you begin

Your cluster must have exactly one properly configured storage solution before installing OpenShift Virtualization.

Setting up OpenShift Data Foundation

OpenShift Data Foundation (ODF) is recommended for production workloads that require high performance, snapshots, and cloning capabilities.

This section applies only to manual OpenShift Virtualization deployments. If you're using OpenShift Virtualization Service, ODF is pre-configured and you don't need to follow these steps.

Prerequisites for ODF

Bare metal worker nodes with local NVME storage
Use flavors with the d suffix that include local NVME disks.
Worker node requirements
ODF requires at least 3 worker nodes for high availability and data redundancy.
Zone configuration
  • OpenShift Virtualization deployments: Single-zone clusters are recommended to minimize storage latency for VM workloads. While multi-zone deployments provide better high availability, cross-zone storage replication can impact VM performance.
  • General ODF deployments: At least 3 zones are recommended for high availability and disaster recovery.

Installing ODF from the console

  1. Log in to your IBM Cloud account and navigate to your cluster.

  2. Click Add-ons in the cluster navigation.

  3. On the OpenShift Data Foundation card, click Install.

  4. Select the Local Storage option.

    Remote block volume attachment is not supported for VPC bare metal nodes.

  5. Choose one of the following discovery methods:

    Automatic discovery (recommended)
    Select Automatic discovery to automatically detect and use available disks on your bare metal worker nodes.
    Manual disk specification
    If you prefer to specify disks manually, follow these steps:
    1. Log in to each worker node to identify available disks.
      oc debug node/<node-name>
      
    2. Allow host binaries.
      chroot /host
      
    3. List available devices.
      lsblk
      
    4. Find the by-id for each disk.
      ls -l /dev/disk/by-id/
      
    5. Add the disk IDs in the OSD pod disk IDs parameter.
  6. Configure additional parameters as needed:

    • Resource profile: Choose balanced or performance based on your workload
    • Encryption: Enable encryption with Hyper Protect Crypto Services if required
    • Number of OSD disks: Specify the number of disks per worker node
  7. Click Install to deploy ODF.

For more information about ODF parameters, see OpenShift Data Foundation parameter reference.

Installing ODF from the CLI

  1. Review the available add-on options.
    ibmcloud oc cluster addon options --addon openshift-data-foundation --version 4.20.0
    
  2. Enable the OpenShift Data Foundation add-on with automatic disk discovery and virtualization support.
    ibmcloud oc cluster addon enable openshift-data-foundation \
      -c <cluster-name> \
      --version 4.20.0 \
      --param "odfDeploy=true" \
      --param "osdStorageClassName=localblock" \
      --param "autoDiscoverDevices=true" \
      --param "resourceProfile=performance" \
      --param "setDefaultStorageClassForVirtualization=true"
    
  3. Verify the add-on is in a Ready state.
    oc get storagecluster -n openshift-storage
    
    Example output:
    NAME                 AGE   PHASE   EXTERNAL   CREATED AT             VERSION
    ocs-storagecluster   53m   Ready              2025-03-10T12:20:52Z   4.20.0
    

Verifying ODF installation

  1. Check the storage cluster status.
    oc get storagecluster -n openshift-storage
    
  2. Verify that storage classes are available.
    oc get storageclass | grep ocs
    
  3. Confirm that ODF pods are running.
    oc get pods -n openshift-storage
    

For more information about deploying ODF, see Deploying OpenShift Data Foundation on VPC clusters.

Option 2: Setting up VPC File Storage

File Storage for VPC is a cost-effective option for non-production workloads or environments with lower I/O requirements.

This section applies only to manual OpenShift Virtualization deployments. If you're using OpenShift Virtualization Service, storage is pre-configured and you don't need to follow these steps.

Prerequisites for VPC File Storage

  • Any supported bare metal flavor
  • VPC infrastructure

Step 1: Disable VPC Block Storage as default

  1. Edit the VPC Block CSI driver configmap.
    oc edit cm addon-vpc-block-csi-driver-configmap -n kube-system
    
  2. Set IsStorageClassDefault to false.
    data:
      IsStorageClassDefault: "false"
    
  3. Save and exit the editor.

Step 2: Install the VPC File CSI driver

From the console

  1. In your cluster dashboard, click Add-ons.

  2. Locate the File Storage for VPC add-on.

  3. Click Install.

  4. Wait for the add-on to reach a Normal state.

From the CLI

  1. Enable the VPC File CSI driver add-on.
    ibmcloud ks cluster addon enable vpc-file-csi-driver -c <cluster-name>
    
  2. Verify the add-on is enabled.
    ibmcloud ks cluster addon ls -c <cluster-name>
    

Step 3: Set a default storage class

  1. List available storage classes.

    oc get storageclass | grep vpc-file
    
  2. Choose an appropriate storage class based on your workload:

    • ibmc-vpc-file-1000-iops: For moderate workloads (40 GB - 2000 IOPS)
    • ibmc-vpc-file-6000-iops: For higher workloads (100 GB - 6000 IOPS)
    • ibmc-vpc-file-metro-1000-iops: For multi-zone deployments
  3. Edit the VPC File CSI driver configmap.

    oc edit cm addon-vpc-file-csi-driver-configmap -n kube-system
    
  4. Set the SET_DEFAULT_STORAGE_CLASS field to your chosen storage class.

    data:
      SET_DEFAULT_STORAGE_CLASS: "ibmc-vpc-file-metro-1000-iops"
    
  5. Save and exit the editor.

  6. Wait a few minutes for the changes to take effect.

  7. Verify the default storage class.

    oc get storageclass | grep "(default)"
    

Step 4: Configure storage profiles for VPC File Storage

After installing the OpenShift Virtualization Operator, you must configure storage profiles for VPC File Storage because the Container Disk Importer (CDI) does not automatically recognize VPC File Storage properties.

This step must be completed after installing the OpenShift Virtualization Operator.

Option 1: Patch all VPC File storage profiles (recommended)

Use this utility command to patch all storage profiles for the VPC File CSI provisioner:

for sp in $(oc get storageprofile.cdi.kubevirt.io -o json | jq -r '.items[] | select(.status.provisioner == "vpc.file.csi.ibm.io") | .metadata.name'); do
  oc patch storageprofile.cdi.kubevirt.io "$sp" --type=merge -p '{
    "spec": {
      "claimPropertySets": [
        {
          "accessModes": ["ReadWriteMany"],
          "volumeMode": "Filesystem"
        }
      ]
    }
  }'
done

Option 2: Manually edit a specific storage profile

  1. List available storage profiles.

    oc get storageprofile
    
  2. Edit the storage profile for your default storage class.

    oc edit storageprofile <storage-profile-name>
    
  3. Add the following configuration under spec:

    spec:
      claimPropertySets:
      - accessModes:
        - ReadWriteMany
        volumeMode: Filesystem
    
  4. Save and exit the editor.

  5. Verify the storage profile is updated.

    oc get storageprofile <storage-profile-name> -o yaml
    

For more information about storage profiles, see Customizing the storage profile.

Verifying VPC File Storage installation

  1. Verify the VPC File CSI driver pods are running.
    oc get pods -n kube-system | grep vpc-file
    
  2. Confirm the default storage class is set correctly.
    oc get storageclass | grep "(default)"
    
  3. Test storage provisioning by creating a test PVC.
    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: test-pvc
    spec:
      accessModes:
      - ReadWriteMany
      resources:
        requests:
          storage: 10Gi
    
  4. Verify the PVC is bound.
    oc get pvc test-pvc
    
  5. Delete the test PVC.
    oc delete pvc test-pvc
    

Storage comparison

Storage solution comparison
Feature OpenShift Data Foundation VPC File Storage
Performance High (local disks) Moderate (network storage)
Snapshots Supported Not supported
Cloning Supported Not supported
Live migration Supported Supported
Multi-zone HA Supported (3+ zones) Supported (lower throughput)
Cost Higher Lower
Best for Production workloads Non-production workloads

Troubleshooting storage setup

ODF installation fails

If ODF installation fails, check the following:

  • Verify that your bare metal nodes have local NVME storage
  • Ensure you have at least 3 worker nodes
  • Check that disks are unmounted and unformatted
  • Review ODF operator logs: oc logs -n openshift-storage -l app=ocs-operator

VPC File Storage PVCs remain pending

If PVCs remain in a pending state:

  • Verify the VPC File CSI driver add-on is installed and healthy
  • Check that the default storage class is set correctly
  • Ensure storage profiles are configured with RWX access mode
  • Review CSI driver logs: oc logs -n kube-system -l app=ibm-vpc-file-csi-controller

Storage profiles not updated

If storage profiles are not showing the correct configuration:

  • Ensure the OpenShift Virtualization Operator is installed
  • Wait for storage profiles to be created automatically
  • Manually patch storage profiles using the commands provided
  • Verify the provisioner name matches vpc.file.csi.ibm.io

Next steps

After setting up storage:

  1. Install the OpenShift Virtualization Operator
  2. Create and manage virtual machines
  3. Configure virtual network interfaces (optional)