yunify / qingstor-csi

neonsan csi plugin for kubernetes
Apache License 2.0
14 stars 13 forks source link

Can not restore PVC from snapshot if original volume is deleted #50

Open stoneshi-yunify opened 3 years ago

stoneshi-yunify commented 3 years ago

csi-neonsan: v1.2.1

To recreate:

Confirmed with neonsan team, this is expected. Deleting the PVC will delete all of things (including its snapshots), so the snapshot in neonsan has been removed as well.

Well, this might not meet k8s snapshot's purpose, which does not reply on the original pvc.

Possible solutions:

log:

I1218 08:02:57.129644       1 interceptor.go:42] GRPC /csi.v1.Controller/CreateVolume request: {"capacity_range":{"required_bytes":2147483648},"name":"pvc-499efce1-1363-49ed-af58-a1f9e120e3b9","parameters":{"fsType":"ext4","pool_name":"kube","rep_count":"1"},"volume_capabilities":[{"AccessType":{"Mount":{"fs_type":"ext4"}},"access_mode":{"mode":1}}],"volume_content_source":{"Type":{"Snapshot":{"snapshot_id":"kube/pvc-d2129965-8b58-46e9-95ab-e278d7aa3bd6@snapshot-1fcbac51-b9f0-4965-9b86-1b812308ea07"}}}} 516d1d5f
I1218 08:02:57.134390       1 controller.go:42] Get required creating volume size 2147483648(2Gi)
I1218 08:02:57.143835       1 api.go:268] NeonsanApi request:http://192.168.0.25:2600/qfa?pool_name=kube&name=pvc-499efce1-1363-49ed-af58-a1f9e120e3b9&op=list_volume&
I1218 08:02:57.159127       1 api.go:287] NeonsanApi response:{"op":"list_volume_reply","ret_code":0,"reason":"","count":0,"volumes":[]}, request:http://192.168.0.25:2600/qfa?pool_name=kube&name=pvc-499efce1-1363-49ed-af58-a1f9e120e3b9&op=list_volume&
I1218 08:02:57.179146       1 api.go:268] NeonsanApi request:http://192.168.0.25:2600/qfa?op=list_snapshot&pool_name=kube&volume_name=pvc-d2129965-8b58-46e9-95ab-e278d7aa3bd6&snapshot_name=snapshot-1fcbac51-b9f0-4965-9b86-1b812308ea07&
I1218 08:02:57.183079       1 api.go:287] NeonsanApi response:{"op":"list_snapshot_reply","ret_code":-102,"reason":"Volume not exists"}, request:http://192.168.0.25:2600/qfa?op=list_snapshot&pool_name=kube&volume_name=pvc-d2129965-8b58-46e9-95ab-e278d7aa3bd6&snapshot_name=snapshot-1fcbac51-b9f0-4965-9b86-1b812308ea07&
E1218 08:02:57.183158       1 interceptor.go:58] GRPC /csi.v1.Controller/CreateVolume error: rpc error: code = Internal desc = list snapshot error:Volume not exists req:{"capacity_range":{"required_bytes":2147483648},"name":"pvc-499efce1-1363-49ed-af58-a1f9e120e3b9","parameters":{"fsType":"ext4","pool_name":"kube","rep_count":"1"},"volume_capabilities":[{"AccessType":{"Mount":{"fs_type":"ext4"}},"access_mode":{"mode":1}}],"volume_content_source":{"Type":{"Snapshot":{"snapshot_id":"kube/pvc-d2129965-8b58-46e9-95ab-e278d7aa3bd6@snapshot-1fcbac51-b9f0-4965-9b86-1b812308ea07"}}}} 516d1d5f