PV Volumes change Status from reclaim to available  

kubectl 


NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                                  STORAGECLASS          REASON   AGE

pvc-1b01446e-8bc4-4c26-89ff-ebb374148d7f   3Gi        RWO            Delete           Bound    turbonomic/topology-processor          topolvm-provisioner            18h

pvc-2f487202-191e-419b-8e0a-83dcbaf3f2be   1Gi        RWO            Delete           Bound    turbonomic/api-certs                   topolvm-provisioner            18h

pvc-349bbb01-0a8c-4064-84fc-d6f4d2185d26   1Gi        RWO            Delete           Bound    turbonomic/consul-data                 topolvm-provisioner            18h

pvc-44d88357-0762-44f1-a455-0e631f9f91aa   500Gi      RWO            Delete           Bound    turbonomic/db-data                     topolvm-provisioner            18h



Status :


In order to get from Reclaim to available you have to remove the uid and resourceVersion lines from the spec, then the volume will show up available again 

spec:

  accessModes:

  - ReadWriteOnce

  capacity:

    storage: 1Gi

  claimRef:

    apiVersion: v1

    kind: PersistentVolumeClaim

    name: api

    namespace: turbonomic

    resourceVersion: "103497"

    uid: b1d59949-f50d-44bb-a2dc-794a7dd2f778



Problem: 

MountVolume.WaitForAttach failed for volume "pvc-4e82a83a-a894-4b34-a158-48106ad536a0" : volume attachment is being deleted



kubectl get volumeattachment -A


NAME                                                                   ATTACHER                  PV                                         NODE     ATTACHED   AGE

csi-429bc10c2f404919f5390d83b7589adaef867a8e09409bf507ca887da802773b   io.openebs.csi-mayastor   pvc-d67f0f89-83a9-47d7-8512-36baa3ea5669   node13   true       22d

csi-36a0c0971b88b4f0c088099472fae21eaaa301f4d37b62881fb0b7ae6a9322a8   io.openebs.csi-mayastor   pvc-4e82a83a-a894-4b34-a158-48106ad536a0   node13   true       22d



kubectl delete volumeattachment csi-429bc10c2f404919f5390d83b7589adaef867a8e09409bf507ca887da802773b


Option 2 delete (patch) the finalyzer for the attachment 


kubectl patch volumeattachments.storage.k8s.io csi-<uuid> -p '{"metadata":{"finalizers":[]}}' --type=merge