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

Static volume snapshot binding failure #198

Closed
liyinan926 opened this issue Nov 25, 2019 · 9 comments
Closed

Static volume snapshot binding failure #198

liyinan926 opened this issue Nov 25, 2019 · 9 comments

Comments

@liyinan926
Copy link

liyinan926 commented Nov 25, 2019

I was playing with static volume snapshot binding by first creating a VolumeSnapshotContent object and then a VolumeSnapshot object that is supposed to be bound to the VolumeSnapshotContent object by the external-snapshotter. However, I'm getting the following error:

Failed to check and update snapshot: failed to get input parameters to create snapshot <volume-snapshot-name>: "the snapshot source is not specified."

The VolumeSnapshot was created with the source field unspecified because the intention is to statically bind it to the VolumeSnapshotContent object. My understanding is that the source field is optional in this scenario, according to the comment of the field copied and pasted below.

// If not specified, user can create VolumeSnapshotContent and bind it with VolumeSnapshot manually.

The VolumeSnapshot object looks like the following:

apiVersion: snapshot.storage.k8s.io/v1alpha1
kind: VolumeSnapshot
metadata:
  name: mongo-persistent-storage-mongo-0-vs
  namespace: default
spec:
  snapshotClassName: default-snapshot-class
  snapshotContentName: snapcontent-31dffc80-073a-11ea-830c-42010a800239

I'm using the version v1.1.0 of external-snapshotter.

@xing-yang @jingxu97 @yuxiangqian

@liyinan926
Copy link
Author

liyinan926 commented Nov 25, 2019

UPDATE: I had to add a dummy source field to make it work. I think the snapshotter should not fail on an empty source field in this case.

@xing-yang
Copy link
Collaborator

@liyinan926 Have you checked the example for importing existing snapshot in this blog? https://kubernetes.io/blog/2018/10/09/introducing-volume-snapshot-alpha-for-kubernetes/

It does need a source with a CSI snapshot handle specified for static binding, otherwise there is no existing snapshot to be imported. The new beta API has these fields more clearly defined and hopefully won't be so confusing.

@liyinan926
Copy link
Author

@xing-yang I read that blog post. I meant the source field in the VolumeSnapshot, which is supposed to reference a PersistentVolumeClaim that is to be snapshotted. I did set the CSIVolumeSnapshotSource field in the VolumeSnapshotContent.

@xing-yang
Copy link
Collaborator

@liyinan926 that seems to be a bug.

@yuxiangqian
Copy link
Contributor

@liyinan926 Correct me if I am wrong please. You were trying to play with static binding feature without specifying a source? "CSIVolumeSnapshotSource" is removed from the beta version.

@liyinan926
Copy link
Author

liyinan926 commented Nov 25, 2019

@yuxiangqian I did specify the CSIVolumeSnapshotSource field in the VolumeSnapshotContent object. The issue is that static binding failed because the field source in the VolumeSnapshot object was not specified, which is supposed to reference a PersistentVolumeClaim to be snapshotted. In the case of static binding, however, this source field should not be required as the intention is not to take a snapshot of a PVC. Like what @xing-yang said, this looks like a bug. BTW: I'm using the alpha version v1.1.0. Also I don't remember I ran into this issue with version v0.4.0. This issue started to show up after I switched to version v1.1.0.

@liyinan926
Copy link
Author

liyinan926 commented Nov 26, 2019

Update: actually using a dummy source in the VolumeSnapshotSpec that points to a non-existing PVC does not work, as it resulted in the following error:

Failed to check and update snapshot: failed to get input parameters to create snapshot mongo-persistent-storage-mongo-0-vs: "failed to retrieve PVC mongo-persistent-storage-mongo-0 from the API server: "persistentvolumeclaims mongo-persistent-storage-mongo-0 not found"

So it appears that the external-snapshotter is always trying to check and get the source PersistentVolumeClaim regardlessly, and the field source essentially becomes a required field and it must reference an existing PVC.

