SynologyOpenSource / synology-csi

Apache License 2.0
527 stars 114 forks source link

LUN migration between old to new Snynology box how to reference Cloned LUN's #90

Open tzago opened 2 months ago

tzago commented 2 months ago

Referencing these issues #88 and #84 as they are somehow similar to my use case here which is how to figure out the VolumeHandle which is not present in DSM. My case is a Synology NAS migration from Snynology02 to new Synology01 box. I used the Hyper Backup to back up luns from one synology nas to another. All luns were backuped successfully although I noted that the backupd luns ISCSI IQN target got the same name as the LUN which starts with k8s-csi-pvc- While I noticed that the correct Target IQN name must start with iqn.2000-01.com.synology:x.pvc- where x in my case is my Synology Hostname.

I confirm that my cloned Lun on my new synology works fine while mounting it from the command line on my destination host. something like sudo iscsiadm --mode node --targetname iqn.2000-01.com.synology:Synology01.pvc-xxxxxx-yyyy-zzzz-wwww-ea0db6860e76 --portal 192.168.0.1:3260,0 --login But whenever I try to create a PV and PVC and use it on a new POD I get

"source":"","storage.kubernetes.io/csiProvisionerIdentity":"1726942005718-8081-csi.san.synology.com"},"volume_id":"a3bb180f-600f-455e-bc69-96773597ef28"}
2024-09-21T20:19:24Z [ERROR] [driver/utils.go:108] GRPC error: rpc error: code = Internal desc = rpc error: code = NotFound desc = Volume[a3bb180f-600f-455e-bc69-96773597ef28] is not found
2024-09-21T20:21:26Z [INFO] [driver/utils.go:104] GRPC call: /csi.v1.Node/NodeGetCapabilities

I am assuming here that what I am really missing to understand is how we can figure out what is the volumeHandle that I must set in my PV to correctly correlate it to my Cloned LUN in my new Synology which I already proved it is working via iscsiadm via cli.

In short, what is the correlation of volumeHandle and the Synology ISCSI IQN target and where I can find what is the correct volumeHandle UID to use?

This is how I am am creating my PV with main goal of having it attaching to my cloned LUN in my new Synology box.

apiVersion: v1
kind: PersistentVolume
metadata:
  annotations:
    pv.kubernetes.io/provisioned-by: csi.san.synology.com
  finalizers:
  - kubernetes.io/pv-protection
  name: pvc-47f2f3c8-f098-4c9a-95d2-ea0db6860e76
spec:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 5Gi
  csi:
    driver: csi.san.synology.com
    volumeAttributes:
      dsm: 192.168.0.1
      formatOptions: ""
      protocol: iscsi
      source: ""
      storage.kubernetes.io/csiProvisionerIdentity: 1726942005718-8081-csi.san.synology.com
    volumeHandle: a3bb180f-600f-455e-bc69-96773597ef27
  persistentVolumeReclaimPolicy: Retain
  storageClassName: synology-iscsi-storage
  volumeMode: Filesystem
james-callahan commented 1 month ago

where I can find what is the correct volumeHandle UID to use?

I ended up using synoiscsiwebapi lun list on my synology box, the uuid is what to use as the volumeHandle. I was able to match it using the name field. I can't see how to get this info in the synology web ui.