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

VMExport: when using '–output -' - we save all stdout to the disk.img, results in broken disk.img

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Major Major
    • CNV v4.16.0
    • CNV v4.16.0
    • Storage Platform
    • None
    • 0.42
    • False
    • Hide

      None

      Show
      None
    • False
    • ---
    • ---
    • Storage Core Sprint 250, Storage Core Sprint 251
    • High
    • No

      Description of problem:

      when using '–output -' output file is not a valid disk image file

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

      4.14, 4.15, 4.16

      How reproducible:

      Always

      Steps to reproduce:

      $ virtctl vmexport download vm --pvc=cirros-dv-source-ocs --output - > stdout_disk.img
      Downloading file: 17.65 MiB [==================>] 761.84 KiB p/s 
      

      The size of the files is different, depending if it was saved with "--output disk.img" or "output -" (although no changes were made to the source PVC)

      $ ll
      ...
      -rw-r--r--.  1 cloud-user cloud-user 18509174 Feb 25 06:23 disk.img
      -rw-r--r--.  1 cloud-user cloud-user 18509406 Feb 25 06:25 stdout_disk.img
      

      I uploaded each disk img to a DV, and created VMs using these DVs:

      • "--output disk.img" — VM is Running and I can connect via virctl console
      • "–output -" — VM is Running, but I can't connect to the console, it gets stuck here:
      $ virtctl console vm-from-uploaded-dv
      Successfully connected to vm-from-uploaded-dv console. The escape sequence is ^]
                                                                                      [cloud-user@ocp-psi-executor-xl vmexport]$ 

      To reproduce:

      virtctl image-upload dv dv-uploaded-from-stdout-vmexport --image-path=./stdout_disk.img --size=1Gi --storage-class=ocs-storagecluster-ceph-rbd-virtualization --insecure
      $ cat ../vm-using-existing-dv-saved.yaml 
      apiVersion: kubevirt.io/v1
      kind: VirtualMachine
      metadata:
        name: vm-from-uploaded-dv-stdout
      spec:
        running: true
        template:
          spec:
            domain:
              devices:
                disks:
                - disk:
                    bus: virtio
                  name: dv-disk
                rng: {}
              resources:
                requests:
                  memory: 500Mi
            volumes:
            - dataVolume:
                name: dv-uploaded-from-stdout-vmexport
              name: dv-disk

      Actual results:

      disk.img is broken

      Expected results:

      disk.img can be reused for a new VM

      Additional info:

       

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

                Created:
                Updated:
                Resolved: