Closed Encounter77 closed 5 months ago
I want to ask, how should the restoreSize under status in VolumeSnapshot be understood, and how should the capacity of new PVC be set when doing snapshot recovery? Is there any relevant specification definition or constraint?
This will be the minimal size from which you can create a PVC, you can also create PVC with higher size where csi driver can handle the resize internal or fail
If I set it to 1Gi, when I create this new PVC (PVC-a-snapshot), its status is Pending and its event is: failed to provision volume with StorageClass "sc-cephfs-p ublic": rpc error: code = InvalidArgument desc = cannot restore from snapshot 0001-0024-f5ce1382-89b3-11ee-b4e7-09835dada8ce-0000000000000001-2a44e850-e01a-11ee-973c-fa163e14a5b9: volume size 2147483648 is smaller than source volume size 1073741824
This could be a problem with csi driver, as this is cephcsi, this is fixed few releases back, please feel to test latest build and file with ceph-csi
I want to ask, how should the restoreSize under status in VolumeSnapshot be understood, and how should the capacity of new PVC be set when doing snapshot recovery? Is there any relevant specification definition or constraint?
This will be the minimal size from which you can create a PVC, you can also create PVC with higher size where csi driver can handle the resize internal or fail
If I set it to 1Gi, when I create this new PVC (PVC-a-snapshot), its status is Pending and its event is: failed to provision volume with StorageClass "sc-cephfs-p ublic": rpc error: code = InvalidArgument desc = cannot restore from snapshot 0001-0024-f5ce1382-89b3-11ee-b4e7-09835dada8ce-0000000000000001-2a44e850-e01a-11ee-973c-fa163e14a5b9: volume size 2147483648 is smaller than source volume size 1073741824
This could be a problem with csi driver, as this is cephcsi, this is fixed few releases back, please feel to test latest build and file with ceph-csi
thanks bro, I find this issue: https://github.com/ceph/ceph-csi/issues/3147. I will upgrade csi-driver version and try again!
What happened:
I want to ask, how should the restoreSize under status in VolumeSnapshot be understood, and how should the capacity of new PVC be set when doing snapshot recovery? Is there any relevant specification definition or constraint?
A review of the documentation did not find any set requirements or constraints on the capacity, except that it should not be less than the restoreSize value. https://kubernetes-csi.github.io/docs/api/volume-snapshot.html?highlight=restoreSize#snapshot.storage.k8s.io/v1.VolumeSnapshotSpec
What you expected to happen:
The status of snapshot recovery volume PVC should not be Pending.
How to reproduce it:
Question 1 If I set it to 500Mi, when I create this new PVC (PVC-a-snapshot), its status is Pending and its event is:
failed to provision volume with StorageClass "sc-cephfs-p ublic": error getting handle for DataSource Type VolumeSnapshot by Name volume-snapshot-a : requested volume size 524288000 is less than the size 1073741824 for the source snapshot volume-sn apshot-34
Question 2 If I set it to 1Gi, when I create this new PVC (PVC-a-snapshot), its status is Pending and its event is:
failed to provision volume with StorageClass "sc-cephfs-p ublic": rpc error: code = InvalidArgument desc = cannot restore from snapshot 0001-0024-f5ce1382-89b3-11ee-b4e7-09835dada8ce-0000000000000001-2a44e850-e01a-11ee-973c-fa163e14a5b9: volume size 2147483648 is smaller than source volume size 1073741824
Question 3 If I set it to greater than 1Gi (e.g. 1560Mi), A new PVC (PVC-a-snapshot) can be created successfully and bound to PV, with status to see that its capacity is 2Gi.
Question 4 If I set it equal to 2Gi (the size of the source PVC after expansion), A new PVC (PVC-a-snapshot) can be created successfully and bound to PV, checking status to see that its capacity is 2Gi. In this context, I can also set a value of 3Gi or greater, and the phenomenon is also described above.
Anything else we need to know?:
How should I set the capacity size of the snapshot recovery volume PVC to meet the usage requirements, is it recommended that it should be larger than the PVC capacity of the source volume?
Environment:
kubectl version
): v1.26.6uname -a
): 5.4.239-1.el8.elrepo.x86_64