Uploaded image for project: 'Migration Toolkit for Virtualization'
  1. Migration Toolkit for Virtualization
  2. MTV-851

Migrating VMs from RHV to OpenShift Virtualization is not working with encrypted RBD

XMLWordPrintable

    • Important

      Description of problem:

      Migrating a VM from RHV to OpenShift Virtualization is failing during the `qemu-img create` with error Cannot grow device files. The below errors are logged in the populator logs:

       

      I1208 11:11:12.887954       1 ovirt-populator.go:131] {"transferred": 0, "elapsed": 0.7342266369960271, "description": "downloading image"}
      I1208 11:11:12.979713       1 ovirt-populator.go:131] qemu-img: /dev/block: Cannot grow device files
      I1208 11:11:12.980578       1 ovirt-populator.go:131] {"transferred": 0, "elapsed": 0.8268404649861623, "description": "finalizing transfer"}
      ....
      ....
      I1208 11:11:15.067995       1 ovirt-populator.go:131] subprocess.CalledProcessError: Command '['qemu-img', 'create', '-f', 'raw', '-q', '/dev/block', '107374182400']' returned non-zero exit status 1.
      F1208 11:11:15.097296       1 ovirt-populator.go:154] exit status 1
       
      
      

      This is because the pod sees the device size slightly less than 100 GB

      # oc debug populate-68edf19f-a6c3-4199-92b2-f29665f63a9f
      Starting pod/populate-68edf19f-a6c3-4199-92b2-f29665f63a9f-debug-sjscm ...
      Pod IP: 10.128.1.138
      If you don't see a command prompt, try pressing enter.
      sh-4.4$ qemu-img info /dev/block
      image: /dev/block
      file format: raw
      virtual size: 100 GiB (107357405184 bytes)  
      disk size: 0 B
      
      After attaching PVC to a UBI image:
      
      sh-4.4# fdisk -l /dev/block
      Disk /dev/block: 100 GiB, 107357405184 bytes, 209682432 sectors
      
      107357405184/1024/1024/1024 = 99.98

      qemu-img is trying to create the image with 107374182400 bytes (100 GB) and the pod only sees 107357405184 bytes (99.98 GB).

      As per the Ceph doc, this looks to be expected for encrypted RBD:

      Some of the encryption metadata may be stored as part of the image data, typically an encryption header will be written to the beginning of the raw image data. This means that the effective image size of the encrypted image may be lower than the raw image size. See the Supported Formats section for more details.
      
      Once encryption has been loaded, API calls for retrieving the image size using the opened image context will return the effective image size.

       

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

      Migration Toolkit for Virtualization Operator   2.5.3                           

      How reproducible:

      100%

      Steps to Reproduce:

      1. Try to import a VM from RHV to an encrypted Ceph storage class.
      2. The populator pod goes into  "failed" state with the above error.

              lrotenbe Liran Rotenberg
              rhn-support-nashok Nijin Ashok
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: