Skip to content
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

VolumeGroupSnapshot static provisioning not working #1153

Open
jmccormick2001 opened this issue Sep 6, 2024 · 9 comments
Open

VolumeGroupSnapshot static provisioning not working #1153

jmccormick2001 opened this issue Sep 6, 2024 · 9 comments

Comments

@jmccormick2001
Copy link

jmccormick2001 commented Sep 6, 2024

What happened:

I'm creating a static provisioning test for a VolumeGroupSnapshot, I'm getting errors when I create the VolumeGroupSnapshot when it refers to a statically provisioned VolumeGroupSnapshotContent. The error on the VolumeGroupSnapshot is as follows:

apiVersion: groupsnapshot.storage.k8s.io/v1alpha1
kind: VolumeGroupSnapshot
metadata:
  creationTimestamp: "2024-09-06T20:15:22Z"
  generation: 1
  name: mygroup-groupsnapshot-static
  namespace: infinidat-csi
  resourceVersion: "1041067"
  uid: cd3a727b-8520-4f4b-af7a-447f46224958
spec:
  source:
    volumeGroupSnapshotContentName: statically-created-content
  volumeGroupSnapshotClassName: infinibox-groupsnapclass
status:
  error:
    message: 'GroupSnapshot failed to bind VolumeGroupSnapshotContent, VolumeGroupSnapshotContent.groupsnapshot.storage.k8s.io
      "statically-created-content" is invalid: spec.volumeGroupSnapshotRef: Invalid
      value: "object": volumeGroupSnapshotRef is immutable'
    time: "2024-09-06T20:15:22Z"
  readyToUse: false

I was able to create the VolumeGroupSnapshotContent as folllows:

apiVersion: groupsnapshot.storage.k8s.io/v1alpha1
kind: VolumeGroupSnapshotContent
metadata:
  annotations:
    groupsnapshot.storage.kubernetes.io/deletion-secret-name: infinibox-creds
    groupsnapshot.storage.kubernetes.io/deletion-secret-namespace: infinidat-csi
  name: statically-created-content
spec:
  deletionPolicy: Delete
  driver: infinibox-csi-driver
  source:
    groupSnapshotHandles:
      volumeGroupSnapshotHandle: "138869243" 
      volumeSnapshotHandles:
      - 138869241$$iscsi 
  volumeGroupSnapshotClassName: infinibox-groupsnapclass
  volumeGroupSnapshotRef:
    apiVersion: groupsnapshot.storage.k8s.io/v1alpha1
    kind: VolumeGroupSnapshot
    name: mygroup-groupsnapshot-static
    namespace: infinidat-csi

I tried creating the VolumeGroupSnapshotContent without the volumeGroupSnapshotRef but it will not let me, it gives
this error:

15:11:51 ~/infinidat-csi-driver/deploy/examples/volumegroup/static (CSIC-763*) $ kubectl create -f content-example.yaml
The VolumeGroupSnapshotContent "statically-created-content" is invalid: spec.volumeGroupSnapshotRef: Invalid value: "object": both volumeGroupSnapshotRef.name and volumeGroupSnapshotRef.namespace must be set

15:11:56 ~/infinidat-csi-driver/deploy/examples/volumegroup/static (CSIC-763*) $ vi content-example.yaml

15:12:31 ~/infinidat-csi-driver/deploy/examples/volumegroup/static (CSIC-763*) $ kubectl create -f content-example.yaml
The VolumeGroupSnapshotContent "statically-created-content" is invalid: 
* spec.volumeGroupSnapshotRef: Required value
* <nil>: Invalid value: "null": some validation rules were not checked because the object was invalid; correct the existing errors to complete validation

What you expected to happen:

I expected the VolumeGroupSnapshot to create as normal, binding to the VolumeGroupSnapshotContent.

How to reproduce it:

Static provision a VolumeGroupSnapshotContent, then try to create a VolumeGroupSnapshot based on that content.

