javascriptwebsocketvcloud-director-rest-apivmware-sdk

VMware HTML WebMKS - console connection ok, but no screen and high usage of CPU


In order to create a custom WebMKS console that allows to see and interact with a virtual machine configured in VMware vCloud Director (I have vCD 10.3), it can be used the VMware HTML Console SDK available on the website of VMware/Broadcom. I tried to follow the guide and to interact with the SDK (version 2.2.0) by creating an example page, see the Javascript/jQuery below.

VMware documentation:
https://docs.vmware.com/en/VMware-vSphere/8.0/html-console-sdk-programming-guide/GUID-E5495E81-DAF4-4BEE-B66A-D3DD94B07596.html

    $(function () {
            var baseurl_ws = "wss://vclouddirectorserver:8443/443;"
            var ticket = "cst-o****omissis****:3D:6E:69:98--";
            
            var wmks = WMKS.createWMKS("wmksContainer", {})
                .register(WMKS.CONST.Events.CONNECTION_STATE_CHANGE, function (event, data) {
                    if (data.state == WMKS.CONST.ConnectionState.CONNECTED) {
                        console.log("connection state change : connected");
                    }
                });

            
            wmks.connect(baseurl_ws + ticket);
        });

The problem is:

The WebSocket connection is working fine, in the Developer tool on the browser the reachability is ok, but nothing appears on the page and the CPU is constantly high on the browser process.

No errors appear on the browser console.

According to the documentation, this script should have shown the machine console in a canvas element on the HTML page nested in a div element.

Does anyone ever faced this kind of problem?

Thanks


Solution

  • After dealing a lot with this issue, I got the advice from my colleague to use an earlier version of the SDK.

    I was using VMware vCloud Director version 10.3 and Console SDK version 2.2.0 . We tried to use the SDK version 2.1.0 and after that the console is working fine without CPU issues.

    I may assume that this behaviour is due to possible incompatibilities between vCD 10.3 and the newest SDK 2.2.0

    The Javascript section is the same as pasted above.

    Hope that this insight can be useful for you!