Category Archives: OpenStack

Configure VNC console through Horizon in HA environment the right way

This article shortly describes how to configure the VNC console access to OpenStack instances through Horizon in a high-availability environment. This configuration is currently valid for OpenStack Juno or RHEL OSP 6. If you change these settings after you already deployed instances in your environment theses changes only takes effect for instances which are created AFTER your changes described here. Continue reading

Foreman Template writing

Foreman uses common ERB style templating. Foreman templates consists of a mixture of Bash scripts and appropriate macros and functions. You can find a list of built-in macros and functions here. Within such macro you can use further Ruby code. For example to extract the last digits og an IP address you can use the following macro:

LAST_DIGIT=< %=@host.ip.to_s.split('.')[-1]%>

Where @host.ip is a built-in macro in Foreman (see link above), to_s is Ruby code and means “convert into string”, split wherever you find a “.” and read the output reverse and take the last value (“-1”).

If you want to check if a template will render correctly for an appropriate host you can open your template in your browser: