Bug 1909458 - [V2V][VMware to CNV VM import via api using VMIO] VM import to Ceph RBD/BLOCK fails on "qemu-img: /data/disk.img" error
Summary: [V2V][VMware to CNV VM import via api using VMIO] VM import to Ceph RBD/BLOC...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Storage
Version: 2.5.3
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 2.6.0
Assignee: Alexander Wels
QA Contact: Nandini Chandra
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-12-20 05:28 UTC by Nandini Chandra
Modified: 2021-03-10 11:23 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-03-10 11:22:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
importer-pod.log (7.40 KB, text/plain)
2020-12-23 13:51 UTC, Ilanit Stein
no flags Details
vm-import-controller.log (11.65 MB, text/plain)
2020-12-23 14:41 UTC, Ilanit Stein
no flags Details
oc_describe_dv.yaml (4.87 KB, text/plain)
2020-12-23 14:41 UTC, Ilanit Stein
no flags Details
oc_get_importer_pod-oyaml (12.37 KB, text/plain)
2020-12-30 16:57 UTC, Ilanit Stein
no flags Details
oc_get_dv-oyaml (2.74 KB, text/plain)
2020-12-30 16:57 UTC, Ilanit Stein
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2021:0799 0 None None None 2021-03-10 11:23:19 UTC

Description Nandini Chandra 2020-12-20 05:28:23 UTC
Description of problem:
-----------------------
VM Migration to Ceph RBD block storage fails with this error. 

DataVolumeCreationFailed: Error while importing disk image: mini-rhel7-cloudinit-harddisk1. pod CrashLoopBackoff restart exceeded

Also, see https://bugzilla.redhat.com/show_bug.cgi?id=1898478

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


How reproducible:
----------------
Always


Steps to Reproduce:
-------------------
1.Migrate a VM from VMware to OpenshiftV using API
2.Target storage should be Ceph RBD block storage 
3.In the migration plan, set the  Volume mode to 'Block' for the 
  destination datastore.


Actual results:
--------------
Migration fails because of a data volume creation failure.


Expected results:
-----------------
Data volume creation should succeed; migration should succeed.


Additional info:
-----------------

Comment 2 Ilanit Stein 2020-12-23 13:51:45 UTC
This issue reproduces.

Migration plan
==============
$ cat << EOF | oc apply -f -
---
apiVersion: forklift.konveyor.io/v1alpha1
kind: Plan
metadata:
  name: plan-no-volmode
  namespace: openshift-migration
spec:
  provider:
    source:
      name: vmware1
      namespace: openshift-migration
    destination:
      name: host
      namespace: openshift-migration
  map:
    networks:
      - source:
          name: VM Network
        destination:
          type: pod
          name: pod
          namespace: openshift-migration
    datastores:
      - source:
          name: rhv-v2v-performance-testing
        destination:
          storageClass: ocs-storagecluster-ceph-rbd
  vms:
    - name: mini-rhel7-istein
EOF

VM import fail with this error in CNV UI:
========================================
"Import error (RHV)
mini-rhel7-istein could not be imported.
DataVolumeCreationFailed: Error while importing disk image: mini-rhel7-istein-harddisk1. pod CrashLoopBackoff restart exceeded"

vm-import-controller.log error:
==============================
level":"info","ts":1608730612.7150602,"logger":"controller_virtualmachineimport","msg":"CDI import pod failed.","Request.Namespace":"openshift-migration","Request.Name":"plan-plan-no-volmode-vm-689-cd18","VM.Name":{"namespace":"openshift-migration","name":"mini-rhel7-istein"}}

importer pod error:
==================
E1223 13:34:43.891962       1 prlimit.go:176] qemu-img: /data/disk.img: error while converting raw: Could not create file: No such file or directory

I1223 13:34:43.892001       1 vddk-datasource.go:249] Failed to convert disk: could not stream/convert image to raw: qemu-img execution failed: exit status 1

Comment 3 Ilanit Stein 2020-12-23 13:51:56 UTC
Created attachment 1741558 [details]
importer-pod.log