Anything else we need to know?:

Environment:

  • Driver version:
  • Kubernetes version (use kubectl version): 1.30
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others: snapshottersidecar: "registry.k8s.io/sig-storage/csi-snapshotter@sha256:2e04046334baf9be425bb0fa1d04c2d1720d770825eedbdbcdb10d430da4ad8c" # v8.0.1
@xing-yang
Copy link
Collaborator

Can you provide "kubectl get volumegroupsnapshotcontent statically-created-content -o yaml"?

@jmccormick2001
Copy link
Author

apiVersion: groupsnapshot.storage.k8s.io/v1alpha1
kind: VolumeGroupSnapshotContent
metadata:
  annotations:
    groupsnapshot.storage.kubernetes.io/deletion-secret-name: infinibox-creds
    groupsnapshot.storage.kubernetes.io/deletion-secret-namespace: infinidat-csi
  creationTimestamp: "2024-09-06T20:13:27Z"
  generation: 1
  name: statically-created-content
  resourceVersion: "1041007"
  uid: d117dc6b-e84a-4ae5-887a-7a893b750ddc
spec:
  deletionPolicy: Delete
  driver: infinibox-csi-driver
  source:
    groupSnapshotHandles:
      volumeGroupSnapshotHandle: "138869243"
      volumeSnapshotHandles:
      - 138869241$$iscsi
  volumeGroupSnapshotClassName: infinibox-groupsnapclass
  volumeGroupSnapshotRef:
    apiVersion: groupsnapshot.storage.k8s.io/v1alpha1
    kind: VolumeGroupSnapshot
    name: mygroup-groupsnapshot-static
    namespace: infinidat-csi
status:
  creationTime: 1725653607991052659
  readyToUse: true
  volumeGroupSnapshotHandle: "138869243"

@xing-yang
Copy link
Collaborator

Who set the Status of VolumeGroupSnapshotContent? Is it by the Group Snapshot Controller or did you have some other controller logic that did it? Since the status is already "readyToUse", it seems that VolumeGroupSnapshot mygroup-groupsnapshot-static already exists?

Please provide logs from snapshot-controller and csi-snapshotter.

@jmccormick2001
Copy link
Author

let me verify that I'm attempting this in the right sequence: Here is what I'm trying:

  • create a VolumeGroupSnapshotContent from a yaml file, when I do this, the GetVolumeGroupSnapshot() logic gets called in our CSI driver
  • once that is created and Ready, then I am trying to create a VolumeGroupSnapshot that references the content just created

Is this the correct sequence I should follow? just want to confirm this is the sequence. I'll send logs on Monday. I 'think' the status is getting set by the snapshot-controller but can verify with the logs.

@jmccormick2001
Copy link
Author

snapshot controller and side car logs attached.
snapshot-controller.log
snapshotter.log

@nixpanic
Copy link
Member

nixpanic commented Nov 8, 2024

@yati1998 and I tested static provisioning with #1184 applied (currently merged in the master branch), and with that we can statically provision a VolumeGroupSnapshotContent and bind it with a VolumeGroupSnapshot without validation errors.

@yati1998
Copy link
Contributor

yati1998 commented Nov 8, 2024

Here are the steps to be followed:

  • Create VGS dynamically
  • edit the VGSC to have deletion policy to be retain
  • edit snapshotcontent with deletion policy as retain
  • copy the volumegroup handle and snapshot handles to be used in static provisioing yaml file
  • Delete the VGS and VGSC
  • Create VGSC with above handles
  • Create VGS with above VGSC
    this will bind the VGSC to VGS statically

@xing-yang
Copy link
Collaborator

xing-yang commented Nov 15, 2024

How are individual VolumeSnapshots handled in this case?

@yati1998
Copy link
Contributor

yati1998 commented Nov 18, 2024

How are individual VolumeSnapshots handled in this case?

Each snapshot if deleted has to be created with source as volumesnapshotcontent

cc @nixpanic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants