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

[4.15] VMExport download VM manifest - has both "source" and "sourceRef" - results in cloning a DataSource instead of exporting a source PVC

XMLWordPrintable

    • 1
    • False
    • Hide

      None

      Show
      None
    • False
    • CNV v4.17.0.rhel9-60, CNV v4.15.5.rhel9-37
    • ---
    • ---
    • Storage Core Sprint 257, Storage Core Sprint 258
    • Important
    • No

      Description of problem:

      virtctl vmexport download vm1-export --vm=rhel9-scarlet-cricket-55 --manifest --include-secret --output=manifest.yaml
      
      VM manifest dataVolumeTemplates - has both "source" and "sourceRef", which results in a cloning from a DataSource 
      VM manifest dataVolumeTemplates - should only have a "source"

      Version-Release number of selected component (if applicable):

      4.16, 4.15, probably in earlier versions as well

      How reproducible:

      Always

      Steps to Reproduce:

      1. Create a VM from a DataSource (in UI, for example)
      2. Run 
      virtctl vmexport download vm1-export --vm=rhel9-scarlet-cricket-55 --manifest --include-secret --output=manifest.yaml
      3. See the VM manifest:
      
      apiVersion: kubevirt.io/v1
      kind: VirtualMachine
      metadata:
        annotations:
          kubemacpool.io/transaction-timestamp: "2024-04-10T11:48:03.276130493Z"
          kubevirt.io/latest-observed-api-version: v1
          kubevirt.io/storage-observed-api-version: v1
          vm.kubevirt.io/validations: |
            [
              {
                "name": "minimal-required-memory",
                "path": "jsonpath::.spec.domain.memory.guest",
                "rule": "integer",
                "message": "This VM requires more memory.",
                "min": 1610612736
              }
            ]
        creationTimestamp: null
        labels:
          app: rhel9-scarlet-cricket-55
          kubevirt.io/dynamic-credentials-support: "true"
          vm.kubevirt.io/template: rhel9-server-small
          vm.kubevirt.io/template.namespace: openshift
          vm.kubevirt.io/template.revision: "1"
          vm.kubevirt.io/template.version: v0.27.0
        name: rhel9-scarlet-cricket-55
        namespace: default
      spec:
        dataVolumeTemplates:
        - apiVersion: cdi.kubevirt.io/v1beta1
          kind: DataVolume
          metadata:
            creationTimestamp: null
            name: rhel9-scarlet-cricket-55
          spec:
            source:
              http:
                certConfigMap: export-ca-cm-vm1-export
                secretExtraHeaders:
                - header-secret-vm1-export
                url: https://virt-exportproxy-openshift-cnv.apps.<SERVER>/api/export.kubevirt.io/v1alpha1/namespaces/default/virtualmachineexports/vm1-export/volumes/rhel9-scarlet-cricket-55/disk.img.gz
            sourceRef:
              kind: DataSource
              name: rhel9
              namespace: openshift-virtualization-os-images
            storage:
              resources:
                requests:
                  storage: 30Gi
        running: false
        template:
          metadata:
            annotations:
              vm.kubevirt.io/flavor: small
              vm.kubevirt.io/os: rhel9
              vm.kubevirt.io/workload: server
            creationTimestamp: null
            labels:
              app.kubernetes.io/name: headless
              kubevirt.io/domain: rhel9-scarlet-cricket-55
              kubevirt.io/size: small
          spec:
            architecture: amd64
            domain:
              cpu:
                cores: 1
                sockets: 1
                threads: 1
              devices:
                disks:
                - disk:
                    bus: virtio
                  name: rootdisk
                - disk:
                    bus: virtio
                  name: cloudinitdisk
                interfaces:
                - macAddress: "02:04:17:00:00:09"
                  masquerade: {}
                  model: virtio
                  name: default
                networkInterfaceMultiqueue: true
                rng: {}
              features:
                acpi: {}
                smm:
                  enabled: true
              firmware:
                bootloader:
                  efi: {}
              machine:
                type: pc-q35-rhel9.4.0
              memory:
                guest: 2Gi
              resources: {}
            networks:
            - name: default
              pod: {}
            terminationGracePeriodSeconds: 180
            volumes:
            - dataVolume:
                name: rhel9-scarlet-cricket-55
              name: rootdisk
            - cloudInitNoCloud:
                userData: |-
                  #cloud-config
                  user: cloud-user
                  password: egau-yftp-m1y2
                  chpasswd: { expire: False }
              name: cloudinitdisk
      status: {}

      Actual results:

      Both "source" and "sourceRef" are in the dataVolumeTemplates, which results in cloning from a DataSource, but not exporting the source PVC

      Expected results:

      Only "source" in the dataVolumeTemplates

      Additional info:

       

              rh-ee-alromero Alvaro Romero
              jpeimer@redhat.com Jenia Peimer
              Jenia Peimer Jenia Peimer
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: