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

Cant create raw block pvc from volume snapshot #219

Closed
RaunakShah opened this issue Nov 11, 2020 · 4 comments · Fixed by #220
Closed

Cant create raw block pvc from volume snapshot #219

RaunakShah opened this issue Nov 11, 2020 · 4 comments · Fixed by #220
Assignees

Comments

@RaunakShah
Copy link
Contributor

RaunakShah commented Nov 11, 2020

While helping @xing-yang test volume snapshots, we noticed that snapshots of raw block volumes cant be used as a source to create PVCs.

  1. Create a raw block pvc
$ cat pvc-raw.yaml 
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: pvc-raw
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: csi-hostpath-sc
  volumeMode: Block
  resources:
    requests:
      storage: 1Gi
  1. Create a snapshot of the pvc
$ cat snapshot-raw.yaml 
apiVersion: snapshot.storage.k8s.io/v1beta1
kind: VolumeSnapshot
metadata:
  name: raw-pvc-snapshot
spec:
  volumeSnapshotClassName: csi-hostpath-snapclass
  source:
    persistentVolumeClaimName: pvc-raw
  1. Create a pvc with snapshot above as the source
$ cat pvc-restore-raw.yaml 
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: raw-pvc-restore
spec:
  storageClassName: csi-hostpath-sc
  volumeMode: Block
  dataSource:
    name: raw-pvc-snapshot
    kind: VolumeSnapshot
    apiGroup: snapshot.storage.k8s.io
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi

The restored PVC remains in the Pending state:

$ kubectl get pvc,volumesnapshot
NAME                                    STATUS    VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS      AGE
persistentvolumeclaim/pvc-raw           Bound     pvc-e67a6eaa-34ef-4841-a081-86900477b347   1Gi        RWO            csi-hostpath-sc   23s
persistentvolumeclaim/raw-pvc-restore   Pending                                                                        csi-hostpath-sc   1s

NAME                                                      READYTOUSE   SOURCEPVC   SOURCESNAPSHOTCONTENT   RESTORESIZE   SNAPSHOTCLASS            SNAPSHOTCONTENT                                    CREATIONTIME   AGE
volumesnapshot.snapshot.storage.k8s.io/raw-pvc-snapshot   true         pvc-raw                             1Gi           csi-hostpath-snapclass   snapcontent-313de7ed-4c5b-4f7a-804a-e4e124938279   13s            13s

$ kubectl describe pvc 
...
Name:          raw-pvc-restore
Namespace:     default
StorageClass:  csi-hostpath-sc
Status:        Pending
...
Events:
  Type     Reason                Age                From                                                                                 Message
  ----     ------                ----               ----                                                                                 -------
  Warning  ProvisioningFailed    27s                hostpath.csi.k8s.io_csi-hostpath-provisioner-0_d61fffad-7655-456e-98b4-d98fc7f6d272  failed to provision volume with StorageClass "csi-hostpath-sc": rpc error: code = DeadlineExceeded desc = context deadline exceeded
  Normal   ExternalProvisioning  14s (x3 over 37s)  persistentvolume-controller                                                          waiting for a volume to be created, either by external provisioner "hostpath.csi.k8s.io" or manually created by system administrator
  Normal   Provisioning          12s (x5 over 37s)  hostpath.csi.k8s.io_csi-hostpath-provisioner-0_d61fffad-7655-456e-98b4-d98fc7f6d272  External provisioner is provisioning volume for claim "default/raw-pvc-restore"
  Warning  ProvisioningFailed    12s (x4 over 26s)  hostpath.csi.k8s.io_csi-hostpath-provisioner-0_d61fffad-7655-456e-98b4-d98fc7f6d272  failed to provision volume with StorageClass "csi-hostpath-sc": rpc error: code = AlreadyExists desc = existing volume source snapshot id not matching
@RaunakShah
Copy link
Contributor Author

/assign

@msau42
Copy link
Collaborator

msau42 commented Nov 12, 2020

cc @Jiawei0227

@Jiawei0227
Copy link
Contributor

Interesting. Today in our snapshottable we dont have raw block tests. It seems we need to add it sooner than later

@Jiawei0227
Copy link
Contributor

I have seen this error in the https://k8s-testgrid.appspot.com/sig-storage-csi-ci#1.18-on-master testing

xing-yang added a commit to xing-yang/csi-driver-host-path that referenced this issue Nov 27, 2023
f8c8cc4 Merge pull request kubernetes-csi#237 from msau42/prow
b36b5bf Merge pull request kubernetes-csi#240 from dannawang0221/upgrade-go-version
adfddcc Merge pull request kubernetes-csi#243 from pohly/git-subtree-pull-fix
c465088 pull-test.sh: avoid "git subtree pull" error
7b175a1 Update csi-test version to v5.2.0
987c90c Update go version to 1.21 to match k/k
2c625d4 Add script to generate patch release notes
f9d5b9c Merge pull request kubernetes-csi#236 from mowangdk/feature/bump_csi-driver-host-path_version
b01fd53 Bump csi-driver-host-path version up to v1.12.0
984feec Merge pull request kubernetes-csi#234 from siddhikhapare/csi-tools
1f7e605 fixed broken links of testgrid dashboard
de2fba8 Merge pull request kubernetes-csi#233 from andyzhangx/andyzhangx-patch-1
cee895e remove windows 20H2 build since it's EOL long time ago
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
901bcb5 Update registry k8s.gcr.io -> registry.k8s.io

git-subtree-dir: release-tools
git-subtree-split: f8c8cc4
TerryHowe pushed a commit to TerryHowe/csi-driver-host-path that referenced this issue Oct 17, 2024
Update registry k8s.gcr.io -> registry.k8s.io
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

Successfully merging a pull request may close this issue.

3 participants