Unable to migrate VM from vMWare to OpenNebula using OneSwap

Hello,

I need some help regarding the OneSwap tool.

I have an OpenNebula infrastructure consisting of 4 KVM hosts and a frontend running Ubuntu 24.04 LTS. OneSwap is installed on the same machine as the OpenNebula frontend. Here is my oneswap.yaml file:

#:http_transfer: true                    # Enable HTTP transfer
#:http_host: '192.168.0.10'               # Hostname of this server
#:http_port: 29869                        # HTTP Port to transfer over

# vCenter Authentication
:vcenter: 'ip of the vcenter'                 # vCenter hostname or IP
:vuser: 'vcenter user'    # vCenter username
:vpass: 'vcenter password'                    # vCenter password
:port: 443                               # vCenter port

# ESXi Authentication
#:esxi_ip: 'esxi'                 # ESXi hostname or IP
#:esxi_user: 'root'                       # ESXi username
#:esxi_pass: 'password'                # ESXi password

# Transfer Options
#:custom_convert:                         # Uses OpenNebula's custom conversion process, useful for distributions which are not supported or fail to convert
#:fallback:                               # Fallback to OpenNebula's custom conversion process
:hybrid: true                                 # Transfer using rbvmomi2's download, then convert with virt-v2v locally
#:img_wait:                               # Amount of time to wait in seconds for image to be created in OpenNebula, default: 120

# Import Options
#:ova: /path/to/ova                       # Path to OVA or folder with OVF files

# Convert Options
#:clone: false                            # Trigger a VM full clone and convert that clone without requiring to poweroff the original VM

# NIC Options
:network: 1                              # ID of the OpenNebula network
:skip_ip: true                          # Do not create IP in OpenNebula network
:skip_mac: true                         # Do not create MAC in OpenNebula network

# Datastore Options
#:datastore: 1                            # ID of the OpenNebula Image datastore

# virt-v2v Options
#:work_dir: '/tmp'                        # Directory where disk conversion takes place, will make subdir for each VM
:format: 'qcow2'                         # Disk format [ qcow2 | raw ]
#:vddk_path:                              # Path to VDDK library
#:qemu_ga_win:                            # Path to QEMU Guest Agent ISO for Windows
:qemu_ga_linux: true                          # Install QEMU Guest Agent for Linux
#:virtio_path:                            # Path to VirtIO drivers for Windows
#:virt_tools: /usr/local/share/virt-tools # Path to the directory containing rhsrvany.exe
#:v2v_path: 'virt-v2v'                    # Path to virt-v2v
#:root: 'first'                           # Choose the root filesystem to be converted

# Extra Options
#:delete: false                           # Delete the VM Disks after transfer
#:context: '/var/lib/one/context/'        # Path to OpenNebula context packages
#:remove-vmtools: false                   # Add context script to force remove of VMWare Tools
#:uefi_path: '/usr/share/OVMF/OVMF_CODE.fd'                 # Path to the UEFI file to be configured in the VM template.
#:uefi_sec_path: '/usr/share/OVMF/OVMF_CODE.secboot.fd'     # Path to the UEFI Secure file to be configured in the VM template.

# OpenNebula Placement Options
#:one_cluster:                            # ID of the OpenNebula Cluster
#:one_host:                               # ID of the OpenNebula Host
#:one_datastore:                          # ID of the OpenNebula System Datastore
#:one_datastore_cluster:                  # ID of the OpenNebula Cluster for automatic Datastore assignment

# Extra VM Options:
:dev_prefix: 'vd'                             # Device prefix for the VM disks ex: sd, hd, vd
:cpu_model: 'host-passthrough'                              # CPU model
:graphics_type: 'vnc'                         # Graphics type: vnc, sdl, spice
:graphics_listen: '0.0.0.0'                        # Graphics listen IP
#:graphics_port:                          # Graphics port
#:graphics_keymap:                        # Graphics keymap
#:graphics_password:                      # Graphics password
#:graphics_command:                       # Graphics command
#:disable_contextualization:              # Remove default contextualization options in OpenNebula, Default: Network and SSH enabled
#:persistent_img:                         # Persistent Image, default: false
#:memory_max:                             # Memory max in MB
#:vcpu_max:                               # vCPU max allowed in integer format. CPU Hot Add required in VMWare.
#:cpu:                                    # Physical CPU allowed in integer format. Default: match CPU cores from vCenter
#:vcpu:                                   # vCPU allowed in integer format. Default: match CPU cores from vCenter

I am able to list the virtual machines available in my vCenter with the following command:

oneswap list vms --datacenter DCName

However, when I try to convert the machine berluti.pj with the command:

time oneswap convert berluti.pj --endpoint http://ip_fontend:2633/RPC2 --password 'password' --user oneadmin --persistent-img;

I get the following output:

Running OpenNebula prechecks...
Deleting password files.
Delete not enabled, leaving disks in /tmp/berluti.pj/conversions
Delete not enabled, leaving /tmp/berluti.pj alone.
undefined method `[]' for nil:NilClass

real    0m5.625s
user    0m4.077s
sys     0m0.296s

Do you have any idea what I might have missed?
Thank you for your help.

Regards, Pape

Hello,

I read through the code and I don’t see exactly where this error would be happening really, although based on the regular output it seems as if it happens pretty early on and in the prechecks stage.

To verify that the issue exists there can you run the command but add the --skip-prechecks flag?

If that goes further then we can safely assume the issue exists within the precheck function, which is simply checking if there is enough space in the datastore and if the resources can be created properly so it should be OK to disable for this test.

Hello @nhansen

Thanks for your reply. I tested by adding --skip-prechecks like this:

time oneswap convert berluti.pj --endpoint http://ip_fontend:2633/RPC2 --password 'password' --user oneadmin --skip-prechecks --persistent-img;

But I get the same result.

Deleting password files.
Delete not enabled, leaving disks in /var/tmp/nebuloni.pj/conversions
Delete not enabled, leaving /var/tmp/nebuloni.pj alone.
undefined method `[]' for nil:NilClass

I really don’t know what i did wrong !