HP BL680c XenServer Software Development Kit Guide 4.1.0 - Page 31

Disabling VNC forwarding for Linux VM, Procedure 5.1. To retrieve a console URI via the CLI

Page 31 highlights

XenServer API extensions 2. Master/443 to Client: Returns a session reference to be used with subsequent calls. 3. Client to Master/443: XML-RPC: VM.get_by_name_label(...). 4. Master/443 to Client: Returns a reference to a particular VM (or the "control domain" if you want to retrieve the physical host console). 5. Client to Master/443: XML-RPC: VM.get_consoles(...). 6. Master/443 to Client: Returns a list of console objects associated with the VM. 7. Client to Master/443: XML-RPC: VM.get_location(...). 8. Returns a URI describing where the requested console is located. The URIs are of the form: https://192.168.0.1/console?ref=OpaqueRef:c038533a-af99-a0ff-9095-c1159f2dc6a0. 9. Client to 192.168.0.1: HTTP CONNECT "/console?ref=(...)" The final HTTP CONNECT is slightly non-standard since the HTTP/1.1 RFC specifies that it should only be a host and a port, rather than a URL. Once the HTTP connect is complete, the connection can subsequently directly be used as a VNC server without any further HTTP protocol action. This scheme requires direct access from the client to the control domain's IP, and will not work correctly if there are Network Address Translation (NAT) devices blocking such connectivity. You can use the CLI to retrieve the console URI from the client and perform a connectivity check. Procedure 5.1. To retrieve a console URI via the CLI 1. Retrieve the VM UUID via: xe vm-list params=uuid --minimal name-label=name 2. Retrieve the console information via: xe console-list vm-uuid=uuid uuid ( RO): 714f388b-31ed-67cb-617b-0276e35155ef vm-uuid ( RO): 8acb7723-a5f0-5fc5-cd53-9f1e3a7d3069 vm-name-label ( RO): etch protocol ( RO): RFB location ( RO): https://192.168.0.1/console?ref=(...) Use command-line utilities like ping to test connectivity to the IP address provided in the location field. 5.1.2. Disabling VNC forwarding for Linux VM When creating and destroying Linux VMs, the host agent automatically manages the vncterm processes which convert the text console into VNC. Advanced users who wish to directly access the text console can disable VNC forwarding for that VM. The text console can then only be accessed directly from the control domain directly, and graphical interfaces such as XenCenter will not be able to render a console for that VM. Procedure 5.2. To disable a Linux VNC console using the CLI: 1. Before starting the guest, set the following parameter on the VM record: 25

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37

XenServer API extensions
25
2.
Master/443 to Client: Returns a session reference to be used with subsequent calls.
3.
Client to Master/443: XML-RPC:
VM.get_by_name_label(...)
.
4.
Master/443 to Client: Returns a reference to a particular VM (or the "control domain" if you want to retrieve
the physical host console).
5.
Client to Master/443: XML-RPC:
VM.get_consoles(...)
.
6.
Master/443 to Client: Returns a list of console objects associated with the VM.
7.
Client to Master/443: XML-RPC:
VM.get_location(...)
.
8. Returns a URI describing where the requested console is located. The URIs are of the form:
.
9.
Client to 192.168.0.1: HTTP CONNECT "/console?ref=(...)"
The final HTTP CONNECT is slightly non-standard since the HTTP/1.1 RFC specifies that it should only be
a host and a port, rather than a URL. Once the HTTP connect is complete, the connection can subsequently
directly be used as a VNC server without any further HTTP protocol action.
This scheme requires direct access from the client to the control domain's IP, and will not work correctly if
there are Network Address Translation (NAT) devices blocking such connectivity. You can use the CLI to
retrieve the console URI from the client and perform a connectivity check.
Procedure 5.1. To retrieve a console URI via the CLI
1.
Retrieve the VM UUID via:
xe vm-list params=uuid --minimal name-label=
name
2.
Retrieve the console information via:
xe console-list vm-uuid=
uuid
uuid ( RO): 714f388b-31ed-67cb-617b-0276e35155ef
vm-uuid ( RO): 8acb7723-a5f0-5fc5-cd53-9f1e3a7d3069
vm-name-label ( RO): etch
protocol ( RO): RFB
Use command-line utilities like
ping
to test connectivity to the IP address provided in the
location
field.
5.1.2. Disabling VNC forwarding for Linux VM
When creating and destroying Linux VMs, the host agent automatically manages the
vncterm
processes
which convert the text console into VNC. Advanced users who wish to directly access the text console can
disable VNC forwarding for that VM. The text console can then only be accessed directly from the control
domain directly, and graphical interfaces such as XenCenter will not be able to render a console for that VM.
Procedure 5.2. To disable a Linux VNC console using the CLI:
1.
Before starting the guest, set the following parameter on the VM record: