Closed blackpiglet closed 3 months ago
The testbed was destroyed, so I didn't have a chance to check in what case the restoreSize may be nil but I'll add some checks when generating the volumeInfo is initialized.
@reasonerjt @yuanqijing The VolumeSnapshot.Status.RestoreSize can be 0 or nil comes from the CSI Spec.
// Information about a specific snapshot.
message Snapshot {
// This is the complete size of the snapshot in bytes. The purpose of
// this field is to give CO guidance on how much space is needed to
// create a volume from this snapshot. The size of the volume MUST NOT
// be less than the size of the source snapshot. This field is
// OPTIONAL. If this field is not set, it indicates that this size is
// unknown. The value of this field MUST NOT be negative and a size of
// zero means it is unspecified.
int64 size_bytes = 1;
Typically in these situations my organization has reused the PVC size if not available or 0 on restore. So far no issues with that.
It has been a long time since I've seen it set to 0 in VolumeSnapshot.Status.RestoreSize. And that was a bug in early versions of IBM Spectrum Scale CSI driver at the time.
The PVC size request turns into the CapacityRange.required_bytes field. Supposedly optional, but I'm not aware of how well most drivers deal with the size request of 0.
What steps did you take and what happened:
The restore with CSI volume failed with crash, and the trace is:
What did you expect to happen: The restore should complete without error.
The following information will help us better understand what's going on: The code here should check whether the size and status is nil before using. https://github.com/vmware-tanzu/velero/blob/21366795d147348b66a31a9e905de202222c9492/internal/volume/volumes_information.go#L779
If you are using velero v1.7.0+:
Please use
velero debug --backup <backupname> --restore <restorename>
to generate the support bundle, and attach to this issue, more options please refer tovelero debug --help
If you are using earlier versions:
Please provide the output of the following commands (Pasting long output into a GitHub gist or other pastebin is fine.)
kubectl logs deployment/velero -n velero
velero backup describe <backupname>
orkubectl get backup/<backupname> -n velero -o yaml
velero backup logs <backupname>
velero restore describe <restorename>
orkubectl get restore/<restorename> -n velero -o yaml
velero restore logs <restorename>
Anything else you would like to add:
Environment:
velero version
): v1.14.0-rc.2velero client config get features
): EnableCSIkubectl version
): v1.29/etc/os-release
): UbuntuVote on this issue!
This is an invitation to the Velero community to vote on issues, you can see the project's top voted issues listed here.
Use the "reaction smiley face" up to the right of this comment to vote.