Details
-
Bug
-
Resolution: Done
-
Normal
-
None
-
4.16
-
None
-
Moderate
-
No
-
False
-
Description
Description of problem:
[vSphere CSI Driver] snapshots exceed maximum number message is not clear enough
Version-Release number of selected component (if applicable):
4.16.0-0.test-2024-04-08-003725-ci-ln-sv9g1z2-latest
How reproducible:
Install an Openshift cluster on vSphere
Steps to Reproduce:
1. Create 4 snapshots and verify the 4th failed to create: $ oc -n default get volumesnapshots/app-pvc-snapshot-4 -oyaml ... error: message: 'Failed to check and update snapshot content: failed to take snapshot of the volume cf20c294-9af7-4722-89fd-b95921b30df0: "rpc error: code = FailedPrecondition desc = the number of snapshots on the source volume cf20c294-9af7-4722-89fd-b95921b30df0 reaches the configured maximum (3)"' ... 2. Change the `global-max-snapshots-per-block-volume = 10` and `granular-max-snapshots-per-block-volume-vsan = 5 `, check the granular-max-snapshots-per-block-volume-vsan should overwrite the max value for vSAN volumes as expected. $ oc patch clustercsidriver/csi.vsphere.vmware.com --type=merge -p '{"spec":{"driverConfig":{"vSphere":{"globalMaxSnapshotsPerBlockVolume": 10}}}}' clustercsidriver.operator.openshift.io/csi.vsphere.vmware.com patched $ oc patch clustercsidriver/csi.vsphere.vmware.com --type=merge -p '{"spec":{"driverConfig":{"vSphere":{"granularMaxSnapshotsPerBlockVolumeInVSAN": 5}}}}' clustercsidriver.operator.openshift.io/csi.vsphere.vmware.com patched $ oc -n openshift-cluster-csi-drivers get cm/vsphere-csi-config -o yaml apiVersion: v1 data: cloud.conf: | # Labels with topology values are added dynamically via operator [Global] cluster-id = pewang-0408vv-pf8v5 [VirtualCenter "vcenter.devqe.ibmc.devcluster.openshift.com"] insecure-flag = true datacenters = DEVQEdatacenter migration-datastore-url = ds:///vmfs/volumes/vsan:527320283a8c3163-2faa6dc5949a3a28/ [Snapshot] global-max-snapshots-per-block-volume = 10 granular-max-snapshots-per-block-volume-vsan = 5 kind: ConfigMap metadata: creationTimestamp: "2024-04-08T01:27:45Z" name: vsphere-csi-config namespace: openshift-cluster-csi-drivers resourceVersion: "330478" uid: c6d0dac1-6ece-48d3-a0db-1932c18ff06e # Create 6 snapshots and verify the 6th failed to create: $ oc -n mystorage get volumesnapshots/vsan-pvc-snapshot-6 -oyaml ... status: boundVolumeSnapshotContentName: snapcontent-ada27b34-f71a-42d6-8e0c-c4a4368f42c4 error: message: 'Failed to check and update snapshot content: failed to take snapshot of the volume 314d491b-d972-4177-8024-04b41c9306d5: "rpc error: code = FailedPrecondition desc = the number of snapshots on the source volume 314d491b-d972-4177-8024-04b41c9306d5 reaches the configured maximum (5)"' time: '2024-04-08T03:27:57Z' readyToUse: false ...
Actual results:
In step 1 and step 2 the snapshots exceed maximum number message is not clear enough
Expected results:
In step 1 the snapshots exceed maximum number message should contains "exceeds configured maximum global-max-snapshots-per-block-volume (3)" In step 2 the snapshots exceed maximum number message should contains "exceeds configured maximum granular-max-snapshots-per-block-volume-vsan (5)"
Additional info:
The error infos comes from https://github.com/kubernetes-sigs/vsphere-csi-driver/blob/1299d9a75a2707b2e740e376375084903dabbd91/pkg/csi/service/vanilla/controller.go#L2852-L2870 . We'd better enhance the info from driver side.