VNC port on imported guests

Hi everybody,

we have a bunch of existing KVM hosts which we slowly add to OpenNebula and as a first step just import the existing images until we could replace them with one images.
Our VNC port layout basically uses the same ports (5900-x) per host which on import leaves the vm in HOLD state. From what i found out the ports in one are per cluster which is ok as i can just adjust them before importing. The only thing that’s a bit complicated is finding the next free port and getting VMs out of the HOLD state.
Does anybody have a best practice or just a way how you do such tasks ?


I also get same bug. When I import VMs of second KVM host I get error message “VirtualMachineDeploy result FAILURE [VirtualMachineDeploy] Requested VNC port already assgined to a VM”. Some time ago I tested version 4.14 and didn’t meet such problem. I hope next bigfix release solve the problem.

This is because we now track VNC ports in use, so you can remove ports used by other services (to not collide with VNC port assigned to the VM). OpenNebula first try to assign VM_ID + 5900 to the VM, if that’s free you’ll get that one. If needed, we could add the list of VNC ports in use and the next free port as part of the cluster information

Tracking VNC ports of opennebula’s VMs is a right idea. opennebula’s VMs can migrate from host to host. But I talk about imported “wild” VMs which cannot migrate and each host points VNC port of VMs separately. Workaround is to set VNC port manually for all hosts except first. But set VNC ports for hundred VMs is not a good idea. So I suggest to track pair port+host for imported “wild” VMs.