christian-schlichtherle / synology-csi-chart

A Helm chart for installing the Synology CSI Driver in a Kubernetes cluster.
Apache License 2.0
51 stars 21 forks source link

/volume1 with ext4 fstype was not supported for creating smb/nfs protocol's K8s volume #22

Closed dkrizic closed 1 month ago

dkrizic commented 1 month ago

Hi,

first, thank you @christian-schlichtherle for the Helm chart. It works for me for iSCSI, but now I also wanted to use NFS or SMB for RWX volumes. I have basically two StorageClasses

allowVolumeExpansion: true
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  annotations:
    meta.helm.sh/release-name: synology-csi
    meta.helm.sh/release-namespace: synology-csi
    storageclass.kubernetes.io/is-default-class: "false"
  name: synology-csi-nfs-delete
mountOptions:
- vers=4.1
parameters:
  dsm: 10.10.2.45
  protocol: nfs
provisioner: csi.san.synology.com
reclaimPolicy: Delete
volumeBindingMode: Immediate

and

allowVolumeExpansion: true
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  annotations:
    meta.helm.sh/release-name: synology-csi
    meta.helm.sh/release-namespace: synology-csi
    storageclass.kubernetes.io/is-default-class: "false"
  name: synology-csi-smb-delete
mountOptions:
- mfsymlinks
parameters:
  csi.storage.k8s.io/node-stage-secret-name: synology-csi-smb-user
  csi.storage.k8s.io/node-stage-secret-namespace: synology-csi
  dsm: 10.10.2.45
  location: /volume1
  mountPermissions: "0750"
  protocol: smb
provisioner: csi.san.synology.com
reclaimPolicy: Delete
volumeBindingMode: Immediate

When I try to create a volume like this:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  annotations:
  finalizers:
  - kubernetes.io/pvc-protection
  name: smb
  namespace: default
spec:
  accessModes:
  - ReadWriteMany
  resources:
    requests:
      storage: 1Gi
  storageClassName: synology-csi-smb-delete
  volumeMode: Filesystem
status:
  phase: Pending

I see the following error in the synology-csi-controller

I1022 11:49:08.215604       1 event.go:298] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"smb", UID:"4c13be44-256c-4492-a514-935d868d2d69", APIVersion:"v1", ResourceVersion:"578819024", FieldPath:""}): type: 'Warning' reason: 'ProvisioningFailed' failed to provision volume with StorageClass "synology-csi-smb-delete": rpc error: code = Internal desc = Couldn't find any host available to create Volume

But digging deeper (this is a pod with 4 containers!), the csi-plugin (the actual Synology specific container) tells me this:

2024-10-22T11:54:04Z [INFO] [driver/utils.go:105] GRPC request: {"capacity_range":{"required_bytes":1073741824},"name":"pvc-4c13be44-256c-4492-a514-935d868d2d69","parameters":{"csi.storage.k8s.io/pv/name":"pvc-4c13be44-256c-4492-a514-935d868d2d69","csi.storage.k8s.io/pvc/name":"smb","csi.storage.k8s.io/pvc/namespace":"default","dsm":"10.10.2.45","location":"/volume1","mountPermissions":"0750","protocol":"smb"},"volume_capabilities":[{"AccessType":{"Mount":{"mount_flags":["mfsymlinks"]}},"access_mode":{"mode":5}}]}
2024-10-22T11:54:05Z [ERROR] [service/dsm.go:535] [10.10.2.45] Failed to create Volume: rpc error: code = InvalidArgument desc = Location: /volume1 with ext4 fstype was not supported for creating smb/nfs protocol's K8s volume

So yes, my very old Synology is using ext4 (and does not support btrfs), but what does the message mean? Do I need to configure something to allow/enable ext4 for SMB and NFS. The error for NFS is the same.

dkrizic commented 1 month ago

Argh, I just found out that version 1.2.0 as of 2024-08 has this new "feature":

Feature

  • Supports NFS protocols (including NFSv3, NFSv4, and NFSv4.1) for storage classes.

Limitation

  • SMB/NFS PVs can only be created on Btrfs volumes because ext4 volumes do not support quota configuration for shared folders.

I will try with the older 1.1.3

AreYouLoco commented 1 month ago

I am using iSCSI and I succesfully created RWX volumes on latest version of a chart with ext4.

Edit: Actually I am wrong all of them are RWO. Sorry for trouble

dkrizic commented 1 month ago

~I am using iSCSI and I succesfully created RWX volumes on latest version of a chart with ext4.~

Edit: Actually I am wrong all of them are RWO. Sorry for trouble

You confused me, because iSCSI is a block storage and can only be used by one host at a time.

dkrizic commented 1 month ago

Now I am running into this problem:

2024-10-22T12:25:16Z [INFO] [driver/utils.go:105] GRPC request: {"capacity_range":{"required_bytes":1073741824},"name":"pvc-3b88c59a-b703-4c66-a3cb-465a1e707e29","parameters":{"csi.storage.k8s.io/pv/name":"pvc-3b88c59a-b703-4c66-a3cb-465a1e707e29","csi.storage.k8s.io/pvc/name":"smb","csi.storage.k8s.io/pvc/namespace":"default","dsm":"10.10.2.45","formatOptions":"-E nodiscard","location":"/volume1","mountPermissions":"0750","protocol":"smb"},"volume_capabilities":[{"AccessType":{"Mount":{"mount_flags":["mfsymlinks"]}},"access_mode":{"mode":5}}]}
2024-10-22T12:25:17Z [ERROR] [driver/utils.go:108] GRPC error: rpc error: code = AlreadyExists desc = Already existing volume name with different capacity

I saw it the issue somewhere else, so obviously this issue is done. Unluckily I have to stick with the older version and I think my good old RS214 is really old :-)