-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
restoreSize field not being set for the snapshots created for VolumeGroupSnapshot #1271
Comments
Can you check "oc get volumesnapshotcontent -o yaml snapcontent-f2439c5900140e7bf4f5eda7d652a589cf6ae3f8893d057355dca060fc59fe37"? |
|
@leonardoce can you take a look of this? |
Here are few other things that I noticed while testing, there is some mismatch between the releases and crds I am using latest v1beta crds and trying to create volumegorupsnapshot with v8.0.2 controller and sidecar
in addition to this, I see the featuregates PR is not included in v8.0.2, it still uses the enable-volume-group-snapshot flag @leonardoce can you please help me to verify this |
/assign |
Hi @yati1998. This is an example: apiVersion: groupsnapshot.storage.k8s.io/v1beta1
kind: VolumeGroupSnapshot
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"groupsnapshot.storage.k8s.io/v1beta1","kind":"VolumeGroupSnapshot","metadata":{"annotations":{},"name":"new-groupsnapshot-demo","namespace":"default"},"spec":{"source":{"selector":{"matchLabels":{"cnpg.io/instanceName":"cluster-example-1"}}},"volumeGroupSnapshotClassName":"csi-hostpath-groupsnapclass"}}
creationTimestamp: "2025-02-25T08:01:17Z"
finalizers:
- groupsnapshot.storage.kubernetes.io/volumegroupsnapshot-bound-protection
generation: 1
name: new-groupsnapshot-demo
namespace: default
resourceVersion: "4863"
uid: 33a7dcdc-9e6c-4772-971d-bcb44ec06ad8
spec:
source:
selector:
matchLabels:
cnpg.io/instanceName: cluster-example-1
volumeGroupSnapshotClassName: csi-hostpath-groupsnapclass
status:
boundVolumeGroupSnapshotContentName: groupsnapcontent-33a7dcdc-9e6c-4772-971d-bcb44ec06ad8
creationTime: "2025-02-25T08:01:17Z"
readyToUse: true apiVersion: groupsnapshot.storage.k8s.io/v1beta1
kind: VolumeGroupSnapshotContent
metadata:
creationTimestamp: "2025-02-25T08:01:17Z"
finalizers:
- groupsnapshot.storage.kubernetes.io/volumegroupsnapshotcontent-bound-protection
generation: 1
name: groupsnapcontent-33a7dcdc-9e6c-4772-971d-bcb44ec06ad8
resourceVersion: "4829"
uid: f82e85dc-6d2c-44a2-9cdd-0cc82616c36c
spec:
deletionPolicy: Delete
driver: hostpath.csi.k8s.io
source:
volumeHandles:
- 0fbf45f6-f34d-11ef-be86-febd037d90a9
- 0fbf538f-f34d-11ef-be86-febd037d90a9
volumeGroupSnapshotClassName: csi-hostpath-groupsnapclass
volumeGroupSnapshotRef:
apiVersion: groupsnapshot.storage.k8s.io/v1beta1
kind: VolumeGroupSnapshot
name: new-groupsnapshot-demo
namespace: default
resourceVersion: "4814"
uid: 33a7dcdc-9e6c-4772-971d-bcb44ec06ad8
status:
creationTime: "2025-02-25T08:01:17Z"
readyToUse: true
volumeGroupSnapshotHandle: b0ff8842-f34e-11ef-be86-febd037d90a9
volumeSnapshotHandlePairList:
- snapshotHandle: b0ff885d-f34e-11ef-be86-febd037d90a9
volumeHandle: 0fbf45f6-f34d-11ef-be86-febd037d90a9
- snapshotHandle: b1490bba-f34e-11ef-be86-febd037d90a9
volumeHandle: 0fbf538f-f34d-11ef-be86-febd037d90a9 As you can see, the generated VolumeSnapshots have the apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshot
metadata:
creationTimestamp: "2025-02-25T08:01:18Z"
finalizers:
- snapshot.storage.kubernetes.io/volumesnapshot-in-group-protection
- snapshot.storage.kubernetes.io/volumesnapshot-as-source-protection
generation: 1
name: snapshot-80c588a540d3152c8ab374e3badbd43ee04c6f62e5ecf55c13bac761520599c3
namespace: default
ownerReferences:
- apiVersion: groupsnapshot.storage.k8s.io/v1beta1
kind: VolumeGroupSnapshot
name: new-groupsnapshot-demo
uid: 33a7dcdc-9e6c-4772-971d-bcb44ec06ad8
resourceVersion: "4853"
uid: 90369e82-427d-4d8b-a0c6-1fd402bf5b49
spec:
source:
persistentVolumeClaimName: cluster-example-1
status:
boundVolumeSnapshotContentName: snapcontent-80c588a540d3152c8ab374e3badbd43ee04c6f62e5ecf55c13bac761520599c3
creationTime: "2025-02-25T08:01:17Z"
readyToUse: true
restoreSize: 1Gi
volumeGroupSnapshotName: new-groupsnapshot-demo apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotContent
metadata:
annotations:
groupsnapshot.storage.k8s.io/volumeGroupSnapshotHandle: b0ff8842-f34e-11ef-be86-febd037d90a9
creationTimestamp: "2025-02-25T08:01:18Z"
finalizers:
- snapshot.storage.kubernetes.io/volumesnapshotcontent-bound-protection
generation: 2
name: snapcontent-80c588a540d3152c8ab374e3badbd43ee04c6f62e5ecf55c13bac761520599c3
resourceVersion: "4844"
uid: d3b16508-54ba-4756-9021-a6374a600f29
spec:
deletionPolicy: Delete
driver: hostpath.csi.k8s.io
source:
volumeHandle: 0fbf45f6-f34d-11ef-be86-febd037d90a9
sourceVolumeMode: Filesystem
volumeSnapshotRef:
kind: VolumeSnapshot
name: snapshot-80c588a540d3152c8ab374e3badbd43ee04c6f62e5ecf55c13bac761520599c3
namespace: default
uid: 90369e82-427d-4d8b-a0c6-1fd402bf5b49
status:
creationTime: 1740470477430996381
readyToUse: true
restoreSize: 1073741824
snapshotHandle: b0ff885d-f34e-11ef-be86-febd037d90a9
volumeGroupSnapshotHandle: b0ff8842-f34e-11ef-be86-febd037d90a9 |
@leonardoce can you please try the same with v8.2.0? I tried with v8.2.0 and csi driver and it had missing restore size, if this even fails, we can check, maybe it is csi driver |
@leonardoce with host path things might be working because of optional RPC implementation of LIST operation, as its optional not all csi driver have implemented it. |
I confirm everything looks good with 8.2.0 and csi-driver-host-path. apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshot
metadata:
creationTimestamp: "2025-02-25T13:11:11Z"
finalizers:
- snapshot.storage.kubernetes.io/volumesnapshot-in-group-protection
- snapshot.storage.kubernetes.io/volumesnapshot-as-source-protection
generation: 1
name: snapshot-066a9ce7dc0e49b12da217db669e267bb73f7a5f54b3082c7fde7c33f36267b4
namespace: default
ownerReferences:
- apiVersion: groupsnapshot.storage.k8s.io/v1beta1
kind: VolumeGroupSnapshot
name: new-groupsnapshot-demo
uid: 0b271bb7-a4db-44da-bd97-58e52e701d9a
resourceVersion: "3309"
uid: 4e5e429e-830b-410a-b2b9-9204da6b9e7d
spec:
source:
persistentVolumeClaimName: cluster-example-1
status:
boundVolumeSnapshotContentName: snapcontent-066a9ce7dc0e49b12da217db669e267bb73f7a5f54b3082c7fde7c33f36267b4
creationTime: "2025-02-25T13:11:10Z"
readyToUse: true
restoreSize: 1Gi
volumeGroupSnapshotName: new-groupsnapshot-demo
---
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotContent
metadata:
annotations:
groupsnapshot.storage.k8s.io/volumeGroupSnapshotHandle: fb577341-f379-11ef-a02a-8edf8cccdddf
creationTimestamp: "2025-02-25T13:11:11Z"
finalizers:
- snapshot.storage.kubernetes.io/volumesnapshotcontent-bound-protection
generation: 2
name: snapcontent-066a9ce7dc0e49b12da217db669e267bb73f7a5f54b3082c7fde7c33f36267b4
resourceVersion: "3299"
uid: 4e0aae1a-5231-4c74-9725-18ba35718555
spec:
deletionPolicy: Delete
driver: hostpath.csi.k8s.io
source:
volumeHandle: b2083446-f379-11ef-a02a-8edf8cccdddf
sourceVolumeMode: Filesystem
volumeSnapshotRef:
kind: VolumeSnapshot
name: snapshot-066a9ce7dc0e49b12da217db669e267bb73f7a5f54b3082c7fde7c33f36267b4
namespace: default
uid: 4e5e429e-830b-410a-b2b9-9204da6b9e7d
status:
creationTime: 1740489070517946266
readyToUse: true
restoreSize: 1073741824
snapshotHandle: fb577350-f379-11ef-a02a-8edf8cccdddf
volumeGroupSnapshotHandle: fb577341-f379-11ef-a02a-8edf8cccdddf I directly used the image you can find in the registry for this test ( |
This is far more difficult to debug for me as I don't have access to your implementation. From what I can see, we get the snapshots size from the The The I guess this is what you are experiencing. Can you confirm @Madhu-1 ? |
Yes thats correct, after the rework on this PR #1171 we got into this one. |
|
Seems the fix should be in snapshot-controller in this case, while individual snapshot is getting created ?? |
We don't have access to the CSI driver there and we don't have that info. |
Discussed with @leonardoce about this. We can call GetVolumeGroupSnapshot in csi-snapshotter to update the restoreSize of VolumeSnapshotContent. That should return a list of "message Snapshot" which contains size_bytes (the restore size). CSI driver supporting CREATE_DELETE_GET_VOLUME_GROUP_SNAPSHOT capability is required to implement GetVolumeGroupSnapshot. Basically we have the same capability for create/delete/get volume group snapshot. |
@xing-yang do we need remove optional in the statement at https://github.com/container-storage-interface/spec/blob/master/spec.md#getvolumegroupsnapshot because its not optional or is it correct one? |
I found another problem in that code: we're using the I'm fixing that too by recovering the reference to the cc: @Madhu-1 |
@Madhu-1 Actually it is still "optional" because a CSI driver is not required to implement it. We also have the line below that stated a driver must implement it if the capability is supported.
|
@xing-yang For me it created a confusion where its optional and also must be implemented if CSI Driver has CREATE_DELETE_GET_VOLUME_GROUP_SNAPSHOT capability, because we have only one capability i.e |
@Madhu-1 I submitted a PR to remove "optional": container-storage-interface/spec#580 |
The VolumeSnapshot and VolumeSnapshotContent that get created for VolumeGroupSnapshot do not have the "restoreSize" field in the status section
Steps to Reproduce:
Create a PVC
Create VolumeGroupSnapshot for the above PVC/s
Check the VolumeSnapshot and VolumeSnapshotContent resources
The text was updated successfully, but these errors were encountered: