Description of problem:
virt-v2v fails to convert a vm from vmware to rhev if the disk name has a space.
Version-Release number of selected component (if applicable):
Red Hat Virtualization 4.0.5
How reproducible:
100 %
Steps to Reproduce:
1. Create a vm with a space in Disk name on VMware environment.
2. Try to import this vm to the rhevm environment by connecting to a vmware environment OR by using already added vmware external environment.
Actual results:
Import of the vm fails with below error in the engine.log
"CanDoAction of action 'AddDisk' failed for user admin@internal. Reasons: VAR__ACTION__ADD,VAR__TYPE__VM_DISK,VALIDATION_DISK_ALIAS_INVALID"
Expected results:
Import of the vm should succeed regardless of the space in the disk name OR there should be a option to change the disk name while importing the vm.
Additional info:
Below workaround was used following which vm was imported sucessfully.
Removed the space in the disk name from Vmware environment.
https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1002491
Below are the engine.log when the import of the vm failed.
VMname: SERBVIDOR NOC-007
VM disk name: SERBVIDOR NOC-007.vmdk
2016-12-09 23:45:48,918 INFO [org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand] (org.ovirt.thread.pool-6-thread-39) [1633ad28] Running command: ImportVmFromExternalProviderCommand internal: false. Entities affected : ID: 178d4880-af35-48fa-88ff-e5a2b455d0bd Type: StorageAction group IMPORT_EXPORT_VM with role type ADMIN
2016-12-09 23:45:51,592 WARN [org.ovirt.engine.core.bll.AddDiskCommand] (org.ovirt.thread.pool-6-thread-39) [5fc9840d] CanDoAction of action 'AddDisk' failed for user admin@internal. Reasons: VAR__ACTION__ADD,VAR__TYPE__VM_DISK,VALIDATION_DISK_ALIAS_INVALID
2016-12-09 23:45:51,595 ERROR [org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand] (org.ovirt.thread.pool-6-thread-39) [5fc9840d] Command 'org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand' failed: EngineException: Failed to create disk! (Failed with error ENGINE and code 5001)
2016-12-09 23:45:51,597 INFO [org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand] (org.ovirt.thread.pool-6-thread-39) [5fc9840d] Command [id=fa425172-3cc0-4168-9a43-5205c2e11ba8]: Compensating NEW_ENTITY_ID of org.ovirt.engine.core.common.businessentities.network.VmNetworkStatistics; snapshot: 5779ac50-a5a0-4fda-ace6-cb81b85f3d24.
2016-12-09 23:45:51,648 INFO [org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand] (org.ovirt.thread.pool-6-thread-39) [5fc9840d] Command [id=fa425172-3cc0-4168-9a43-5205c2e11ba8]: Compensating NEW_ENTITY_ID of org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface; snapshot: 5779ac50-a5a0-4fda-ace6-cb81b85f3d24.
2016-12-09 23:45:51,662 INFO [org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand] (org.ovirt.thread.pool-6-thread-39) [5fc9840d] Command [id=fa425172-3cc0-4168-9a43-5205c2e11ba8]: Compensating NEW_ENTITY_ID of org.ovirt.engine.core.common.businessentities.VmStatistics; snapshot: 4213277a-1431-ae69-6eb2-a69c5b9c254b.
2016-12-09 23:45:51,666 INFO [org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand] (org.ovirt.thread.pool-6-thread-39) [5fc9840d] Command [id=fa425172-3cc0-4168-9a43-5205c2e11ba8]: Compensating NEW_ENTITY_ID of org.ovirt.engine.core.common.businessentities.VmDynamic; snapshot: 4213277a-1431-ae69-6eb2-a69c5b9c254b.
2016-12-09 23:45:51,668 INFO [org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand] (org.ovirt.thread.pool-6-thread-39) [5fc9840d] Command [id=fa425172-3cc0-4168-9a43-5205c2e11ba8]: Compensating NEW_ENTITY_ID of org.ovirt.engine.core.common.businessentities.Snapshot; snapshot: 3c904745-954d-480e-afe9-1d0eee4ee82e.
2016-12-09 23:45:51,670 INFO [org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand] (org.ovirt.thread.pool-6-thread-39) [5fc9840d] Command [id=fa425172-3cc0-4168-9a43-5205c2e11ba8]: Compensating NEW_ENTITY_ID of org.ovirt.engine.core.common.businessentities.VmStatic; snapshot: 4213277a-1431-ae69-6eb2-a69c5b9c254b.
2016-12-09 23:45:51,911 ERROR [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (org.ovirt.thread.pool-6-thread-39) [5fc9840d] Correlation ID: 1633ad28, Job ID: 675b98c5-4106-4be1-ae4e-134a743f934a, Call Stack: null, Custom Event ID: -1, Message: Failed to import Vm SERBVIDOR NOC-007 to Data Center Default, Cluster DefaultC
2016-12-09 23:45:51,916 INFO [org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand] (org.ovirt.thread.pool-6-thread-39) [5fc9840d] Lock freed to object 'EngineLock:{exclusiveLocks='[4213277a-1431-ae69-6eb2-a69c5b9c254b=<VM, ACTION_TYPE_FAILED_VM_IS_BEING_IMPORTED$VmName SERBVIDOR NOC-007>, SERBVIDOR NOC-007=<VM_NAME, ACTION_TYPE_FAILED_NAME_ALREADY_USED>]', sharedLocks='null'}'