After a vApp is powered on, you can retrieve a screen ticket from any of its virtual machines. You use that ticket with the VMware HTML Console SDK to access the virtual machine console from a browser.
Each Vm element in a vApp includes a link where rel="screen:acquireMksTicket" if the virtual machine it represents is powered on. You can use that link to retrieve a screen ticket that includes all the information you need to create a VMware HTML Console to access the virtual machine.
A Vm element might also contain a link of the form:
<Link rel="screen:acquireTicket" href="https://vcloud.example.com/api/vApp/vm-4/screen/action/acquireTicket" />
This link is provided for compatibility with older systems. The ticket returned by a request to this link is not compatible with this release of vCloud Director.
1 |
POST a request to the acquireMksTicket link of the Vm. POST https://vcloud.example.com/api/vApp/vm-4/screen/action/acquireMksTicket 200 OK Content-Type: application/vnd.vmware.vcloud.mksticket+xml ... <MksTicket xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ... > <Host>10.150.130.63</Host> <Vmx>vmfs/volumes/5331e00b-467faf9c-5561-d48564677c70/example-vm (19115346-c01c-4c9b-a21f-d487865a9f98)/example-vm (19115346-c01c-4c9b-a21f-d487865a9f98).vmx</Vmx> <Ticket>ticket-string</Ticket> <Port>902</Port> </MksTicket> |
2 | Construct an HTML Script element from the information in the MksTicket response. See Example: Using an MksTicket in a VMware HTML Console SDK Script. |
3 | Use the Script element with the VMware HTML Console SDK . Replace the final script element in the Quick Start example shown in the VMware HTML Console SDK Release Notes (release number 2.1, build number 4504321) with the script you constructed. Replace the ticket-string with one from a freshly-retrieved MksTicket, then open the example in a browser. |
This HTML fragment shows a Script element derived from an example in the VMware HTML Console SDK Release Notes. In this example:
<script> var wmks = WMKS.createWMKS("wmksContainer",{VCDProxyHandshakeVmxPath: "vmfs/volumes/5331e00b-467faf9c-5561-d48564677c70/example-vm (19115346-c01c-4c9b-a21f-d487865a9f98)/example-vm (19115346-c01c-4c9b-a21f-d487865a9f98).vmx.vmx", enableUint8Utf8:true}) .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("wss://10.150.130.63:443/902;ticket-string"); </script>