<p>I would like to use the volume snapshot feature of GKE and found it requires a volume provisioned by CSI driver. However there are no much information online about how to migrate the current pd provisioned PVCs to use CSI driver.</p>
<p>The CSI driver has been enabled on the cluster and an Annotation <code>pv.kubernetes.io/migrated-to: pd.csi.storage.gke.io</code> was added automatically to the PV, but what next?</p>

xc7621
<p>We had currently an issue with our system when we upgraded to kubernetes from 1.23.x to 1.25.4. New persistant volume claims were sticking in pending status. Old pv with this annotation you mentioned: <code>pv.kubernetes.io/migrated-to: pd.csi.storage.gke.io</code> could not be used on nodes with kubernetes 1.25.4 (we still had a not migrated pool, so we could force our pods using a persistant volumes to run on that old pool until we figured our issue).</p>
<p>The error we saw on new persistant volume claims was:</p>
<pre><code>Normal  ExternalProvisioning  5s (x8 over 99s)  persistentvolume-controller  waiting for a volume to be created, either by external provisioner &quot;pd.csi.storage.gke.io&quot; or manually created by system administrator
</code></pre>
<p>On the pending pods, which tried to use an old persistant volume on a new node, we saw the error:</p>
<pre><code>1 node(s) had volume node affinity conflict
</code></pre>
<p>Since this just leads to explanations about having nodes and persistant volumes on different availability zones, we needed some time, to figure, that the real issue, was hidden in the <code>pv.kubernetes.io/migrated-to: pd.csi.storage.gke.io</code> you mentioned here.</p>
<p>So we finally figured, we just add the csi storage driver since we had not evena storageclass for pd.csi.storage.gke.io at all.</p>
<p>from: <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/persistent-volumes/gce-pd-csi-driver#enabling_the_on_an_existing_cluster" rel="nofollow noreferrer">https://cloud.google.com/kubernetes-engine/docs/how-to/persistent-volumes/gce-pd-csi-driver#enabling_the_on_an_existing_cluster</a></p>
<pre><code>gcloud container clusters update CLUSTER-NAME \
   --update-addons=GcePersistentDiskCsiDriver=ENABLED
</code></pre>
<p>Two storage classes now will automatically added: standard-rwo, premium-rwo.</p>
<p>We made the standard-rwo storageclass default, too (I am not sure, if that was necessary). But this seems to be the only needed next step for migration, since afterwards everything worked fine again.</p>
