How to access Hosted Engine VM console from RHEV-H host?
Environment
- Red Hat Virtualization (RHEV) 4.3
- Hosted Engine (HE) environment
Issue
Sometimes serial console access is needed to access Hosted Engine (HE) VM from RHEV-H host, that does not support graphical interface. How can the console be accessed?
Resolution
VNC
To connect using VNC, check which port is being used, and set a console password. On the host running HostedEngine, run:
hosted-engine --add-console-password --password=mypass
virsh -r dumpxml HostedEngine | grep ValidTo
Then from your client, connect to the host like so:
remote-viewer vnc://<host>:5900
Where
SPICE
To make a SPICE connection (if needed) with a remote-viewer, hosted-engine --add-console-password won't work, so vdsm-client VM setTicket is needed.
First, create a text file on the host running HostedEngine, similar to:
$ cat console.json
{
"params": {
"deviceType": "graphics",
"graphicsType": "spice"
},
"password": "mypass",
"vmID": "<HE-UUID>",
"existingConnAction": "disconnect",
"ttl": 60
}
Where "<HE-UUID>" is the UUID of your HostedEngine instance.
Then, set a ticket:
date && vdsm-client -f console.json VM setTicket && virsh -r dumpxml HostedEngine | grep ValidTo
and connetc to the SPICE tlsPort from your client: ("
remote-viewer --spice-ca-file=rhvm-ca.pem spice://<FQDN>?tls-port=<PORT>
and "<FQDN>" is the fully qualified domain name of the hypervisor running the HostedEngine instance (FQDN must match CA certificate details)
If needed, the ca certificate can be copied from a hypervisor (/etc/pki/vdsm/libvirt-spice/ca-cert.pem)
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.