How to confirm that the CSI migration was successful?

Solution Verified - Updated -

Environment

  • Red Hat OpenShift Container Platform (RHOCP)
    • 4.11 +

Issue

  • How to confirm that the CSI migration was successful?
  • The Automatic CSI migration does not change the storage class of existing PVC so not able to use the features of CSI.
  • Existing persistent volumes still use old in-tree storage class after OpenShift Container Platform upgrade to 4.11, 4.12 or later.

Resolution

  • To use the features post CSI automatic migration, create a new pv/pvc and migrate the data to the new pv, check KCS for the procedure.
  • To check actual migration status for given PV, please refer to the 'Diagnostics steps' section.

Root Cause

  • PV migration from in-tree driver to Container Storage Interface (CSI) doesn't change storage class of existing PVs.
  • API calls for migrated PVs are translated into CSI calls transparently without any explicit changes in legacy APIs.
  • CSI automatic migration of in-tree persistent volumes (PVs) or persistent volume claims (PVCs) does not enable any new CSI driver features, such as snapshots or expansion, if the original in-tree storage plugin did not support it.

Diagnostic Steps

  • Check if there is pv.kubernetes.io/migrated-to annotation in the PersistentVolume resource definition as shown below:

    $ oc get pv pvc-000000-0000-0000-0000-000000000 -o yaml
    apiVersion: v1
    kind: PersistentVolume
    metadata:
    annotations:
    pv.kubernetes.io/bound-by-controller: 'yes'
    pv.kubernetes.io/migrated-to: zzzzzzzzz  <----------------------
    pv.kubernetes.io/provisioned-by: xxxxxxxxxxxx
    volumehelper.VolumeDynamicallyCreatedByKey: xxxxxxxxxxxxxxx
    
  • From the above the annotation pv.kubernetes.io/migrated-toconfirms that this PV has been migrated to a new CSI provisioner.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments