trident: Creating volumesnapshot causes error status.restoreSize in body should be greater than or equal to 0

Describe the bug

I am setting up snapshots on a openshift cluster so I have created a snapshotclass

apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
metadata:
  name: nap-snapshots
driver: csi.trident.netapp.io
deletionPolicy: Delete

And a volumesnapshot:

apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshot
metadata:
  name: nap-nfs-pre-dr03-volym-pvc-snapshot-20210920-2
spec:
  volumeSnapshotClassName: nap-snapshots
  source:
    persistentVolumeClaimName: nap-nfs-pre-dr03-volym-pvc

However the volumesnapshot isnt created:

$ oc get volumesnapshots
NAME                                             READYTOUSE   SOURCEPVC                    SOURCESNAPSHOTCONTENT   RESTORESIZE   SNAPSHOTCLASS   SNAPSHOTCONTENT                                    CREATIONTIME   AGE
nap-nfs-pre-dr03-volym-pvc-snapshot-20210920-2   false        nap-nfs-pre-dr03-volym-pvc                                         nap-snapshots   snapcontent-58753024-b897-481d-a493-7672eab98d95                  30s

$ oc describe volumesnapshot nap-nfs-pre-dr03-volym-pvc-snapshot-20210920-2
Name:         nap-nfs-pre-dr03-volym-pvc-snapshot-20210920-2
Namespace:    sfit
Labels:       <none>
Annotations:  <none>
API Version:  snapshot.storage.k8s.io/v1
Kind:         VolumeSnapshot
Metadata:
  Creation Timestamp:  2021-09-20T08:29:19Z
  Finalizers:
    snapshot.storage.kubernetes.io/volumesnapshot-as-source-protection
    snapshot.storage.kubernetes.io/volumesnapshot-bound-protection
  Generation:  1
    Manager:         snapshot-controller
    Operation:       Update
    Time:            2021-09-20T08:29:20Z
  Resource Version:  119764628
  UID:               58753024-b897-481d-a493-7672eab98d95
Spec:
  Source:
    Persistent Volume Claim Name:  nap-nfs-pre-dr03-volym-pvc
  Volume Snapshot Class Name:      nap-snapshots
Status:
  Bound Volume Snapshot Content Name:  snapcontent-58753024-b897-481d-a493-7672eab98d95
  Error:
    Message:     Failed to check and update snapshot content: error updating status for volume snapshot content snapcontent-58753024-b897-481d-a493-7672eab98d95: snapshot controller failed to update snapcontent-58753024-b897-481d-a493-7672eab98d95 on API server: VolumeSnapshotContent.snapshot.storage.k8s.io "snapcontent-58753024-b897-481d-a493-7672eab98d95" is invalid: status.restoreSize: Invalid value: -1744896: status.restoreSize in body should be greater than or equal to 0
    Time:        2021-09-20T08:29:20Z
  Ready To Use:  false
Events:
  Type    Reason            Age   From                 Message
  ----    ------            ----  ----                 -------
  Normal  CreatingSnapshot  56s   snapshot-controller  Waiting for a snapshot sfit/nap-nfs-pre-dr03-volym-pvc-snapshot-20210920-2 to be created by the CSI driver.

tridentctl logs gives me:

time="2021-09-20T08:29:19Z" level=warning msg="Snapshot not found." requestID=53771262-28eb-43c3-8cc1-67c1566103de requestSource=CSI snapshotName=snapshot-58753024-b897-481d-a493-7672eab98d95 volumeName=trident_pvc_902f8810_1daf_40dd_89b5_4ae5ebb77a85

The PVC is created with a storageclass defined as:

allowVolumeExpansion: true
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  creationTimestamp: "2021-05-31T08:35:55Z"
  name: nap-nfs-pre-dr03-volym
  resourceVersion: "42649804"
  uid: 0b365406-7fd9-47d2-9a4f-978b9d5ecf67
parameters:
  backendType: ontap-nas
  clones: "true"
  media: hybrid
  provisioningType: thin
  snapshots: "true"
  storagePools: my-backend
provisioner: csi.trident.netapp.io
reclaimPolicy: Delete
volumeBindingMode: Immediate

(my-backend storage driver is “ontap-nas”)

Environment Provide accurate information about the environment to help us reproduce the issue.

  • Trident version: 21.07.1
  • Kubernetes version: v1.21.1+9807387
  • Kubernetes orchestrator: Openshift 4.8.10
  • NetApp backend types: ONTAP

To Reproduce

  • Create volumesnapshotclass
  • Create volumesnapshot

Expected behavior Snapshot should be created

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (4 by maintainers)

Most upvoted comments

I am seeing the same issue. Trident version: 21.07.1 Kubernetes version: 1.20.10 Ontap Version: 9.7P14

Using ONTAP-NAS, with useREST not configured (guess it’s ‘useREST=false’ then)

Failed to check and update snapshot content: error updating status for volume snapshot content snapcontent-08ee5223-0e2d-491e-88a9-b31588a82d64: snapshot controller failed to update snapcontent-08ee5223-0e2d-491e-88a9-b31588a82d64 on API server: VolumeSnapshotContent.snapshot.storage.k8s.io "snapcontent-08ee5223-0e2d-491e-88a9-b31588a82d64" is invalid: status.restoreSize: Invalid value: -646946816: status.restoreSize in body should be greater than or equal to 0

Waiting for a snapshot cattle-prometheus/k10-csi-snap-72dhsdpmcxsd4q9f to be created by the CSI driver.

Quick question. Are those of you experiencing this only using ONTAP-NAS backends and have ‘useREST=true’ in your backend config?

NAS in our case