Comment 4 Ilanit Stein 2020-12-23 14:41:27 UTC
Created attachment 1741573 [details]
vm-import-controller.log

Comment 5 Ilanit Stein 2020-12-23 14:41:57 UTC
Created attachment 1741574 [details]
oc_describe_dv.yaml

Comment 6 Ilanit Stein 2020-12-24 10:35:50 UTC
This bug is specific to VM import from VMware using VMIO, based on these tests:

1. VM import from VMware via api using cdi importer - Fail, same as MTV migration failed (details in comment #2)
2. VM import from RHV via api  to ceph-rbd/block using cdi importer - Pass
3. VM import from VMware (same VM from 1) via UI (NOT using cdi importer) - Pass
for all 3, Target storage: Ceph-RBD, volumeMode:Block, AccessMode: ReadWriteOnly. 

In CNV-2.5.0, VMware to CNV VM import using VMIO worked OK or Ceph-RBD/Block.
Therefore this is a regression.

Moving bug to CNV/v2v.

Comment 7 Ilanit Stein 2020-12-24 10:53:07 UTC
Adding that comments #2 and #6 refer to CNV-2.5.3.

Comment 8 Fabien Dupont 2020-12-28 09:12:01 UTC
Would it be possible to have the YAML of the importer pod ? And even access to the cluster where it fails, with a reproducer plan ?

Note that `oc get -o yaml` is preferred to `oc describe` because it provides that raw YAML of the object, while `oc describe` tries to format it somehow and may lose / hide some information.

Comment 9 Fabien Dupont 2020-12-28 10:53:15 UTC
I've changed the component to Storage, because the error happens in CDI, not VMIO.

Would it be possible to have the YAML (via "oc get -o yaml") for the DataVolume, too?

Comment 10 Ilanit Stein 2020-12-30 16:57:14 UTC
Created attachment 1743249 [details]
oc_get_importer_pod-oyaml

Comment 11 Ilanit Stein 2020-12-30 16:57:55 UTC
Created attachment 1743250 [details]
oc_get_dv-oyaml

Comment 13 Adam Litke 2021-01-04 16:51:26 UTC
Alexander, can you take a look.  I'm wondering if the combination of VMWare and block mode is problematic.

Comment 14 Alexander Wels 2021-01-04 17:46:42 UTC
The pod definition looks fine at first glance, the block device is properly added to it. But for some reason it thinks it is using a file system as it is trying to write to /data/disk.img which it shouldn't. It should be attempting to write to the block device. I will look into it more closely once I get done with some other stuff.

Comment 16 Alexander Wels 2021-01-07 20:32:25 UTC
I investigated the issue, and the problem got introduced here [0]. destinationFile is hard coded to /data/disk.img, while it should be fileName which gets calculated based on the type of volume. In newer version of the code all of this has been modified, do we want to fix this in the 2.5 stable branch?

[0] https://github.com/kubevirt/containerized-data-importer/pull/1320/files#diff-c46055929ede7b3ba517257f9a8614ee9507c33a99c80b8d51933e143c6fb864R247

Comment 19 Adam Litke 2021-02-03 14:57:13 UTC
@fdupont Is it okay to target this to 2.6 or do you need something for 2.5 still?

Comment 20 Ilanit Stein 2021-02-04 13:43:53 UTC
Verified on CNV-2.6: hco-bundle-registry-container-v2.6.0-520.
VM import from VMware via api of a RHEL7 VM to target Ceph-RBD/Block ended successfully and VM was started OK.
(Tested with "default" namespace).
Based on that move to Verified.

Comment 21 Ilanit Stein 2021-02-04 17:12:44 UTC
The verification in comment #20 is based on https://bugzilla.redhat.com/show_bug.cgi?id=1917908#c9 
Another VM import using ceph-RBD block bug that we had on CNV-2.6.0 and resolved.

Comment 24 errata-xmlrpc 2021-03-10 11:22:41 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Virtualization 2.6.0 security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:0799


Note You need to log in before you can comment on or make changes to this bug.