Migrating Block Storage for VPC volumes from Gen-1 to Gen-2 profiles
Virtual Private Cloud
Migrate your Block Storage for VPC volumes from Generation 1 (tier-based) profiles to Generation 2 (Software Defined Performance) profiles to take advantage of improved performance, dynamic IOPS adjustment, and better cost optimization.
Understanding the profile generations
Block Storage for VPC has evolved from Generation 1 (tier-based) to Generation 2 (Software Defined Performance) profiles.
- Generation 1 (tier-based)
- IOPS are calculated based on volume size. For more information, see Block Storage profiles.
- Generation 2 (SDP)
- Custom IOPS independent of volume size. For more information, see SDP Block Storage profile.
For the latest details on block storage profiles and their capabilities, see Block Storage profiles.
Before you begin
Before you migrate your volumes, complete the following steps.
- Install the IBM Cloud CLI.
- Ensure you have
kubectlorocaccess to your cluster. - Verify that the VPC Block CSI Driver add-on is version 5.0 or later. To check the version, run the following IBM MobileFirst Platform Command Line Interface
oc get deployment -n kube-system vpc-block-csi-controller -o jsonpath='{.spec.template.spec.containers[0].image}' - Ensure that the VPC Block CSI Driver add-on is installed. For more information, see Installing the VPC Block CSI Driver add-on.
- Ensure that the VPC Block CSI Driver add-on is configured. For more information, see Configuring the VPC Block CSI Driver add-on.
- Ensure that the VPC Block CSI Driver add-on is running. For more information, see Verifying the VPC Block CSI Driver add-on.
- Ensure that the VPC Block CSI Driver add-on is up-to-date. For more information, see Upgrading the VPC Block CSI Driver add-on.
- Document your current performance requirements.
- Create a backup or snapshot of your data. For more information, see Setting up snapshots with the Block Storage for VPC cluster add-on.
Identify volumes for migration
Find PVCs that use Gen-1 block storage profiles.
-
List all block storage PVCs in your cluster.
oc get pvc --all-namespaces -o custom-columns=NAMESPACE:.metadata.namespace,NAME:.metadata.name,STORAGECLASS:.spec.storageClassName,STATUS:.status.phase | grep vpc-block -
Get the VPC volume ID from a PVC.
PV_NAME=$(oc get pvc <pvc-name> -n <namespace> -o jsonpath='{.spec.volumeName}') VOLUME_ID=$(oc get pv $PV_NAME -o jsonpath='{.spec.csi.volumeHandle}') echo "Volume ID: $VOLUME_ID"Example output
Volume ID: r026-3afe630d-1a47-482c-aade-e37f5e0bb9f4
Check the current volume configuration
-
View the current block volume profile and configuration.
ibmcloud is vol $VOLUME_IDExample output before migration
ID r026-3afe630d-1a47-482c-aade-e37f5e0bb9f4 Name pvc-d4a2b016-a5e4-46de-9214-a64f5fc8e344 Status available Attachment state attached Capacity 100 IOPS 3000 Bandwidth(Mbps) 393 Profile 5iops-tier Storage Generation 1 Adjustable IOPS false Busy false -
Note the following values from the output. You'll use these to verify the migration was successful.
- Profile:
5iops-tier(Gen-1) - Storage Generation:
1 - Adjustable IOPS:
false
- Profile:
Start the migration
The migration process runs in the background while your volume remains attached to your pod and your application continues running. IOPS are automatically adjusted to SDP defaults, and the process typically takes 5-15 minutes.
-
Initiate the migration to the SDP profile.
ibmcloud is volume-job-create $VOLUME_ID --profile sdp
Monitor migration progress
-
Check the migration job status. If the output indicates
Status: updatingandBusy: true, the migration is in progress. When the output showsStatus: availableandBusy: false, the migration is complete.ibmcloud is volume-jobs $VOLUME_ID -
Check the volume status.
watch -n 30 "ibmcloud is vol $VOLUME_ID | grep -E 'Status|Busy|Profile'"Example output during migration
Status updating Busy true Profile 5iops-tier
Verify migration completion
-
Confirm that the volume is using the Gen-2 profile.
ibmcloud is vol $VOLUME_IDExample output after migration
ID r026-3afe630d-1a47-482c-aade-e37f5e0bb9f4 Name pvc-d4a2b016-a5e4-46de-9214-a64f5fc8e344 Status available Attachment state attached Capacity 100 IOPS 4000 Bandwidth(Mbps) 1000 Profile sdp Storage Generation 2 Adjustable IOPS true Adjustable Capacity States unattached,attached Adjustable IOPS States unattached,attached Busy false -
Verify the following success indicators:
- Profile:
sdp - Storage Generation:
2 - Adjustable IOPS:
true - IOPS: Increased (for example, 3000 to 4000)
- Bandwidth: Improved
- Profile:
Updating the PersistentVolume metadata
-
Update the PV metadata to reflect the Gen-2 profile.
oc patch pv $PV_NAME --type='json' -p='[ {"op": "replace", "path": "/spec/storageClassName", "value": "ibmc-vpc-block-sdp"}, {"op": "replace", "path": "/spec/csi/volumeAttributes/profile", "value": "sdp"}, {"op": "replace", "path": "/spec/csi/volumeAttributes/iops", "value": "4000"} ]' -
Verify the update.
oc get pv $PV_NAME -o jsonpath='{.spec.storageClassName}'Expected output
ibmc-vpc-block-sdpThe PVC continues to show the original StorageClass name. This behavior is expected because the
storageClassNamefield in a PVC is immutable. The actual storage profile is determined by the PV, which you updated in this step.
Validate your application
Verify that your application is functioning correctly after the migration.
-
Check the pod status. Verify that all pods are in the
Runningstate.oc get pods -n <namespace> -
Verify the volume attachment. Confirm that the volume is mounted correctly.
oc describe pod <pod-name> -n <namespace> | grep -A 5 "Volumes:" -
Check the application logs. Look for any errors related to storage or I/O operations.
oc logs <pod-name> -n <namespace> --tail=50 -
Test the application endpoint if applicable. Verify that the application responds correctly.
curl -I https://<app-endpoint>/health
Create a Gen-2 StorageClass
Create an SDP StorageClass for provisioning new volumes.
-
Create a YAML file for the StorageClass. Save the following configuration as
storageclass-sdp.yaml.apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: ibmc-vpc-block-sdp-general labels: app: ibm-vpc-block-csi-driver provisioner: vpc.block.csi.ibm.io parameters: profile: "sdp" iops: "5000" csi.storage.k8s.io/fstype: "ext4" billingType: "hourly" encrypted: "false" region: "" zone: "" tags: "generation:2,profile:sdp" reclaimPolicy: Delete allowVolumeExpansion: true volumeBindingMode: WaitForFirstConsumer -
Apply the StorageClass.
oc apply -f storageclass-sdp.yaml -
Verify the StorageClass creation.
oc get storageclass ibmc-vpc-block-sdp-general
Adjust IOPS and throughput to optimize performance
After migration, you can adjust IOPS and throughput (bandwidth) dynamically based on your workload requirements.
- Start with 5,000 IOPS for general workloads.
- Use 10,000 or more IOPS for databases.
- Monitor usage and adjust based on actual requirements.
Updating IOPS
-
Increase IOPS for higher performance.
ibmcloud is volume-update $VOLUME_ID --iops 8000 -
Verify the IOPS update.
ibmcloud is vol $VOLUME_ID | grep IOPS
Updating throughput (bandwidth)
After migration to the SDP profile, volumes have a default bandwidth allocation. You can increase the bandwidth to improve throughput for I/O-intensive workloads.
-
Check the current bandwidth allocation.
ibmcloud is vol $VOLUME_ID | grep Bandwidth -
Increase bandwidth for higher throughput. Use the
--bandwidthoption to specify the desired bandwidth in Mbps.ibmcloud is volume-update $VOLUME_ID --bandwidth 2000 -
Verify the bandwidth update.
ibmcloud is vol $VOLUME_ID | grep BandwidthThe bandwidth value represents the maximum throughput in MB/s that the volume can achieve. Higher bandwidth values provide better performance for data-intensive operations.
Troubleshooting
Migration stuck in updating status
If the migration status remains updating for more than 30 minutes, complete the following steps. Note that larger volumes take longer to migrate and might remain in the updating state for 45 minutes.
-
Check the job details.
ibmcloud is volume-jobs $VOLUME_ID -
Check the volume status for errors or warnings.
ibmcloud is vol $VOLUME_ID | grep -E "Status|Busy" -
Wait an additional 15 minutes as large volumes take longer to migrate.
-
Check the IBM Cloud status page for VPC service issues.
-
If the migration is stuck for more than 1 hour, contact IBM Support with the job ID.
PVC shows old StorageClass
If the PVC still references the Gen-1 StorageClass after migration, this behavior is expected and requires no action. The PVC storageClassName field is immutable. The actual storage profile is determined by the PV, which you updated
in the previous steps. Functionality is not affected.
-
Verify that the PV (not PVC) is correct.
oc get pv $PV_NAME -o jsonpath='{.spec.storageClassName}'Expected output
ibmc-vpc-block-sdp
Performance not improved
If you don't see a performance increase after migration, complete the following steps.
-
Check the actual IOPS allocation.
ibmcloud is vol $VOLUME_ID | grep IOPS -
Check the volume profile.
ibmcloud is vol $VOLUME_ID | grep Profile -
Increase the IOPS allocation.
ibmcloud is volume-update $VOLUME_ID --iops 10000 -
Verify the update.
ibmcloud is vol $VOLUME_ID | grep IOPS
Next steps
After completing the migration, consider the following next steps.
- Migrate additional volumes by repeating this tutorial.
- Monitor volume performance and adjust IOPS as needed.
- Update your deployment templates to use Gen-2 StorageClasses for new volumes.
- Review Block Storage capacity and performance for optimization guidance.