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 create PVC from snapshot if G is used as size instead of Gi #617

Closed
manosoft opened this issue Aug 11, 2021 · 2 comments
Closed
Labels

Comments

@manosoft
Copy link

manosoft commented Aug 11, 2021

Describe the bug
I want to clone my existing application for test purpose.
I'm following below

  1. Create snapshot of existing PVC
  2. Create PVC from snapshots
  3. Start clone application using PVC from step 2

At step 2, I see below error and PVC creation fails.
failed to provision volume with StorageClass "ntap-trident": error getting handle for DataSource Type VolumeSnapshot by Name snap001: requested volume size 1000000000 is less than the size 1000001536 for the source snapshot snap001

Original PVC Snippet:

spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 1G

Snippet PVC from Snapshot:

spec:
  accessModes:
  - ReadWriteOnce
  dataSource:
    apiGroup: snapshot.storage.k8s.io
    kind: VolumeSnapshot
    name: snap001
  resources:
    requests:
      storage: 1G
  storageClassName: ntap-trident
  volumeMode: Filesystem

In both cases, size is same 1G, still PVC creation fails with requested volume size 1000000000 is less than the size 1000001536 for the source snapshot snap001

Environment

  • Trident version: 21.04.0
  • Trident installation flags used: No custom flags used.
  • Container runtime: Docker 1.13.1
  • Kubernetes version: v1.18.20
  • Kubernetes orchestrator: Vanilla Kubernetes
  • Kubernetes enabled feature gates: NA
  • OS: CentOS Linux release 7.7.1908
  • NetApp backend types: ONTAP
  • Other:

To Reproduce
Steps to reproduce the behavior:
Run below commands using attached yamls.
Please edit 01-pvc-create.yaml 03-snapshot.yaml 04-pvc-from-snapshot.yaml files with appropriate storageclass and volumesnapshotclass.

kubectl create -f 00-create-namespace.yaml
kubectl create -f 01-pvc-create.yaml
kubectl create -f 02-pod-create.yam
kubectl create -f 03-snapshot.yaml
kubectl create -f 04-pvc-from-snapshot.yaml
kubectl create -f 05-pod-clone.yaml

Expected behavior
A clear and concise description of what you expected to happen.
We should be able to create PVC from Volume Snapshot.

Additional context
Add any other context about the problem here.
00-create-namespace.yaml.txt
01-pvc-create.yaml.txt
02-pod-create.yaml.txt
03-snapshot.yaml.txt
04-pvc-from-snapshot.yaml.txt
05-pod-clone.yaml.txt

@manosoft manosoft added the bug label Aug 11, 2021
@manosoft
Copy link
Author

manosoft commented Aug 11, 2021

1G translates to 976562.5Ki, but volumesnapshot size is shown as 976564Ki , hence the difference of 1536bytes it seems

[root@snap-verification]# k get volumesnapshot  -nsnap-test
NAME      READYTOUSE   SOURCEPVC   SOURCESNAPSHOTCONTENT   RESTORESIZE   SNAPSHOTCLASS   SNAPSHOTCONTENT                                    CREATIONTIME   AGE
snap001   true         my-pvc                              976564Ki      ntap-snap       snapcontent-9f196783-4125-485d-8f51-d38bc7db99f5   89m            89m

@gnarl
Copy link
Contributor

gnarl commented Aug 16, 2021

Hi @manosoft,

Even though you are creating a clone in your steps to reproduce this issue this is a duplicate of #550. The cloning workflow creates a snapshot which is then used to create the new PV. We are currently investigating how to best fix this issue.

Thanks for the providing additional information on this issue.

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

No branches or pull requests

2 participants