Skip to content

Vmware to kvm import is failing on 4.19.2 rc3 #10404

@kiranchavala

Description

@kiranchavala

problem

Vmware to kvm import is failing on 4.19.2 rc3

versions

Cloudstack 4.19.2 rc 3
7f0eed3

vmware 7 and 8

management server ol8

The steps to reproduce the bug

1.Have a cloudstack env with vmware and kvm cluster
2.Deploy a vm on vmware cluster using the default centos 5.3 template
3.Stop the vm
4. Import the vm to kvm cluster by Navigating to (tools > Import -Export Instances > Migrate existing instance to kvm)
5. Select the existing vcentre and host and vm > click on import > select the
6. Exception found in the logs

2025-02-17 06:09:52,147 ERROR [c.c.a.ApiAsyncJobDispatcher] (API-Job-Executor-53:ctx-142da964 job-99) (logid:8fcb296c) Unexpected exception while executing org.apache.cloudstack.api.command.admin.vm.ImportVmCmd
java.lang.IndexOutOfBoundsException: Index 1 out of bounds for length 1
        at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
        at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
        at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
        at java.base/java.util.Objects.checkIndex(Objects.java:374)
        at java.base/java.util.ArrayList.set(ArrayList.java:473)
        at org.apache.cloudstack.vm.UnmanagedVMsManagerImpl.selectInstanceConversionStoragePools(UnmanagedVMsManagerImpl.java:2090)
        at org.apache.cloudstack.vm.UnmanagedVMsManagerImpl.convertVmwareInstanceToKVMWithOVFOnConvertLocation(UnmanagedVMsManagerImpl.java:1930)
        at org.apache.cloudstack.vm.UnmanagedVMsManagerImpl.importUnmanagedInstanceFromVmwareToKvm(UnmanagedVMsManagerImpl.java:1637)
        at org.apache.cloudstack.vm.UnmanagedVMsManagerImpl.baseImportInstance(UnmanagedVMsManagerImpl.java:1353)
        at org.apache.cloudstack.vm.UnmanagedVMsManagerImpl.importVm(UnmanagedVMsManagerImpl.java:1474)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
        at org.apache.cloudstack.network.contrail.management.EventUtils$EventInterceptor.invoke(EventUtils.java:107)

The issue is not observed if there are tags on the compute offerings and storage

Follow the steps mentioned in

#9764 (review)
...

What to do about it?

Cloudstack should not thrown the exception and import of vm from vmware to kvm should succeed when there are no tags involved

Metadata

Metadata

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions