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

volumesnapshot restoreSize is not set when returning from createSnapshot response #416

Closed
chinglinwen opened this issue Jun 9, 2022 · 4 comments · Fixed by #480
Closed

Comments

@chinglinwen
Copy link

What steps did you take and what happened:

create volumesnapshot, cause later create PVC(which source is snapshot) failed ( because of zero storage.size )

apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
  labels:
  name: vm-fedora
  namespace: default
spec:
  source:
    pvc:
      name: fedora34-openebs-zfspvx
      namespace: default
  storage:
    accessModes:
    - ReadWriteMany
    resources:
      requests:
        storage: 6Gi
    storageClassName: openebs-zfspv
    volumeMode: Block
[root@hcit3 ~]# kubectl get vs
NAME        READYTOUSE   SOURCEPVC                 SOURCESNAPSHOTCONTENT   RESTORESIZE   SNAPSHOTCLASS   SNAPSHOTCONTENT                                    CREATIONTIME   AGE
vm-fedora   true         fedora34-openebs-zfspvx                           0             openebs-zfspv   snapcontent-fcb70074-a69e-4618-8668-30dfbace6830   74s            74s
[root@hcit3 ~]# kubectl get vsc
NAME                                               READYTOUSE   RESTORESIZE   DELETIONPOLICY   DRIVER               VOLUMESNAPSHOTCLASS   VOLUMESNAPSHOT   VOLUMESNAPSHOTNAMESPACE   AGE
snapcontent-fcb70074-a69e-4618-8668-30dfbace6830   true         0             Delete           zfs.csi.openebs.io   openebs-zfspv         vm-fedora        default                   116s
1.654678004992305e+09   ERROR   controller.smartclone-controller        error creating pvc from snapshot        {"VolumeSnapshot/PersistentVolumeClaim": "default/vm-fedora", "error": "PersistentVolumeClaim \"vm-fedora\" is invalid: spec.resources[storage]: Invalid value: \"0\": must be greater than zero"}

What did you expect to happen:

restoresize should have been set

kubectl get vs,vsc

The output of the following commands will help us better understand what's going on:
(Pasting long output into a GitHub gist or other Pastebin is fine.)

  • kubectl logs -f openebs-zfs-controller-0 -n kube-system -c openebs-zfs-plugin
  • kubectl logs -f openebs-zfs-node-[xxxx] -n kube-system -c openebs-zfs-plugin
  • kubectl get pods -n kube-system
  • kubectl get zv -A -o yaml

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • ZFS-LocalPV version: v2.1.0
  • Kubernetes version (use kubectl version): 1.23.5
  • Kubernetes installer & version:
  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release): centos 8.4.2105
@pawanpraka1
Copy link
Contributor

@chinglinwen snapshot size is optional in CSI spec. how size is being used in creating the clone for ZFS volume? do we need size there? all we need to do is this
zfs clone tank/ws/gate@yesterday tank/home/ahrens/bug123.

@chinglinwen
Copy link
Author

I think if restore size is zero, will cause kubevirt creating kubernetes pvc failed ( I think it's restrict by kube-apiserver validation for pvc object).

I've fixed in my local repo, and after return the size, kubevirt works properly(creating pvc success).

@pawanpraka1
Copy link
Contributor

@chinglinwen sounds good. Would you like to raise a PR for that?

@chinglinwen
Copy link
Author

sure.

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