I did something that made it appear to work. But it actually doesn't work, and it looks that static binding is broken.

@liyinan926
Copy link
Author

liyinan926 commented Nov 26, 2019

@xing-yang @yuxiangqian Looks like the issue I ran into was fixed in #98. Looks like the GCE PD CSI driver I use still uses an older version of external-snapshotter that doesn't contain that fix. Will try it with a newer version of the driver and verify.

@liyinan926
Copy link
Author

I tried a newer version of the PD CSI driver with csi-snapshotter version v1.1.0 and verified that static binding works as expected with an empty source field in VolumeSnapshotSpec. Thanks for helping!

mowangdk added a commit to mowangdk/external-snapshotter that referenced this issue Aug 6, 2023
670bb0e Merge pull request kubernetes-csi#229 from marosset/fix-codespell-errors
35d5e78 Merge pull request kubernetes-csi#219 from yashsingh74/update-registry
63473cc Merge pull request kubernetes-csi#231 from coulof/bump-go-version-1.20.5
29a5c76 Merge pull request kubernetes-csi#228 from mowangdk/chore/adopt_kubernetes_recommand_labels
8dd2821 Update cloudbuild image with go 1.20.5
1df23db Merge pull request kubernetes-csi#230 from msau42/prow
1f92b7e Add ginkgo timeout to e2e tests to help catch any stuck tests
2b8b80e fixing some codespell errors
c10b678 Merge pull request kubernetes-csi#227 from coulof/check-sidecar-supported-versions
72984ec chore: adopt kubernetes recommand label
b055535 Header
bd0a10b typo
c39d73c Add comments
f6491af Script to verify EOL sidecar version
4133d1d Merge pull request kubernetes-csi#226 from msau42/cloudbuild
8d519d2 Pin buildkit to v0.10.6 to workaround v0.11 bug with docker manifest
6e04a03 Merge pull request kubernetes-csi#224 from msau42/cloudbuild
26fdfff Update cloudbuild image
6613c39 Merge pull request kubernetes-csi#223 from sunnylovestiramisu/update
0e7ae99 Update k8s image repo url
77e47cc Merge pull request kubernetes-csi#222 from xinydev/fix-dep-version
155854b Fix dep version mismatch
8f83905 Merge pull request kubernetes-csi#221 from sunnylovestiramisu/go-update
1d3f94d Update go version to 1.20 to match k/k v1.27
e322ce5 Merge pull request kubernetes-csi#220 from andyzhangx/fix-golint-error
b74a512 test: fix golint error
901bcb5 Update registry k8s.gcr.io -> registry.k8s.io
aa61bfd Merge pull request kubernetes-csi#218 from xing-yang/update_csi_driver
7563d19 Update CSI_PROW_DRIVER_VERSION to v1.11.0
a2171be Merge pull request kubernetes-csi#216 from msau42/process
cb98782 Merge pull request kubernetes-csi#217 from msau42/owners
a11216e add new reviewers and remove inactive reviewers
dd98675 Add step for checking builds
b66c082 Merge pull request kubernetes-csi#214 from pohly/junit-fixes
b9b6763 filter-junit.go: fix loss of testcases when parsing Ginkgo v2 JUnit
d427783 filter-junit.go: preserve system error log
38e1146 prow.sh: publish individual JUnit files as separate artifacts
78c0fb7 Merge pull request kubernetes-csi#208 from jsafrane/skip-selinux
36e433e Skip SELinux tests in CI by default
348d4a9 Merge pull request kubernetes-csi#207 from RaunakShah/reviewers
1efc272 Merge pull request kubernetes-csi#206 from RaunakShah/update-prow
7d410d8 Changes to csi prow to run e2e tests in sidecars
cfa5a75 Merge pull request kubernetes-csi#203 from humblec/test-vendor
4edd1d8 Add RaunakShah to CSI reviewers group
7ccc959 release tools update to 1.19
d24254f Merge pull request kubernetes-csi#202 from xing-yang/kind_0.14.0
0faa3fc Update to Kind v0.14.0 images
ef4e1b2 Merge pull request kubernetes-csi#201 from xing-yang/add_1.24_image
4ddce25 Add 1.24 Kind image
7fe5149 Merge pull request kubernetes-csi#200 from pohly/bump-kubernetes-version
70915a8 prow.sh: update snapshotter version
31a3f38 Merge pull request kubernetes-csi#199 from pohly/bump-kubernetes-version
7577454 prow.sh: bump Kubernetes to v1.22.0
d29a2e7 Merge pull request kubernetes-csi#198 from pohly/csi-test-5.0.0
41cb70d prow.sh: sanity testing with csi-test v5.0.0
c85a63f Merge pull request kubernetes-csi#197 from pohly/fix-alpha-testing
b86d8e9 support Kubernetes 1.25 + Ginkgo v2
ab0b0a3 Merge pull request kubernetes-csi#192 from andyzhangx/patch-1
7bbab24 Merge pull request kubernetes-csi#196 from humblec/non-alpha
e51ff2c introduce control variable for non alpha feature gate configuration
ca19ef5 Merge pull request kubernetes-csi#195 from pohly/fix-alpha-testing
3948331 fix testing with latest Kubernetes
e4dab7f Merge pull request kubernetes-csi#194 from yselkowitz/registry-k8s-io
84a4d5a Move from k8s.gcr.io to registry.k8s.io
9a0260c fix boilerplate header
37d1104 Merge pull request kubernetes-csi#191 from pohly/go-1.18
db917f5 update to Go 1.18
335339f Merge pull request kubernetes-csi#187 from mauriciopoppe/remove-eol-windows-versions
890b87a Merge pull request kubernetes-csi#188 from pwschuurman/update-release-notes-docs
274bc9b Update Sidecar Release Process documentation to reference latest syntax for release-notes tool
87b6c37 Merge pull request kubernetes-csi#185 from Garima-Negi/fix-OWNERS-files
f1de2c6 Fix OWNERS file - squashed commits
59ae38b Remove EOL windows versions from BUILD_PLATFORMS
5d66471 Merge pull request kubernetes-csi#186 from humblec/sp
d066f1b Correct prow.sh typo and make codespell linter pass
762e22d Merge pull request kubernetes-csi#184 from pohly/image-publishing-troubleshooting
81e26c3 SIDECAR_RELEASE_PROCESS.md: add troubleshooting for image publishing
31aa44d Merge pull request kubernetes-csi#182 from chrishenzie/csi-sanity-version
f49e141 Update csi-sanity test suite to v4.3.0
d9815c2 Merge pull request kubernetes-csi#181 from mauriciopoppe/armv7-support
05c1801 Add support to build arm/v7 images
4aedf35 Merge pull request kubernetes-csi#178 from xing-yang/timeout
2b9897e Increase build timeout
51d3702 Merge pull request kubernetes-csi#177 from mauriciopoppe/kind-image-1.23
a30efea Add kind image for 1.23
a6a1a79 Merge pull request kubernetes-csi#176 from pohly/go-1.17.3
0a2cf63 prow.sh: bump Go to 1.17.3
fc29fdd Merge pull request kubernetes-csi#141 from pohly/prune-replace-optional
5b9a1e0 Merge pull request kubernetes-csi#175 from jimdaga/patch-1
5eeb602 images: use k8s-staging-test-infra/gcb-docker-gcloud
b46691a go-get-kubernetes.sh: make replace statement pruning optional

git-subtree-dir: release-tools
git-subtree-split: 670bb0e
andyzhangx pushed a commit to andyzhangx/external-snapshotter that referenced this issue Jun 5, 2024
prow.sh: sanity testing with csi-test v5.0.0
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

3 participants