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
- Create a Red Hat OpenShift on IBM Cloud cluster with bare metal worker nodes. For more information, see Creating VPC clusters.
- Ensure your cluster meets the prerequisites for OpenShift Virtualization.
- Decide which storage solution to use based on your workload requirements. For guidance, see Planning your storage solution.
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
dsuffix 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
-
Log in to your IBM Cloud account and navigate to your cluster.
-
Click Add-ons in the cluster navigation.
-
On the OpenShift Data Foundation card, click Install.
-
Select the Local Storage option.
Remote block volume attachment is not supported for VPC bare metal nodes.
-
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:
- Log in to each worker node to identify available disks.
oc debug node/<node-name> - Allow host binaries.
chroot /host - List available devices.
lsblk - Find the by-id for each disk.
ls -l /dev/disk/by-id/ - Add the disk IDs in the OSD pod disk IDs parameter.
-
Configure additional parameters as needed:
- Resource profile: Choose
balancedorperformancebased 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
- Resource profile: Choose
-
Click Install to deploy ODF.
For more information about ODF parameters, see OpenShift Data Foundation parameter reference.
Installing ODF from the CLI
- Review the available add-on options.
ibmcloud oc cluster addon options --addon openshift-data-foundation --version 4.20.0 - 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" - Verify the add-on is in a Ready state.
Example output:oc get storagecluster -n openshift-storageNAME AGE PHASE EXTERNAL CREATED AT VERSION ocs-storagecluster 53m Ready 2025-03-10T12:20:52Z 4.20.0
Verifying ODF installation
- Check the storage cluster status.
oc get storagecluster -n openshift-storage - Verify that storage classes are available.
oc get storageclass | grep ocs - 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
- Edit the VPC Block CSI driver configmap.
oc edit cm addon-vpc-block-csi-driver-configmap -n kube-system - Set
IsStorageClassDefaulttofalse.data: IsStorageClassDefault: "false" - Save and exit the editor.
Step 2: Install the VPC File CSI driver
From the console
-
In your cluster dashboard, click Add-ons.
-
Locate the File Storage for VPC add-on.
-
Click Install.
-
Wait for the add-on to reach a Normal state.
From the CLI
- Enable the VPC File CSI driver add-on.
ibmcloud ks cluster addon enable vpc-file-csi-driver -c <cluster-name> - Verify the add-on is enabled.
ibmcloud ks cluster addon ls -c <cluster-name>
Step 3: Set a default storage class
-
List available storage classes.
oc get storageclass | grep vpc-file -
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
-
Edit the VPC File CSI driver configmap.
oc edit cm addon-vpc-file-csi-driver-configmap -n kube-system -
Set the
SET_DEFAULT_STORAGE_CLASSfield to your chosen storage class.data: SET_DEFAULT_STORAGE_CLASS: "ibmc-vpc-file-metro-1000-iops" -
Save and exit the editor.
-
Wait a few minutes for the changes to take effect.
-
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
-
List available storage profiles.
oc get storageprofile -
Edit the storage profile for your default storage class.
oc edit storageprofile <storage-profile-name> -
Add the following configuration under
spec:spec: claimPropertySets: - accessModes: - ReadWriteMany volumeMode: Filesystem -
Save and exit the editor.
-
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
- Verify the VPC File CSI driver pods are running.
oc get pods -n kube-system | grep vpc-file - Confirm the default storage class is set correctly.
oc get storageclass | grep "(default)" - Test storage provisioning by creating a test PVC.
apiVersion: v1 kind: PersistentVolumeClaim metadata: name: test-pvc spec: accessModes: - ReadWriteMany resources: requests: storage: 10Gi - Verify the PVC is bound.
oc get pvc test-pvc - Delete the test PVC.
oc delete pvc test-pvc
Storage 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: