Bug 1904962 - Can't import guest from VMware on rhv4.4 GUI if guest disk has special character
Summary: Can't import guest from VMware on rhv4.4 GUI if guest disk has special character
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Virt
Version: 4.4.4
Hardware: x86_64
OS: Unspecified
medium
medium
Target Milestone: ovirt-4.5.2
: ---
Assignee: Shmuel Melamud
QA Contact: Nisim Simsolo
URL:
Whiteboard: V2V_RHV_INT
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-12-07 09:03 UTC by mxie@redhat.com
Modified: 2022-08-30 08:47 UTC (History)
14 users (show)

Fixed In Version: ovirt-engine-4.5.2
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-08-30 08:47:42 UTC
oVirt Team: Virt
Embargoed:
pm-rhel: ovirt-4.5?


Attachments (Terms of Use)
vdsm.log (66.52 KB, text/plain)
2020-12-07 09:03 UTC, mxie@redhat.com
no flags Details
engine.log (15.32 KB, text/plain)
2020-12-07 09:04 UTC, mxie@redhat.com
no flags Details
v2v-can-convert-vmware-guest-disk-special-character.png (77.22 KB, image/png)
2020-12-07 09:05 UTC, mxie@redhat.com
no flags Details
standalone-v2v-convert-guest-disk-have-special-character.log (2.26 MB, text/plain)
2020-12-07 09:08 UTC, mxie@redhat.com
no flags Details
engine-log-for-comment6 (13.31 KB, text/plain)
2021-01-12 10:58 UTC, mxie@redhat.com
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github oVirt ovirt-engine pull 408 0 None open core: Replace all illegal chars in disk aliases 2022-06-02 00:09:04 UTC

Description mxie@redhat.com 2020-12-07 09:03:28 UTC
Created attachment 1737215 [details]
vdsm.log

Description of problem:
Can't import guest from VMware on rhv4.4 GUI if guest disk has special character 

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

rhv server:4.4.4.1-0.1.el8ev

rhv node:
virt-v2v-1.42.0-6.module+el8.3.0+7898+13f907d5.x86_64
libguestfs-1.42.0-2.module+el8.3.0+6798+ad6e66be.x86_64
libvirt-client-6.6.0-8.module+el8.3.1+8648+130818f2.x86_64
qemu-kvm-5.1.0-16.module+el8.3.1+8958+410ab178.x86_64
vdsm-4.40.37-1.el8ev.x86_64


How reproducible:
100%

Steps to Reproduce:
1. Prepare a guest whose disk has special character on VMware but guest name doesn't contain special character, then try to import the guest from VMware on rhv4.4

1.1 Prepare a VMware guest named "esx7.0-win2016-x86_64-time_yy-mm-dd ", below is disk info of the vmx file
# cat esx7.0-win2016-x86_64-yy%2fmm%2fdd/esx7.0-win2016-x86_64-yy%2fmm%2fdd.vmx
....
sata0:0.present = "TRUE"
scsi0:0.deviceType = "scsi-hardDisk"
scsi0:0.fileName = "esx7.0-win2016-x86_64-yy%2fmm%2fdd.vmdk"
....

1.2 Open virtual machine option at rhv4.4 web -> click import button -> choose source as VMware ->input ip for vCenter, ESXi, DataCenter, username, password option->click 'Load' button-> select above guest to import

2.But the guest can't be imported with error "Failed to import Vm esx7.0-win2016-x86_64-time_yy-mm-dd to Data Center NFS, Cluster NFS"

3.But if use virt-v2v convert above guest from VMware to rhv4.4 on standalone v2v conversion server, the guest can be converted to rhv4.4 successfully and guest can power on normally, pls check screenshot"v2v-can-convert-vmware-guest-disk-special-character.png"

#virt-v2v -ic vpx://root.198.169/data/10.73.199.217/?no_verify=1 -it vddk -io vddk-libdir=/home/vmware-vix-disklib-distrib -io  vddk-thumbprint=B5:52:1F:B4:21:09:45:24:51:32:56:F6:63:6A:93:5D:54:08:2D:78  -o rhv-upload -of raw -os nfs_data -oc https://hp-dl360eg8-03.lab.eng.pek2.redhat.com/ovirt-engine/api  -ip /home/passwd  -op /home/rhvpasswd  -oo rhv-cluster=NFS esx7.0-win2016-x86_64-time_yy-mm-dd -v -x |& tee > standalone-v2v-convert-guest-disk-have-special-character.log


Actual results:
As above description

Expected results:
Can import guest from VMware on rhv4.4 GUI if guest disk has special character 


Additional info:

Comment 1 mxie@redhat.com 2020-12-07 09:04:24 UTC
Created attachment 1737216 [details]
engine.log

Comment 2 mxie@redhat.com 2020-12-07 09:05:40 UTC
Created attachment 1737217 [details]
v2v-can-convert-vmware-guest-disk-special-character.png

Comment 3 mxie@redhat.com 2020-12-07 09:08:58 UTC
Created attachment 1737218 [details]
standalone-v2v-convert-guest-disk-have-special-character.log

Comment 4 Tomáš Golembiovský 2021-01-11 14:25:23 UTC
I wonder if this is really on oVirt issue. I am not sure if we should change the name of the disk instead of failing as this is not transparent to (and may confuse) the clients.

Rich, what is your opinion on this? I have checked virt-v2v code and I cannot find anything that would handle invalid characters for any other output mode. I would assume you can run in to similar issues with other outputs too (e.g. libvirt or openstack). How are invalid characters handled for those?

