kubernetes-sigs / gcp-compute-persistent-disk-csi-driver

The Google Compute Engine Persistent Disk (GCE PD) Container Storage Interface (CSI) Storage Plugin.
Apache License 2.0
163 stars 146 forks source link

Hyperdisk creation multi-writer (accesMode = ReadWriteMany) fails with `Invalid value for field 'resource.multiWriter': 'true'` #1863

Open karkunpavan opened 3 weeks ago

karkunpavan commented 3 weeks ago

It was observed in https://issues.redhat.com/browse/STOR-2043 that dynamic provisioning of disk in multi-writer mode on C3 instance type with hyperdisk-balanced disk failed with below error:

Warning ProvisioningFailed 31m (x15 over 57m) pd.csi.storage.gke.io_wduan-1030a-g-vdnqh-master-0_dc46e9f6-1725-4f15-922c-99f0e281e102
failed to provision volume with StorageClass "balanced-storage": rpc error: code = InvalidArgument
desc = CreateVolume failed: rpc error: code = InvalidArgument desc = CreateVolume failed to create single zonal disk
pvc-0b65d680-636b-46c6-876d-d3a6c412c3ef: failed to insert zonal disk: unknown Insert disk error:
googleapi: Error 400: Invalid value for field 'resource.multiWriter': 'true'. Cannot specify the multi writer field for
'hyperdisk-balanced' disks, please use access mode instead., invalid%!v(MISSING)

I think the bug is here the driver is still calling the beta API when multi writer is set to true.

this sets betaDiskToCreate.MultiWriter = multiWriter the boolean flag is only available in v0.beta APIs and not in v1 API.

The fix is to call v1 APIs which support accessMode = ReadWriteMany. Will create a PR.