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

Unable to take CSI snapshot with Velero and having hard time to find information about how to do it #8542

Open
pew-x2 opened this issue Dec 22, 2024 · 2 comments
Labels
Area/CSI Related to Container Storage Interface support Needs info Waiting for information

Comments

@pew-x2
Copy link

pew-x2 commented Dec 22, 2024

What steps did you take and what happened:
I'm failing to understand how to take a snapshot of a PersistentVolume using CSI in Velero v1.15.

What did you expect to happen:
I expected to get a snapshot when running backup that would backup the files of the persistent volume.

  features: EnableCSI
  • settings fro volumeSnapshotLocation in values.yaml looks like this
  volumeSnapshotLocation:
    # name is the name of the volume snapshot location where snapshots are being taken. Required.
  - name: volume-snapshot-location-1
    # provider is the name for the volume snapshot provider.
    provider: aws
    credential:
      # name of the secret used by this volumeSnapshotLocation.
      name: velero-secret
      # name of key that contains the secret data to be used.
      key: credentials
    # Additional provider-specific configuration. See link above
    # for details of required/optional fields for your provider.
    config: # {}
      region: None
  #    region:
  #    apiTimeout:
  #    resourceGroup:
  #    The ID of the subscription where volume snapshots should be stored, if different from the cluster’s subscription. If specified, also requires `configuration.volumeSnapshotLocation.config.resourceGroup`to be set. (Azure only)
  #    subscriptionId:
  #    incremental:
  #    snapshotLocation:
  #    project:

The following information will help us better understand what's going on:

This is the log I get when I try to run the backup:

time="2024-12-22T14:44:37Z" level=info msg="Backing up item" backup=backup/test logSource="pkg/backup/item_backupper.go:184" name=db-backup-stage-pv namespace= resource=persistentvolumes
time="2024-12-22T14:44:37Z" level=info msg="Executing takePVSnapshot" backup=backup/test logSource="pkg/backup/item_backupper.go:549" name=db-backup-stage-pv namespace= resource=persistentvolumes
time="2024-12-22T14:44:38Z" level=info msg="performing snapshot action for pv %!s(MISSING) as the snapshotVolumes is not set to false" backup=backup/test logSource="internal/volumehelper/volume_policy_helper.go:131"
time="2024-12-22T14:44:38Z" level=info msg="label \"topology.kubernetes.io/zone\" is not present on PersistentVolume, checking deprecated label..." backup=backup/test logSource="pkg/backup/item_backupper.go:608" name=db-backup-stage-pv namespace= persistentVolume=db-backup-stage-pv resource=persistentvolumes
time="2024-12-22T14:44:38Z" level=info msg="label \"failure-domain.beta.kubernetes.io/zone\" is not present on PersistentVolume" backup=backup/test logSource="pkg/backup/item_backupper.go:612" name=db-backup-stage-pv namespace= persistentVolume=db-backup-stage-pv resource=persistentvolumes
time="2024-12-22T14:44:38Z" level=info msg="zone info not available in nodeAffinity requirements" backup=backup/test logSource="pkg/backup/item_backupper.go:617" name=db-backup-stage-pv namespace= persistentVolume=db-backup-stage-pv resource=persistentvolumes
time="2024-12-22T14:44:38Z" level=warning msg="No volume ID returned by volume snapshotter for persistent volume" backup=backup/test logSource="pkg/backup/item_backupper.go:641" name=db-backup-stage-pv namespace= persistentVolume=db-backup-stage-pv resource=persistentvolumes volumeSnapshotLocation=volume-snapshot-location-1
time="2024-12-22T14:44:38Z" level=info msg="Persistent volume is not a supported volume type for Velero-native volumeSnapshotter snapshot, skipping." backup=backup/test logSource="pkg/backup/item_backupper.go:653" name=db-backup-stage-pv namespace= persistentVolume=db-backup-stage-pv resource=persistentvolumes
time="2024-12-22T14:44:38Z" level=info msg="Backed up 1 items out of an estimated total of 1 (estimate will change throughout the backup)" backup=backup/test logSource="pkg/backup/backup.go:499" name=db-backup-stage-pv namespace= progress= resource=persistentvolumes
time="2024-12-22T14:44:38Z" level=info msg="Summary for skipped PVs: [{\"name\":\"db-backup-stage-pv\",\"reasons\":[{\"approach\":\"volumeSnapshot\",\"reason\":\"no applicable volumesnapshotter found\"}]}]" backup=backup/test logSource="pkg/backup/backup.go:542"
time="2024-12-22T14:44:38Z" level=info msg="Backed up a total of 1 items" backup=backup/test logSource="pkg/backup/backup.go:546" progress=

Here is the snapshot classes and storageclass

---

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: csi-hostpath-sc
provisioner: hostpath.csi.k8s.io
reclaimPolicy: Delete
volumeBindingMode: Immediate

---

apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
metadata:
  name: csi-hostpath-sc
  labels:
    velero.io/csi-volumesnapshot-class: "true"
driver: hostpath.csi.k8s.io
deletionPolicy: Delete

Anything else you would like to add:

Environment:

  • Velero version (use velero version): v1.15.0
  • Velero features (use velero client config get features): "" returned
  • Kubernetes version (use kubectl version): v1.30.5
  • Kubernetes installer & version: docker desktop
  • Cloud provider or hardware configuration: none
  • OS (e.g. from /etc/os-release): Mac OSX 14.6.1

Vote 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.

  • 👍 for "I would like to see this bug fixed as soon as possible"
  • 👎 for "There are more important bugs to focus on right now"
@reasonerjt
Copy link
Contributor

I haven't tried the hostpath CSI driver. It seems for some reason the CSI plugin was skipped during your backup
Please collect the debug bundle via velero debug --backup xxxx and attach to this issue

@reasonerjt reasonerjt added Needs info Waiting for information Area/CSI Related to Container Storage Interface support labels Dec 22, 2024
@pew-x2
Copy link
Author

pew-x2 commented Dec 22, 2024

Here is output from velero debug --backup test -n backup

bundle-2024-12-22-20-31-30.tar.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/CSI Related to Container Storage Interface support Needs info Waiting for information
Projects
None yet
Development

No branches or pull requests

2 participants