Univention Bugzilla – Bug 33166
noVNC connections not immediately possible after starting a VM
Last modified: 2014-01-22 12:02:25 CET
It can take up to 15 seconds before one can connect to a just started instance. This is due to the fact that the /var/cache/univention-virtual-machine-manager-daemon/novnc.tokens file can only be updated with the connection information when uvmm has received it. Especially for Xen instances this can take up to 15 seconds. If the user clicks on the 'view' icon for the VM, she will receive a 'Failed to connect to server' message. To fix this the progress bar that is showing during VM bootup could be shown until a noVNC connection can be established.
Created attachment 5681 [details] Immediately write noVNC token on domain state change The VNC port information is only available in the libvirt domain XML. This information is polled every update=15 seconds. libvirt also provides an event mechanism, which (AFAIK) works reliable for KVM, but not for Xen (there was a problem was with Xend notifying libvirtd: starts/stop is detected, but not edit). It is already used by UVMMd to trigger Domain.update() when the VM changes state. It calls update_expensive() to get the XML, but that update is not passed up to Node.update() until the next regular update interval. Only there the VNC information is written into the token file. Currently one mapping file is used for one host listing all running VMs of that host. Node.write_novnc_tokens() is run by the interval Node-thread, while the event is processed by a different Thread, so locking might be missing in the attached patch, which otherwise works find on my KVM test system.
The patch has been applied. Small modification: Use a tempfile with a unique name before moving it to the final filename to avoid multithreading issues. On a Xen system the start and stop events are immediately processed and the token file is updated. r47263 univention-virtual-machine-manager-daemon 3.0.17-2.481.201401201652 r47264 2014-01-20-univention-virtual-machine-manager-daemon.yaml
OK: r47263 OK: r47264 OK: aptitude install {univention-virtual-machine-manager-daemon,univention-management-console-module-uvmm,python-univention-virtual-machine-manager}=3.0.17-2.481.201401201652 OK: announce_errata -V 2014-01-20-univention-virtual-machine-manager-daemon.yaml OK: Works as expected on Qemu-KVM
http://errata.univention.de/ucs/3.2/28.html