Bug 2024821

Summary: [Azure-File-CSI] need more clear info when requesting pvc with volumeMode Block
Product: OpenShift Container Platform Reporter: Wei Duan <wduan>
Component: StorageAssignee: Jan Safranek <jsafrane>
Storage sub component: Operators QA Contact: Wei Duan <wduan>
Status: CLOSED ERRATA Docs Contact:
Severity: low    
Priority: unspecified CC: jsafrane
Version: 4.10Keywords: Rebase
Target Milestone: ---   
Target Release: 4.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-10 10:39:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Wei Duan 2021-11-19 07:47:13 UTC
Description of problem:
When requesting a PVC with volumeMode:Block with azure-file-csi, the PVC is pending which is expected, but from the oc describe output (as same in driver log), the message is not clear enough as below, it looks like no Access Mode and Capability specifying, but the root cause is it doesn't support Block VolumeMode

failed to provision volume with StorageClass "azurefile-csi": rpc error: code = InvalidArgument desc = CreateVolume Volume capabilities not valid: driver only supports mount access type volume capability


$ oc describe pvc mypvc-block 
Name:          mypvc-block
Namespace:     csi
StorageClass:  azurefile-csi
Status:        Pending
Volume:        
Labels:        <none>
Annotations:   volume.beta.kubernetes.io/storage-provisioner: file.csi.azure.com
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      
Access Modes:  
VolumeMode:    Block
Used By:       mypod-block
Events:
  Type     Reason                Age                        From                                                                                Message
  ----     ------                ----                       ----                                                                                -------
  Warning  ProvisioningFailed    7m39s (x14 over 29m)       file.csi.azure.com_wduan-1118a-m9mqg-master-1_009087d3-3c56-4753-b83e-02857cd2b0e3  failed to provision volume with StorageClass "azurefile-csi": rpc error: code = InvalidArgument desc = CreateVolume Volume capabilities not valid: driver only supports mount access type volume capability
  Normal   Provisioning          45s (x16 over 29m)         file.csi.azure.com_wduan-1118a-m9mqg-master-1_009087d3-3c56-4753-b83e-02857cd2b0e3  External provisioner is provisioning volume for claim "csi/mypvc-block"
  Normal   ExternalProvisioning  <invalid> (x125 over 29m)  persistentvolume-controller                                                         waiting for a volume to be created, either by external provisioner "file.csi.azure.com" or manually created by system administrator


Driver log:
$ oc -n openshift-cluster-csi-drivers logs azure-file-csi-driver-controller-58c8bcc66d-z484h -c csi-provisioner
E1118 03:05:11.172891       1 controller.go:956] error syncing claim "76757277-3dc9-4403-bed8-e170b5f48e46": failed to provision volume with StorageClass "azurefile-csi": rpc error: code = InvalidArgument desc = CreateVolume Volume capabilities not valid: driver only supports mount access type volume capability
I1118 03:05:11.172908       1 event.go:282] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"csi", Name:"mypvc-block", UID:"76757277-3dc9-4403-bed8-e170b5f48e46", APIVersion:"v1", ResourceVersion:"56642", FieldPath:""}): type: 'Warning' reason: 'ProvisioningFailed' failed to provision volume with StorageClass "azurefile-csi": rpc error: code = InvalidArgument desc = CreateVolume Volume capabilities not valid: driver only supports mount access type volume capability


Version-Release number of selected component (if applicable):
4.10.0-0.nightly-2021-11-15-034648

How reproducible:
Always

Steps to Reproduce:
Create cluster in Azure
Enable geaturegate to install the Azure-File CSI Driver by:
$ oc patch featuregate cluster -p '{"spec": {"featureSet": "TechPreviewNoUpgrade"}}' --type merge
Create pvc with specifying VolumeMode as Block and using the storageClassName as "azurefile-csi"
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: mypvc-block
spec:
  accessModes:
  - ReadWriteOnce
  volumeMode: Block
  resources:
    requests:
      storage: 1Gi
  storageClassName: "azurefile-csi"

Check the pvc status


Actual results:
Message for the ProvisioningFailed is not clear

Expected results:
Message for the ProvisioningFailed should be more clear

Master Log:

Node Log (of failed PODs):

PV Dump:
  
PVC Dump:

StorageClass Dump (if StorageClass used by PV/PVC):

Additional info:

Comment 2 Jan Safranek 2022-03-14 10:49:30 UTC
Upstream PR: https://github.com/kubernetes-sigs/azurefile-csi-driver/pull/940

Comment 3 Jan Safranek 2022-03-17 12:43:34 UTC
Fix has been accepted upstream, waiting for update in OCP.

Comment 5 Jan Safranek 2022-06-01 13:56:35 UTC
This has been part of a recent update to v1.14.0 in https://github.com/openshift/azure-file-csi-driver/pull/12

Comment 6 Jan Safranek 2022-07-18 09:39:19 UTC
Moving on_qa manually for testing.

Comment 7 Wei Duan 2022-07-18 09:53:02 UTC
Verified pass on 4.11.0-0.nightly-2022-07-16-020951.

The message looks good as below:
failed to provision volume with StorageClass "azurefile-csi": rpc error: code = InvalidArgument desc = CreateVolume Volume capabilities not valid: driver does not support block volumes

Comment 9 errata-xmlrpc 2022-08-10 10:39:48 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: OpenShift Container Platform 4.11.0 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:5069