Comment 5 Richard W.M. Jones 2021-01-11 14:39:40 UTC
From the virt-v2v point of view there are a few things to look at:

(1) The internal state of virt-v2v metadata, which is dumped in the log:

    source name: esx7.0-win2016-x86_64-time_yy-mm-dd
hypervisor type: vmware
       VM genid: 
         memory: 1073741824 (bytes)
       nr vCPUs: 1
     CPU vendor: 
      CPU model: 
   CPU topology: 
   CPU features: 
       firmware: unknown
        display: 
          video: vmvga
          sound: 
disks:
        nbd:unix:/tmp/v2vnbdkit.DbuQ32/nbdkit2.sock:exportname=/ (raw) [scsi]

Note that the source name is fine, and we don't actually store the disk name (it's
instead stored as a link to the nbdkit instance).

(2) Can the nbdkit instance access the source disk?  Yes - you can see
it gets the name from libvirt ([esx7.0-function] esx7.0-win2016-x86_64-yy%2fmm%2fdd/esx7.0-
win2016-x86_64-yy%2fmm%2fdd.vmdk)
and passes the same name to the VDDK plugin, which is able to open it fine.

(3) What is written in the oVirt metadata?  We give the disk a UUID,
but otherwise don't care about the original name:

        <rasd:Caption>Drive 1</rasd:Caption>
        <rasd:InstanceId>f20e664b-f3d7-4471-93ea-843e6129ee86</rasd:InstanceId>
        <rasd:ResourceType>17</rasd:ResourceType>
        <Type>disk</Type>
        <rasd:HostResource>f20e664b-f3d7-4471-93ea-843e6129ee86</rasd:HostResource>
[etc]

So as you say it's not something that should affect virt-v2v, and indeed
the virt-v2v conversion is successful.

I can't imagine why the disk name would affect anything.

Do we know what the actual failure is?  There's barely anything interesting
in engine.log, and I can't see anything at all in vdsm.log ...

Comment 6 Tomáš Golembiovský 2021-01-11 19:05:56 UTC
(In reply to Richard W.M. Jones from comment #5)

> Do we know what the actual failure is?  There's barely anything interesting
> in engine.log, and I can't see anything at all in vdsm.log ...

I misunderstood the problem report. I thought the issue is with rhv-upload and the '/' in disk name cause the issues. But the issue is with web UI import (NB: '/' in disk name is completely valid character).

I tried to reproduce it and the problem seems to be NPE in engine:

2021-01-11 19:57:49,903+01 ERROR [org.ovirt.engine.core.bll.storage.repoimage.GetImagesListByStoragePoolIdQuery] (default task-25) [99ac4dac-5156-43de-adac-d9d
428fe84f6] Exception: java.lang.NullPointerException
        at deployment.engine.ear.bll.jar//org.ovirt.engine.core.bll.storage.repoimage.GetImagesListByStoragePoolIdQuery.executeQueryCommand(GetImagesListByStor
agePoolIdQuery.java:39)
        at deployment.engine.ear.bll.jar//org.ovirt.engine.core.bll.QueriesCommandBase.executeCommand(QueriesCommandBase.java:106)
        at org.ovirt.engine.core.dal//org.ovirt.engine.core.dal.VdcCommandBase.execute(VdcCommandBase.java:31)
        at deployment.engine.ear.bll.jar//org.ovirt.engine.core.bll.executor.DefaultBackendQueryExecutor.execute(DefaultBackendQueryExecutor.java:14)
        at deployment.engine.ear.bll.jar//org.ovirt.engine.core.bll.Backend.runQueryImpl(Backend.java:512)
        at deployment.engine.ear.bll.jar//org.ovirt.engine.core.bll.Backend.runQuery(Backend.java:481)
        at jdk.internal.reflect.GeneratedMethodAccessor84.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.jboss.as.ee.3.GA-redhat-00004//org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodIntercept
or.java:52)


But it's possible I broke something on VMware side while trying. Ming, can you please attach more complete engine.log? The error we're looking for is before the lines you posted.

Comment 7 Arik 2021-01-12 10:40:08 UTC
Changing to oVirt

Comment 8 mxie@redhat.com 2021-01-12 10:58:34 UTC
Created attachment 1746599 [details]
engine-log-for-comment6

Comment 10 Arik 2021-01-18 12:24:11 UTC
We need to rename the disk to cope with the naming convention on the oVirt side for disk aliases

Comment 12 Nisim Simsolo 2022-07-20 11:18:41 UTC
Verified: 
ovirt-engine-4.5.1.3-0.36.el8ev
vdsm-4.50.2.1-1.el8ev.x86_64
libvirt-8.0.0-5.2.module+el8.6.0+15256+3a0914fe.x86_64
qemu-kvm-6.2.0-11.module+el8.6.0+15668+464a1f31.2.x86_64
virt-v2v-1.42.0-19.module+el8.6.0+15577+2ffd6ffa.x86_64

Verification scenario: 
1. Import VMware VM named 'esx7.0-win2016-x86_64-time_yy-mm-dd'
2. Verify VM imported successfully, Run VM and verify VM is running.

P.S. this issue is different than https://bugzilla.redhat.com/show_bug.cgi?id=1562602 where the correct behavior is to reject invalid characters, 
for example, when importing VM named centos44%/\&+=?!@#$^*()[]

Comment 13 Sandro Bonazzola 2022-08-30 08:47:42 UTC
This bugzilla is included in oVirt 4.5.2 release, published on August 10th 2022.
Since the problem described in this bug report should be resolved in oVirt 4.5.2 release, it has been closed with a resolution of CURRENT RELEASE.
If the solution does not work for you, please open a new bug report.


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