Unsolved
5 Posts
0
1812
September 3rd, 2020 14:00
Issue where volumeSnapshots have 'ReadyToUse' field set to false.
Hi,
I ran into an issue when I create a VolumeSnapshotContent and a VolumeSnapshot. The volumeSnapshot never enters the 'ReadyToUse: True' state. Here is an example of the VolumeSnapshot-
- apiVersion: snapshot.storage.k8s.io/v1alpha1
kind: VolumeSnapshot
metadata:
creationTimestamp: "2020-09-01T20:15:49Z"
finalizers:
- snapshot.storage.kubernetes.io/volumesnapshot-protection
generation: 2
name: <>
namespace: <>
resourceVersion: <>
selfLink: <>
uid: <>
spec:
snapshotClassName:<>
snapshotContentName: <>
source: null
status:
creationTime: "2020-09-01T19:26:46Z"
readyToUse: false
restoreSize: 80Gi
After some debugging, I observed that the csi-snapshotter attempts to reconcile the volumesnapshot with the content periodically.
It attempts to get the underlying Snapshot status by performing a ListSnapshots operation. https://github.com/kubernetes-csi/external-snapshotter/blob/d24d2b9820079c6658e1078d59071aebb6e0d467/pkg/snapshotter/snapshotter.go#L132
This call succeeds but doesn't set the 'ReadyToUse' field. It results in default 'False' value and never marks the VolumeSnapshot as 'ReadyToUse'
Reference to ListSnapshots->getCSISnapshot Operation - https://github.com/dell/csi-vxflexos/blob/2facca1c4ff7256763b0b2d892b1ff2880156fd5/service/service.go#L320
An example of how others implement this- https://github.com/kubernetes-sigs/aws-ebs-csi-driver/blob/b0079ef15ef984ab550fd5bc709f6a3fd5cc1cdd/pkg/cloud/cloud.go#L628