Uploaded image for project: 'OpenShift Virtualization'
  1. OpenShift Virtualization
  2. CNV-31468

[2227100] Cannot create a VM from template after creating a VolumeSnapshotClass

XMLWordPrintable

    • Storage Core Sprint 241
    • Moderate
    • No

      Description of problem:
      When using the Trident provisioner, I cannot create a VM from template using a bootsource after creating a VolumeSnapshotClass. Creating a VM works fine before creating the VolumeSnapshotClass.

      If I add or set "allowVolumeExpansion: true" in the Trident storage class, it works. But there are no indications in the UI or DV status that this is the issue.

      Version-Release number of selected component (if applicable):
      OpenShift Virtualization 4.13.2
      Trident Operator 23.04.0

      How reproducible:
      Consistent

      Steps to Reproduce:
      1.Install the Trident Operator
      2.Create a storageclass for Trident without allowVolumeExpansion set to true.
      ~~~
      apiVersion: storage.k8s.io/v1
      kind: StorageClass
      metadata:
      name: trident-cnvi-svm
      annotations:
      storageclass.kubernetes.io/is-default-class: "true"
      provisioner: csi.trident.netapp.io
      reclaimPolicy: Delete
      allowVolumeExpansion: true
      parameters:
      backendType: "ontap-nas"
      ~~~

      3. Create a RHEL 9 VM from template and boot source. This works fine.

      4. Create a VolumeSnapshotClass for Trident.
      ~~~
      apiVersion: snapshot.storage.k8s.io/v1
      kind: VolumeSnapshotClass
      metadata:
      name: trident-snapclass
      driver: csi.trident.netapp.io
      deletionPolicy: Delete
      ~~~

      5. Try to create another RHEL 9 VM from template and boot source. This will never complete. The DV Phase stays in "SnapshotForSmartCloneInProgress"
      ~~~
      ...
      status:
      conditions:

      • lastHeartbeatTime: "2023-07-27T21:18:04Z"
        lastTransitionTime: "2023-07-27T21:18:03Z"
        message: No PVC found
        reason: NotFound
        status: Unknown
        type: Bound
      • lastHeartbeatTime: "2023-07-27T21:18:04Z"
        lastTransitionTime: "2023-07-27T21:18:03Z"
        status: "False"
        type: Ready
      • lastHeartbeatTime: "2023-07-27T21:18:03Z"
        lastTransitionTime: "2023-07-27T21:18:03Z"
        status: "False"
        type: Running
        phase: SnapshotForSmartCloneInProgress
        ~~~

      The cdi-deployment pod shows log messages like such:
      ~~~

      {"level":"error","ts":1690492689.26244,"logger":"controller.datavolume-pvc-clone-controller","msg":"Reconciler error","name":"rhel9-after-vsc","namespace":"winding","error":"persistentvolumeclaims \"cdi-tmp-1434dc2c-c012-406b-afc5-438912628dcf\" is forbidden: only dynamically provisioned pvc can be resized and the storageclass that provisions the pvc must support resize","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/remote-source/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:266\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/remote-source/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:227"}

      ~~~

      6. Remove the StorageClass and recreate it with allowVolumeExpansion set to true
      ~~~
      apiVersion: storage.k8s.io/v1
      kind: StorageClass
      metadata:
      name: trident-cnvi-svm
      annotations:
      storageclass.kubernetes.io/is-default-class: "true"
      provisioner: csi.trident.netapp.io
      reclaimPolicy: Delete
      allowVolumeExpansion: true
      volumeBindingMode: Immediate
      parameters:
      backendType: "ontap-nas"
      ~~~

      7. Create a RHEL 9 VM from template and bootsource. This will now work (rather quickly).

      Actual results:

      Expected results:
      I would expect a notification in the UI or DV that this was the issue.

      Additional info:

              agilboa@redhat.com Arnon Gilboa
              joherr John Herr
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: