<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.cipherspace.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Stoyan</id>
	<title>CipherSpace Client Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.cipherspace.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Stoyan"/>
	<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php/Special:Contributions/Stoyan"/>
	<updated>2026-04-06T23:49:38Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.36.2</generator>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=FileCabinet_Setup&amp;diff=881</id>
		<title>FileCabinet Setup</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=FileCabinet_Setup&amp;diff=881"/>
		<updated>2018-03-02T13:04:59Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:How To‏‎]]&lt;br /&gt;
[[Category:UserGuide‏‎]]&lt;br /&gt;
This wiki explains the first steps you should take before using FileCabinet.&lt;br /&gt;
&lt;br /&gt;
== Login ==&lt;br /&gt;
&lt;br /&gt;
To access FileCabinet for the first time, you have received an invitation by email, which contains your username and password.&lt;br /&gt;
&lt;br /&gt;
Go to [https://filecabinet.ch FileCabinet.ch]&lt;br /&gt;
&lt;br /&gt;
[[File:fc_1.png|600px|border]]&lt;br /&gt;
&lt;br /&gt;
And enter your username and password. The following screen appears:&lt;br /&gt;
&lt;br /&gt;
[[File:fc_2.png|600px|border]]&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;amp;quot;X&amp;amp;quot; at the top-right of the pop-up window to close it. You will be able to download the desktop apps later on.&lt;br /&gt;
&lt;br /&gt;
== Change Password ==&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;amp;quot;cog wheel&amp;amp;quot; icon [[File:fc_2a.png|25px|border]]  at the top-right of the screen and click on &amp;amp;quot;Personal&amp;amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[File:fc_3.png|150px|border]]&lt;br /&gt;
&lt;br /&gt;
The following screen appears:&lt;br /&gt;
&lt;br /&gt;
[[File:fc_3a.png|600px|border]]&lt;br /&gt;
&lt;br /&gt;
Under &amp;amp;quot;Password&amp;amp;quot;, enter the password you&amp;#039;ve received in the &amp;amp;quot;Current password&amp;amp;quot; field, enter your chosen password in the &amp;amp;quot;New password&amp;amp;quot; field (you can click on the &amp;amp;quot;eye&amp;amp;quot; icon to see what you are typing) and click on &amp;amp;quot;Change password&amp;amp;quot;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;IMPORTANT:&amp;#039;&amp;#039;&amp;#039; your chosen password must be at least &amp;#039;&amp;#039;8 characters long&amp;#039;&amp;#039; and contain at least &amp;#039;&amp;#039;one capital letter, one lower letter and one digit&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
When you have clicked on &amp;amp;quot;Change password&amp;amp;quot;, the window will scroll down, to allow you to enter specific app passwords (e.g. for your desktop app). Scroll up and check if your password has been changed correctly. If there is an error, it will show it on the screen.&lt;br /&gt;
&lt;br /&gt;
== Password Recovery ==&lt;br /&gt;
&lt;br /&gt;
In the left menu, click on &amp;amp;quot;Basic encryption module&amp;amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[File:fc_4.png|600px|border]]&lt;br /&gt;
&lt;br /&gt;
You will see the option &amp;amp;quot;Enable password recovery&amp;amp;quot;, which is disabled per default.&lt;br /&gt;
&lt;br /&gt;
If you leave this option disabled, &amp;#039;&amp;#039;&amp;#039;make sure that you back up your password in a safe place&amp;#039;&amp;#039;&amp;#039;, because if you lose your password and you have not enabled this option, then when an administrator resets your password, &amp;#039;&amp;#039;&amp;#039;you will lose access to all your files stored on FileCabinet.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you enable this option, when an administrator resets your password, you will be able to access your files, but &amp;#039;&amp;#039;&amp;#039;you also give an administrator the possibility to access these files as well.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
So it is your decision wether you want to enable this option or not.&lt;br /&gt;
&lt;br /&gt;
== Two-Factor Authentication ==&lt;br /&gt;
&lt;br /&gt;
We recommend you enable this option, as it adds a second layer to authenticate yourself.&lt;br /&gt;
&lt;br /&gt;
You will need an app on your phone (for instance Google Authenticator) to generate a token, which is then needed to log you in. Look for apps which support the TOTP (Time-based One Time Password) protocol.&lt;br /&gt;
&lt;br /&gt;
Once you have the app on your phone, click on &amp;amp;quot;TOTP second-factor auth&amp;amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[File:fc_7.png|800px|border]]&lt;br /&gt;
&lt;br /&gt;
And check the &amp;amp;quot;Enable TOTP&amp;amp;quot; box. You might get the following screen:&lt;br /&gt;
&lt;br /&gt;
[[File:fc_7a.png|300px|border]]&lt;br /&gt;
&lt;br /&gt;
If you do, enter your password and click on &amp;amp;quot;Confirm&amp;amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You will see a screen similar as the following:&lt;br /&gt;
&lt;br /&gt;
[[File:fc_8.png|500px|border]]&lt;br /&gt;
&lt;br /&gt;
Set up your phone app with the information from the screen. Your app will then generate a code. Enter this code in the &amp;amp;quot;Authentication code&amp;amp;quot; field and click on &amp;amp;quot;Verify&amp;amp;quot;. You will then see that the &amp;amp;quot;Enable TOTP&amp;amp;quot; box is checked.&lt;br /&gt;
&lt;br /&gt;
Go now on &amp;amp;quot;Second-factor backup codes&amp;amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[File:fc_9.png|400px|border]]&lt;br /&gt;
&lt;br /&gt;
You can use backup codes to allow you to log in instead of using your authenticator app.&lt;br /&gt;
&lt;br /&gt;
Click on &amp;amp;quot;Generate backup codes&amp;amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[File:fc_10.png|400px|border]]&lt;br /&gt;
&lt;br /&gt;
And save or print the generated codes. &amp;#039;&amp;#039;&amp;#039;Please make sure you keep those code in a secure place as they can be used instead of code generated by the Second Factor Authenticator application. Also, backup codes are needed in case you no longer have access to the Authenticator application.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
== App Passwords ==&lt;br /&gt;
&lt;br /&gt;
When you connect an app (e.g. the desktop app) to FileCabinet, you need to enter some credentials in order to log in. If you want to use another password than your own, or if you are using  [[#Two-Factor Authentication|two-factor authentication]], you can generate individual passwords for your apps.&lt;br /&gt;
&lt;br /&gt;
[[File:fc_5.png|600px|border]]&lt;br /&gt;
&lt;br /&gt;
Enter the name of your app in the field &amp;amp;quot;App name&amp;amp;quot; and click on &amp;amp;quot;Create new app password&amp;amp;quot;. You will see a screen similar as this one:&lt;br /&gt;
&lt;br /&gt;
[[File:fc_6.png|600px|border]]&lt;br /&gt;
&lt;br /&gt;
Copy the new generated password in order to configure your app later on.&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=FileCabinet_Setup&amp;diff=859</id>
		<title>FileCabinet Setup</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=FileCabinet_Setup&amp;diff=859"/>
		<updated>2018-01-03T16:12:38Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:How To‏‎]]&lt;br /&gt;
[[Category:UserGuide‏‎]]&lt;br /&gt;
This wiki explains the first steps you should take before using FileCabinet.&lt;br /&gt;
&lt;br /&gt;
== Login ==&lt;br /&gt;
&lt;br /&gt;
To access FileCabinet for the first time, you have received an invitation by email, which contains your username and password.&lt;br /&gt;
&lt;br /&gt;
Go to [https://filecabinet.ch FileCabinet.ch]&lt;br /&gt;
&lt;br /&gt;
[[File:fc_1.png|600px|border]]&lt;br /&gt;
&lt;br /&gt;
And enter your username and password. The following screen appears:&lt;br /&gt;
&lt;br /&gt;
[[File:fc_2.png|600px|border]]&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;amp;quot;X&amp;amp;quot; at the top-right of the pop-up window to close it. You will be able to download the desktop apps later on.&lt;br /&gt;
&lt;br /&gt;
== Change Password ==&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;amp;quot;cog wheel&amp;amp;quot; icon [[File:fc_2a.png|25px|border]]  at the top-right of the screen and click on &amp;amp;quot;Personal&amp;amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[File:fc_3.png|150px|border]]&lt;br /&gt;
&lt;br /&gt;
The following screen appears:&lt;br /&gt;
&lt;br /&gt;
[[File:fc_3a.png|600px|border]]&lt;br /&gt;
&lt;br /&gt;
Under &amp;amp;quot;Password&amp;amp;quot;, enter the password you&amp;#039;ve received in the &amp;amp;quot;Current password&amp;amp;quot; field, enter your chosen password in the &amp;amp;quot;New password&amp;amp;quot; field (you can click on the &amp;amp;quot;eye&amp;amp;quot; icon to see what you are typing) and click on &amp;amp;quot;Change password&amp;amp;quot;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;IMPORTANT:&amp;#039;&amp;#039;&amp;#039; your chosen password must be at least &amp;#039;&amp;#039;8 characters long&amp;#039;&amp;#039; and contain at least &amp;#039;&amp;#039;one capital letter, one lower letter and one digit&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
When you have clicked on &amp;amp;quot;Change password&amp;amp;quot;, the window will scroll down, to allow you to enter specific app passwords (e.g. for your desktop app). Scroll up and check if your password has been changed correctly. If there is an error, it will show it on the screen.&lt;br /&gt;
&lt;br /&gt;
== Password Recovery ==&lt;br /&gt;
&lt;br /&gt;
In the left menu, click on &amp;amp;quot;Basic encryption module&amp;amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[File:fc_4.png|600px|border]]&lt;br /&gt;
&lt;br /&gt;
You will see the option &amp;amp;quot;Enable password recovery&amp;amp;quot;, which is disabled per default.&lt;br /&gt;
&lt;br /&gt;
If you leave this option disabled, &amp;#039;&amp;#039;&amp;#039;make sure that you back up your password in a safe place&amp;#039;&amp;#039;&amp;#039;, because if you lose your password and you have not enabled this option, then when an administrator resets your password, &amp;#039;&amp;#039;&amp;#039;you will lose access to all your files stored on FileCabinet.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you enable this option, when an administrator resets your password, you will be able to access your files, but &amp;#039;&amp;#039;&amp;#039;you also give an administrator the possibility to access these files as well.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
So it is your decision wether you want to enable this option or not.&lt;br /&gt;
&lt;br /&gt;
== App Passwords ==&lt;br /&gt;
&lt;br /&gt;
When you connect an app (e.g. the desktop app) to FileCabinet, you need to enter some credentials in order to log in. If you want to use another password than your own, or if you are using  [[#Two-Factor Authentication|two-factor authentication]], you can generate individual passwords for your apps.&lt;br /&gt;
&lt;br /&gt;
[[File:fc_5.png|600px|border]]&lt;br /&gt;
&lt;br /&gt;
Enter the name of your app in the field &amp;amp;quot;App name&amp;amp;quot; and click on &amp;amp;quot;Create new app password&amp;amp;quot;. You will see a screen similar as this one:&lt;br /&gt;
&lt;br /&gt;
[[File:fc_6.png|600px|border]]&lt;br /&gt;
&lt;br /&gt;
Copy the new generated password in order to configure your app later on.&lt;br /&gt;
&lt;br /&gt;
== Two-Factor Authentication ==&lt;br /&gt;
&lt;br /&gt;
We recommend you enable this option, as it adds a second layer to authenticate yourself.&lt;br /&gt;
&lt;br /&gt;
You will need an app on your phone (for instance Google Authenticator) to generate a token, which is then needed to log you in. Look for apps which support the TOTP (Time-based One Time Password) protocol.&lt;br /&gt;
&lt;br /&gt;
Once you have the app on your phone, click on &amp;amp;quot;TOTP second-factor auth&amp;amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[File:fc_7.png|800px|border]]&lt;br /&gt;
&lt;br /&gt;
And check the &amp;amp;quot;Enable TOTP&amp;amp;quot; box. You might get the following screen:&lt;br /&gt;
&lt;br /&gt;
[[File:fc_7a.png|300px|border]]&lt;br /&gt;
&lt;br /&gt;
If you do, enter your password and click on &amp;amp;quot;Confirm&amp;amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You will see a screen similar as the following:&lt;br /&gt;
&lt;br /&gt;
[[File:fc_8.png|500px|border]]&lt;br /&gt;
&lt;br /&gt;
Set up your phone app with the information from the screen. Your app will then generate a code. Enter this code in the &amp;amp;quot;Authentication code&amp;amp;quot; field and click on &amp;amp;quot;Verify&amp;amp;quot;. You will then see that the &amp;amp;quot;Enable TOTP&amp;amp;quot; box is checked.&lt;br /&gt;
&lt;br /&gt;
Go now on &amp;amp;quot;Second-factor backup codes&amp;amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[File:fc_9.png|400px|border]]&lt;br /&gt;
&lt;br /&gt;
You can use backup codes to allow you to log in instead of using your authenticator app.&lt;br /&gt;
&lt;br /&gt;
Click on &amp;amp;quot;Generate backup codes&amp;amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[File:fc_10.png|400px|border]]&lt;br /&gt;
&lt;br /&gt;
And save or print the generated codes.&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=Using_PuTTY_with_SSH_Key_Pair&amp;diff=830</id>
		<title>Using PuTTY with SSH Key Pair</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=Using_PuTTY_with_SSH_Key_Pair&amp;diff=830"/>
		<updated>2017-08-17T17:19:25Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: Stoyan moved page PuTTY to Using PuTTY with SSH Key Pair without leaving a redirect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:How To]]&lt;br /&gt;
[[Category:CloudInfrastructure]]&lt;br /&gt;
&lt;br /&gt;
== PuTTY ==&lt;br /&gt;
&lt;br /&gt;
PuTTY is an SSH and telnet client, developed originally by Simon Tatham for the Windows platform. PuTTY is open source software that is available with source code and is developed and supported by a group of volunteers.&lt;br /&gt;
&lt;br /&gt;
== Install PuTTY ==&lt;br /&gt;
&lt;br /&gt;
# Go to [https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html this site] and download the MSI (Windows Installer) package for your architecture (32 or 64 bit).&lt;br /&gt;
# Run the installer and accept all the default values. You will need administrator rights to install the package.&lt;br /&gt;
&lt;br /&gt;
== Create a SSH Key Pair ==&lt;br /&gt;
&lt;br /&gt;
# Start the program &amp;amp;quot;PuTTYgen&amp;amp;quot; (which was installed with PuTTY previously).&lt;br /&gt;
#:[[File:PuTTY_Gen_1.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Under &amp;amp;quot;Parameters&amp;amp;quot;, for &amp;amp;quot;Type of key to generate:&amp;amp;quot; select RSA and in the field &amp;amp;quot;Number of bits in a generated key:&amp;amp;quot; put the value &amp;#039;4096&amp;#039;&lt;br /&gt;
#:[[File:PuTTY_Gen_2.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Under &amp;amp;quot;Actions&amp;amp;quot;, click on &amp;amp;quot;Generate&amp;amp;quot;,&lt;br /&gt;
#:[[File:PuTTY_Gen_3.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
#:then move the mouse on the blank area until the green bar is filled.&lt;br /&gt;
#:[[File:PuTTY_Gen_4.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
#:You should get a similar screen:&lt;br /&gt;
#:[[File:PuTTY_Gen_5.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Add a key passphrase in the fields &amp;amp;quot;Key passphrase:&amp;amp;quot; and &amp;amp;quot;Confirm passphrase:&amp;amp;quot;.&lt;br /&gt;
#:[[File:PuTTY_Gen_6.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Click on &amp;amp;quot;Save private key&amp;amp;quot; and give it the name &amp;amp;quot;CipherSpace&amp;amp;quot;&lt;br /&gt;
#:[[File:PuTTY_Gen_7.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Click on &amp;amp;quot;Save public key&amp;amp;quot; and give it the name &amp;amp;quot;CipherSpace.pub&amp;amp;quot;.&lt;br /&gt;
#:[[File:PuTTY_Gen_8.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Send the public key (&amp;amp;quot;CipherSpace.pub&amp;amp;quot;) to CipherSpace in order to be included in your environment.&lt;br /&gt;
&lt;br /&gt;
== Create a PuTTY session ==&lt;br /&gt;
&lt;br /&gt;
In order to connect to a machine via PuTTY for the first time, you need to create a session.&lt;br /&gt;
&lt;br /&gt;
# Start the program &amp;amp;quot;PuTTY&amp;amp;quot;&lt;br /&gt;
#:[[File:PuTTY_Conf_1.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Go to &amp;amp;quot;Session&amp;amp;quot; and enter the host name (or IP address) and the port of the machine you want to reach. The connection type is &amp;amp;quot;SSH&amp;amp;quot;.&lt;br /&gt;
#:[[File:PuTTY_Conf_2.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Optional: Go to &amp;amp;quot;Connection -&amp;amp;gt; Data&amp;amp;quot; and enter the username for the machine you want to connect with.&lt;br /&gt;
#:[[File:PuTTY_Conf_3.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Go to &amp;amp;quot;Connection -&amp;amp;gt; SSH -&amp;amp;gt; Auth&amp;amp;quot;, then next to the field &amp;amp;quot;Private key file for authentication:&amp;amp;quot; click on the button &amp;amp;quot;Browse...&amp;amp;quot;&lt;br /&gt;
#:[[File:PuTTY_Conf_4.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
#:and select the private key &amp;amp;quot;CipherSpace.ppk&amp;amp;quot;.&lt;br /&gt;
#:[[File:PuTTY_Conf_5.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Go back to &amp;amp;quot;Session&amp;amp;quot;, then under the field &amp;amp;quot;Saved Sessions&amp;amp;quot; enter a name (for instance &amp;amp;quot;CipherSpace VM1&amp;amp;quot;) and click on &amp;amp;quot;Save&amp;amp;quot;.&lt;br /&gt;
#:[[File:PuTTY_Conf_6.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
#:You&amp;#039;ll be able to load this configuration for a new session.&lt;br /&gt;
&lt;br /&gt;
== Connect with PuTTY ==&lt;br /&gt;
&lt;br /&gt;
# Start the program &amp;amp;quot;PuTTY&amp;amp;quot;&lt;br /&gt;
#:[[File:PuTTY_Run_1.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Go to &amp;amp;quot;Session&amp;amp;quot;, then under the field &amp;amp;quot;Saved Sessions&amp;amp;quot; select the session you&amp;#039;ve created previously and click on &amp;amp;quot;Load&amp;amp;quot;&lt;br /&gt;
#:[[File:PuTTY_Run_2.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Click on &amp;amp;quot;Open&amp;amp;quot;&lt;br /&gt;
#:[[File:PuTTY_Run_3.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# If you get the error &amp;amp;quot;Network error: Connection refused&amp;amp;quot;,&lt;br /&gt;
#:[[File:PuTTY_Run_4.png|300px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
#:close the window, restart PuTTY and under &amp;amp;quot;Session&amp;amp;quot; check that the hostname and the port are correct.&lt;br /&gt;
# The first time you connect to a machine, you will get the following warning:&lt;br /&gt;
#:[[File:PuTTY_Run_5.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
#:Click on &amp;amp;quot;Yes&amp;amp;quot; to avoid the warning for the next sessions.&lt;br /&gt;
# If you get the error &amp;amp;quot;Disconnected: No supported authentication methods available (server sent: publickey)&amp;amp;quot;,&lt;br /&gt;
#:[[File:PuTTY_Run_6.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
#:it means you have forgotten to add your private key under &amp;amp;quot;Connection -&amp;amp;gt; SSH -&amp;amp;gt; Auth&amp;amp;quot; (see the point 4. in [[#Create a PuTTY session|this section]])&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=Using_PuTTY_with_SSH_Key_Pair&amp;diff=829</id>
		<title>Using PuTTY with SSH Key Pair</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=Using_PuTTY_with_SSH_Key_Pair&amp;diff=829"/>
		<updated>2017-08-17T17:18:41Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:How To]]&lt;br /&gt;
[[Category:CloudInfrastructure]]&lt;br /&gt;
&lt;br /&gt;
== PuTTY ==&lt;br /&gt;
&lt;br /&gt;
PuTTY is an SSH and telnet client, developed originally by Simon Tatham for the Windows platform. PuTTY is open source software that is available with source code and is developed and supported by a group of volunteers.&lt;br /&gt;
&lt;br /&gt;
== Install PuTTY ==&lt;br /&gt;
&lt;br /&gt;
# Go to [https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html this site] and download the MSI (Windows Installer) package for your architecture (32 or 64 bit).&lt;br /&gt;
# Run the installer and accept all the default values. You will need administrator rights to install the package.&lt;br /&gt;
&lt;br /&gt;
== Create a SSH Key Pair ==&lt;br /&gt;
&lt;br /&gt;
# Start the program &amp;amp;quot;PuTTYgen&amp;amp;quot; (which was installed with PuTTY previously).&lt;br /&gt;
#:[[File:PuTTY_Gen_1.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Under &amp;amp;quot;Parameters&amp;amp;quot;, for &amp;amp;quot;Type of key to generate:&amp;amp;quot; select RSA and in the field &amp;amp;quot;Number of bits in a generated key:&amp;amp;quot; put the value &amp;#039;4096&amp;#039;&lt;br /&gt;
#:[[File:PuTTY_Gen_2.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Under &amp;amp;quot;Actions&amp;amp;quot;, click on &amp;amp;quot;Generate&amp;amp;quot;,&lt;br /&gt;
#:[[File:PuTTY_Gen_3.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
#:then move the mouse on the blank area until the green bar is filled.&lt;br /&gt;
#:[[File:PuTTY_Gen_4.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
#:You should get a similar screen:&lt;br /&gt;
#:[[File:PuTTY_Gen_5.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Add a key passphrase in the fields &amp;amp;quot;Key passphrase:&amp;amp;quot; and &amp;amp;quot;Confirm passphrase:&amp;amp;quot;.&lt;br /&gt;
#:[[File:PuTTY_Gen_6.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Click on &amp;amp;quot;Save private key&amp;amp;quot; and give it the name &amp;amp;quot;CipherSpace&amp;amp;quot;&lt;br /&gt;
#:[[File:PuTTY_Gen_7.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Click on &amp;amp;quot;Save public key&amp;amp;quot; and give it the name &amp;amp;quot;CipherSpace.pub&amp;amp;quot;.&lt;br /&gt;
#:[[File:PuTTY_Gen_8.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Send the public key (&amp;amp;quot;CipherSpace.pub&amp;amp;quot;) to CipherSpace in order to be included in your environment.&lt;br /&gt;
&lt;br /&gt;
== Create a PuTTY session ==&lt;br /&gt;
&lt;br /&gt;
In order to connect to a machine via PuTTY for the first time, you need to create a session.&lt;br /&gt;
&lt;br /&gt;
# Start the program &amp;amp;quot;PuTTY&amp;amp;quot;&lt;br /&gt;
#:[[File:PuTTY_Conf_1.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Go to &amp;amp;quot;Session&amp;amp;quot; and enter the host name (or IP address) and the port of the machine you want to reach. The connection type is &amp;amp;quot;SSH&amp;amp;quot;.&lt;br /&gt;
#:[[File:PuTTY_Conf_2.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Optional: Go to &amp;amp;quot;Connection -&amp;amp;gt; Data&amp;amp;quot; and enter the username for the machine you want to connect with.&lt;br /&gt;
#:[[File:PuTTY_Conf_3.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Go to &amp;amp;quot;Connection -&amp;amp;gt; SSH -&amp;amp;gt; Auth&amp;amp;quot;, then next to the field &amp;amp;quot;Private key file for authentication:&amp;amp;quot; click on the button &amp;amp;quot;Browse...&amp;amp;quot;&lt;br /&gt;
#:[[File:PuTTY_Conf_4.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
#:and select the private key &amp;amp;quot;CipherSpace.ppk&amp;amp;quot;.&lt;br /&gt;
#:[[File:PuTTY_Conf_5.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Go back to &amp;amp;quot;Session&amp;amp;quot;, then under the field &amp;amp;quot;Saved Sessions&amp;amp;quot; enter a name (for instance &amp;amp;quot;CipherSpace VM1&amp;amp;quot;) and click on &amp;amp;quot;Save&amp;amp;quot;.&lt;br /&gt;
#:[[File:PuTTY_Conf_6.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
#:You&amp;#039;ll be able to load this configuration for a new session.&lt;br /&gt;
&lt;br /&gt;
== Connect with PuTTY ==&lt;br /&gt;
&lt;br /&gt;
# Start the program &amp;amp;quot;PuTTY&amp;amp;quot;&lt;br /&gt;
#:[[File:PuTTY_Run_1.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Go to &amp;amp;quot;Session&amp;amp;quot;, then under the field &amp;amp;quot;Saved Sessions&amp;amp;quot; select the session you&amp;#039;ve created previously and click on &amp;amp;quot;Load&amp;amp;quot;&lt;br /&gt;
#:[[File:PuTTY_Run_2.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Click on &amp;amp;quot;Open&amp;amp;quot;&lt;br /&gt;
#:[[File:PuTTY_Run_3.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# If you get the error &amp;amp;quot;Network error: Connection refused&amp;amp;quot;,&lt;br /&gt;
#:[[File:PuTTY_Run_4.png|300px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
#:close the window, restart PuTTY and under &amp;amp;quot;Session&amp;amp;quot; check that the hostname and the port are correct.&lt;br /&gt;
# The first time you connect to a machine, you will get the following warning:&lt;br /&gt;
#:[[File:PuTTY_Run_5.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
#:Click on &amp;amp;quot;Yes&amp;amp;quot; to avoid the warning for the next sessions.&lt;br /&gt;
# If you get the error &amp;amp;quot;Disconnected: No supported authentication methods available (server sent: publickey)&amp;amp;quot;,&lt;br /&gt;
#:[[File:PuTTY_Run_6.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
#:it means you have forgotten to add your private key under &amp;amp;quot;Connection -&amp;amp;gt; SSH -&amp;amp;gt; Auth&amp;amp;quot; (see the point 4. in [[#Create a PuTTY session|this section]])&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=CipherSpace_Load_Balancer&amp;diff=754</id>
		<title>CipherSpace Load Balancer</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=CipherSpace_Load_Balancer&amp;diff=754"/>
		<updated>2017-08-02T14:56:08Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: /* HTTP only Variables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OpenNebula]]&lt;br /&gt;
[[Category:How To]]&lt;br /&gt;
[[Category:CloudInfrastructure]]&lt;br /&gt;
== CipherSpace Load Balancer ==&lt;br /&gt;
&lt;br /&gt;
The CipherSpace Load Balancer uses [http://www.haproxy.org/ HAProxy] and its configuration is defined using OpenNebula Contextualization Variables within the appliance&amp;#039;s template.&lt;br /&gt;
&lt;br /&gt;
The CipherSpace Load Balancer uses the concept of &amp;amp;quot;sticky sessions&amp;amp;quot;, which is a mechanism to route requests from the same source to the same target (if the target is still available).&lt;br /&gt;
&lt;br /&gt;
== How to use the CipherSpace Load Balancer ==&lt;br /&gt;
&lt;br /&gt;
=== Download the Load Balancer from the App Market ===&lt;br /&gt;
&lt;br /&gt;
# Go to &amp;amp;quot;Storage&amp;amp;quot; in the left menu and click on &amp;amp;quot;Apps&amp;amp;quot; in the drop down menu.&lt;br /&gt;
#:[[file:lb_1.png|150px|border]]&lt;br /&gt;
#:A list with all existing apps will appear.&lt;br /&gt;
#:[[file:lb_2.png|700px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Select the CipherSpace Load Balancer and click on the &amp;amp;quot;-&amp;amp;gt; OpenNebula&amp;amp;quot; button.&lt;br /&gt;
#:[[file:lb_3.png|700px|border]]&lt;br /&gt;
#:A new window will appear.&lt;br /&gt;
#:[[file:lb_4.png|700px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# You can rename the image (&amp;amp;quot;Name&amp;amp;quot;) as well as the VM template name. Then select the datastore which is used for your VMs and click on &amp;amp;quot;Download&amp;amp;quot;. A new image as well as a new template will be created.&lt;br /&gt;
&lt;br /&gt;
=== Configure the Load Balancer ===&lt;br /&gt;
&lt;br /&gt;
# Go to &amp;amp;quot;Templates&amp;amp;quot; in the left menu and click on &amp;amp;quot;VMs&amp;amp;quot; in the drop down menu.&lt;br /&gt;
#:[[file:lb_5.png|125px|border]]&lt;br /&gt;
#:A list with all existing VM templates will appear.&lt;br /&gt;
#:[[file:lb_6.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Select the template for the load balancer and click on &amp;amp;quot;Update&amp;amp;quot;.&lt;br /&gt;
#:[[file:lb_7.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Click on the &amp;amp;quot;Network&amp;amp;quot; tab&lt;br /&gt;
#:[[file:lb_8.png|500px|border]]&lt;br /&gt;
#:and select a Virtual Network for your NIC (the same network as the VMs which provide the service you would like to load balance).&lt;br /&gt;
#:[[file:lb_9.png|600px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
#:If clients connect to your load balancer from a different network (Internet for example) you need to add another NIC and attach it to the appropriate Virtual Network.&lt;br /&gt;
#:[[file:lb_10.png|600px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Click on the &amp;amp;quot;Context&amp;amp;quot; tab&lt;br /&gt;
#:[[file:lb_11.png|500px|border]]&lt;br /&gt;
#:and then click on the &amp;amp;quot;Custom vars&amp;amp;quot; section.&lt;br /&gt;
#:[[file:lb_12.png|600px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# In the &amp;amp;quot;Custom vars&amp;amp;quot; section, click on the &amp;amp;quot;+&amp;amp;quot; button to enter all the necessary contextualization variables and their respective values (see the section [[#Load Balancer Contextualization Variables | Load Balancer Contextualization Variables]]).&lt;br /&gt;
#:[[file:lb_13.png|700px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# If you have 2 NICs, you should set default gateway by adding the variable &amp;lt;code&amp;gt;GATEWAY_IFACE&amp;lt;/code&amp;gt;and assign it with the number of the NIC on which requests from clients are coming.  (typically &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;).&lt;br /&gt;
#:&amp;lt;code&amp;gt;GATEWAY_IFACE = 1&amp;lt;/code&amp;gt;&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# When you&amp;#039;re done, click on &amp;amp;quot;Update&amp;amp;quot; to save your changes.&lt;br /&gt;
#:[[file:lb_14.png|700px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Load Balancer Contextualization Variables ===&lt;br /&gt;
&lt;br /&gt;
==== Basic Configuration ====&lt;br /&gt;
&lt;br /&gt;
In order to understand the contextualization variables, let&amp;#039;s use the following example.&lt;br /&gt;
&lt;br /&gt;
You have three web servers and a load balancer attached to the same virtual network. The web servers have the IP addresses &amp;lt;code&amp;gt;10.4.0.11&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;10.4.0.12&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;10.4.0.13&amp;lt;/code&amp;gt; respectively. They listen to &amp;lt;code&amp;gt;http&amp;lt;/code&amp;gt; traffic on port &amp;lt;code&amp;gt;8080&amp;lt;/code&amp;gt;. The load balancer listens to &amp;lt;code&amp;gt;http&amp;lt;/code&amp;gt; traffic on the port &amp;lt;code&amp;gt;80&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In this example you only have one service (http) which needs to be balanced.&amp;lt;br /&amp;gt;&lt;br /&gt;
Every contextualization variable for this service will have a name like &amp;lt;code&amp;gt;SERVICE_0_...&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
If you define more services, each new service variables will start with&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;SERVICE_1_&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;SERVICE_2_&amp;lt;/code&amp;gt;, etc..&lt;br /&gt;
&lt;br /&gt;
For this particular example you will define the following variables:&lt;br /&gt;
&lt;br /&gt;
* SERVICE_0_PROTO&lt;br /&gt;
* SERVICE_0_LISTEN_PORT&lt;br /&gt;
* SERVICE_0_IP_RANGE&lt;br /&gt;
* SERVICE_0_BACKEND_PORT&lt;br /&gt;
&lt;br /&gt;
The variable &amp;lt;code&amp;gt;SERVICE_X_PROTO&amp;lt;/code&amp;gt; defines the mode in which the service works. Possible modes are:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;http&amp;#039;&amp;#039;&amp;#039;: the instance will work in HTTP mode. The client request will be analyzed in depth before connecting to any server. Any request which is not RFC-compliant will be rejected. Layer 7 filtering, processing and switching will be possible.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;tcp&amp;#039;&amp;#039;&amp;#039;: the instance will work in pure TCP mode. A full-duplex connection will be established between clients and servers, and no layer 7 examination will be performed. It should be used for SSL, SSH, SMTP, ...&lt;br /&gt;
&lt;br /&gt;
In our example &amp;lt;code&amp;gt;SERVICE_0_PROTO&amp;lt;/code&amp;gt; has the value &amp;lt;code&amp;gt;HTTP&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variable &amp;lt;code&amp;gt;SERVICE_X_LISTEN_PORT&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the TCP port the load balancer is listening to.&amp;lt;br /&amp;gt;&lt;br /&gt;
This variable is &amp;#039;&amp;#039;&amp;#039;mandatory&amp;#039;&amp;#039;&amp;#039;. If this variable isn&amp;#039;t defined, the rest of the service definition will be ignored.&amp;lt;br /&amp;gt;&lt;br /&gt;
In our example &amp;lt;code&amp;gt;SERVICE_0_LISTEN_PORT&amp;lt;/code&amp;gt; has the value &amp;lt;code&amp;gt;80&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variable &amp;lt;code&amp;gt;SERVICE_X_IP_RANGE&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;dotted&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;notation&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the IP addresses of the backend servers. This variable is &amp;#039;&amp;#039;&amp;#039;mandatory&amp;#039;&amp;#039;&amp;#039;.&amp;lt;br /&amp;gt;&lt;br /&gt;
In our example &amp;lt;code&amp;gt;SERVICE_X_IP_RANGE&amp;lt;/code&amp;gt; has the value &amp;lt;code&amp;gt;10.4.0.11-10.4.0.13&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variable &amp;lt;code&amp;gt;SERVICE_X_BACKEND_PORT&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the TCP port the backend servers are listening to. This variable is optional. If this variable isn&amp;#039;t defined, the value of the variable &amp;lt;code&amp;gt;SERVICE_X_LISTEN_PORT&amp;lt;/code&amp;gt; will be used instead.&amp;lt;br /&amp;gt;&lt;br /&gt;
In our example &amp;lt;code&amp;gt;SERVICE_X_BACKEND_PORT&amp;lt;/code&amp;gt; has the value &amp;lt;code&amp;gt;8080&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, our example will be configured as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;   SERVICE_0_PROTO        = HTTP&lt;br /&gt;
   SERVICE_0_LISTEN_PORT  = 80&lt;br /&gt;
   SERVICE_0_IP_RANGE     = 10.4.0.11-10.4.0.13&lt;br /&gt;
   SERVICE_0_BACKEND_PORT = 8080&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Health Checks ====&lt;br /&gt;
&lt;br /&gt;
When you use the load balancer, your backend servers are periodically checked if they are available by accepting periodic TCP connections, to ensure that each server is still alive.&lt;br /&gt;
&lt;br /&gt;
Every 2 seconds, each backend server will be checked and its status will be either Up or Down based on the following rules:&lt;br /&gt;
&lt;br /&gt;
* A server is Up after 2 consecutive successful health checks.&lt;br /&gt;
* A server is Down after 3 consecutive unsuccessful health checks.&lt;br /&gt;
&lt;br /&gt;
You can change the number of consecutive successful health checks using the variable &amp;lt;code&amp;gt;SERVICE_X_CHECK_RISE&amp;lt;/code&amp;gt; and the number of consecutive unsuccessful health checks using the variable &amp;lt;code&amp;gt;SERVICE_X_CHECK_FALL&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s use the example defined in the [[#Basic Configuration|Basic Configuration]] section. If you want to set the number of successful and unsuccessful checks to &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt; respectively for your backend servers, you will add the following to your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;SERVICE_0_CHECK_RISE = 3&lt;br /&gt;
SERVICE_0_CHECK_FALL = 4&amp;lt;/pre&amp;gt;&lt;br /&gt;
By default, server health check only consist in trying to establish a TCP connection. You can add a complete HTTP request after an established TCP connection by adding the following variable:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SERVICE_X_CHECK_URI&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;uri&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;amp;lt;uri&amp;amp;gt;&amp;lt;/code&amp;gt;is the URI referenced in the HTTP requests.&amp;lt;br /&amp;gt;&lt;br /&gt;
Responses 2xx and 3xx are considered valid, while all other ones indicate a server failure, including the lack of any response.&lt;br /&gt;
&lt;br /&gt;
==== HTTPS Support ====&lt;br /&gt;
&lt;br /&gt;
To enable HTTPS support, you need to specify the following variables like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;   SERVICE_X_PROTO        = HTTP&lt;br /&gt;
   SERVICE_X_LISTEN_PORT  = 443&lt;br /&gt;
   SERVICE_X_SSL_OFFLOAD_CERT  = &amp;amp;quot;crt.pem + key.pem + intermediate.pem&amp;amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The variable &amp;lt;code&amp;gt;SERVICE_X_SSL_OFFLOAD_CERT&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the certificate chains to offload encrypted connections.&amp;lt;br /&amp;gt;&lt;br /&gt;
It has to be a string which contains the certificate, the key and the chain, all in PEM format; the file order is not important.&amp;lt;br /&amp;gt;&lt;br /&gt;
For instance let&amp;#039;s assume you are using [https://letsencrypt.org/ Let&amp;#039;s Encrypt] certificates, you will concatenate the two files &amp;lt;code&amp;gt;privkey.pem&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;fullchain.pem&amp;lt;/code&amp;gt; as follows:&lt;br /&gt;
&lt;br /&gt;
* In Linux (or in MacOS via terminal): &amp;lt;code&amp;gt;cat privkey.pem fullchain.pem&amp;lt;/code&amp;gt;&lt;br /&gt;
* In Windows (via command prompt): &amp;lt;code&amp;gt;type privkex.pem fullchain.pem&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then copy the result and paste it in the &amp;lt;code&amp;gt;Value&amp;lt;/code&amp;gt; field.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;If you need to redirect your HTTP traffic to HTTPS, you will assign the variable &amp;lt;code&amp;gt;SERVICE_X_REDIRECT_TO_HTTPS&amp;lt;/code&amp;gt; as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;SERVICE_X_REDIRECT_TO_HTTPS = True&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can also define the maximum age of your HTTP Strict Transport Security (HSTS) by assigning the variable &amp;lt;code&amp;gt;SERVICE_X_SSL_HSTS_MAX_AGE&amp;lt;/code&amp;gt; as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;SERVICE_X_SSL_HSTS_MAX_AGE  = 15768000   #corresponds to 6 months&amp;lt;/pre&amp;gt;&lt;br /&gt;
The variable &amp;lt;code&amp;gt;SERVICE_X_SSL_HSTS_MAX_AGE&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the HSTS policy maximum age in seconds. In our example 15768000 seconds correspond to approximatively 6 months.&lt;br /&gt;
&lt;br /&gt;
==== All Variables ====&lt;br /&gt;
&lt;br /&gt;
This sections list all available contextualization variables. Their name is composed as follows:&lt;br /&gt;
&lt;br /&gt;
# &amp;#039;&amp;#039;SERVICE_X_&amp;#039;&amp;#039; (where X is a number &amp;amp;gt;= 0) defines the load balancing service to be configured;&lt;br /&gt;
# &amp;#039;&amp;#039;Keyword&amp;#039;&amp;#039; defines the corresponding service item to be configured.&lt;br /&gt;
&lt;br /&gt;
Some variables are valid for both protocols (tcp and http) and some are valid only with protocol http.&lt;br /&gt;
&lt;br /&gt;
===== TCP and HTTP Variables =====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;MAXCONN&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the value of the &amp;lt;code&amp;gt;maxconn&amp;lt;/code&amp;gt; parameter, which sets the maximum per-process number of concurrent connections. Proxies will stop accepting connections when this limit is reached.&amp;lt;br /&amp;gt;&lt;br /&gt;
The default value is 2000. This variable isn&amp;#039;t mandatory.&lt;br /&gt;
* &amp;lt;code&amp;gt;SERVICE_X_PROTO&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;tcp|http&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the protocol in &amp;#039;&amp;#039;service&amp;#039;&amp;#039; number &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
Default value is http. This variable isn&amp;#039;t mandatory.&lt;br /&gt;
* &amp;lt;code&amp;gt;SERVICE_X_LISTEN_PORT&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the TCP port the load balancer is listening.&amp;lt;br /&amp;gt;&lt;br /&gt;
Default value is Null. This variable is &amp;#039;&amp;#039;&amp;#039;mandatory&amp;#039;&amp;#039;&amp;#039;.&amp;lt;br /&amp;gt;&lt;br /&gt;
If this variable isn&amp;#039;t defined, the rest of the service definition will be ignored.&lt;br /&gt;
* &amp;lt;code&amp;gt;SERVICE_X_IP_RANGE&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;dotted&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;notation&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the IP addresses of backend server(s).&amp;lt;br /&amp;gt;&lt;br /&gt;
Default value is Null. This variable is &amp;#039;&amp;#039;&amp;#039;mandatory&amp;#039;&amp;#039;&amp;#039;.&amp;lt;br /&amp;gt;&lt;br /&gt;
Example: &amp;lt;code&amp;gt;SERVICE_X_IP_RANGE&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;10.4.0.2-10.4.0.20&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;SERVICE_X_BACKEND_PORT&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines TCP port on which backend server(s) are listening.&amp;lt;br /&amp;gt;&lt;br /&gt;
Default value is Null. This variable isn&amp;#039;t mandatory.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE&amp;#039;&amp;#039;&amp;#039; if the variable isn&amp;#039;t defined, it will take the &amp;lt;code&amp;gt;SERVICE_X_LISTEN_PORT&amp;lt;/code&amp;gt; value.&lt;br /&gt;
* &amp;lt;code&amp;gt;SERVICE_X_CHECK_RISE&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the number of consecutive successful health checks that declare the backend server is alive.&amp;lt;br /&amp;gt;&lt;br /&gt;
Default value is 2. This variable isn&amp;#039;t mandatory.&lt;br /&gt;
* &amp;lt;code&amp;gt;SERVICE_X_CHECK_FALL&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the number of consecutive unsuccessful health checks that declare the backend server is dead.&amp;lt;br /&amp;gt;&lt;br /&gt;
Default value is 3. This variable isn&amp;#039;t mandatory.&lt;br /&gt;
&lt;br /&gt;
===== HTTP only Variables =====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;SERVICE_X_CHECK_URI&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the URI referenced in the HTTP health-check.&amp;lt;br /&amp;gt;&lt;br /&gt;
Default value is Null. This variable isn&amp;#039;t mandatory.&lt;br /&gt;
* &amp;lt;code&amp;gt;SERVICE_X_SSL_OFFLOAD_CERT&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the certificate chains to offload encrypted connections.&amp;lt;br /&amp;gt;&lt;br /&gt;
It has to be a string which contains the following files in PEM format: &amp;lt;code&amp;gt;certificate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;key&amp;lt;/code&amp;gt;and &amp;lt;code&amp;gt;intermediate&amp;lt;/code&amp;gt;. Order is not important. Default value is Null. This variable isn&amp;#039;t mandatory.&lt;br /&gt;
* &amp;lt;code&amp;gt;SERVICE_X_REDIRECT_TO_HTTPS&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;True&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the presence of a 301 redirect from http to https.&amp;lt;br /&amp;gt;&lt;br /&gt;
Default value is Null. This variable isn&amp;#039;t mandatory.&lt;br /&gt;
* &amp;lt;code&amp;gt;SERVICE_X_SSL_HSTS_MAX_AGE&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the HSTS policy max-age in seconds.&amp;lt;br /&amp;gt;&lt;br /&gt;
Default value is Null. This variable isn&amp;#039;t mandatory.&lt;br /&gt;
&lt;br /&gt;
Default Null value means that the related configuration is not applied if the variable isn&amp;#039;t defined.&lt;br /&gt;
&lt;br /&gt;
=== Start and Check the Load Balancer ===&lt;br /&gt;
&lt;br /&gt;
# Go to &amp;amp;quot;Templates&amp;amp;quot; in the left menu and click on &amp;amp;quot;VMs&amp;amp;quot; in the drop down menu.&lt;br /&gt;
#:[[file:lb_5.png|125px|border]]&lt;br /&gt;
#:A list with all existing VM templates will appear.&lt;br /&gt;
#:[[file:lb_6.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Select the configured load balancer template and click on &amp;amp;quot;Instantiate&amp;amp;quot;.&lt;br /&gt;
#:[[file:lb_15.png|500px|border]]&lt;br /&gt;
#:A new window will appear&lt;br /&gt;
#:[[file:lb_16.png|600px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# You can assign a name to your load balancer or leave the field empty. Click on &amp;amp;quot;Instantiate&amp;amp;quot; to start the instantiation.&lt;br /&gt;
# When the new VM is in the &amp;lt;code&amp;gt;RUNNING&amp;lt;/code&amp;gt; state, click on the console icon [[file:lb_17.png|25px]] to access the VM.&lt;br /&gt;
# In the console you will see the login prompt and after a while you will see wether the HAProxy configuration was successful or not. If not, terminate the VM, modify the variables in the template and re-instantiate the VM.&lt;br /&gt;
#:[[file:lb_18.png|700px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to Modify the Load Balancer&amp;#039;s Configuration. ==&lt;br /&gt;
&lt;br /&gt;
Currently you cannot modify the load balancer&amp;#039;s configuration while it is running. Also if you were to modify the HAProxy configuration within the load balancer VM, if the VM had to be terminated and re-instantiated, you would loose your modifications.&lt;br /&gt;
&lt;br /&gt;
In order to minimize the downtime, you should:&lt;br /&gt;
# Clone the Load Balancer&amp;#039;s Template in case you have to roll back.&lt;br /&gt;
# Change the configuration in the new template by adding variables, removing variables or modifying existing variables.&lt;br /&gt;
# Terminate the old load balancer VM&lt;br /&gt;
# Instantiate the new template again.&lt;br /&gt;
&lt;br /&gt;
== Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== Dissecting HAProxy&amp;#039;s configuration ===&lt;br /&gt;
&lt;br /&gt;
HAProxy configuration consists of several sections:&lt;br /&gt;
&lt;br /&gt;
* the &amp;lt;code&amp;gt;global&amp;lt;/code&amp;gt; section, which sets process-wide parameters (static, cannot be modified),&lt;br /&gt;
* and for each defined service, a &amp;lt;code&amp;gt;proxy&amp;lt;/code&amp;gt; section, which is built using the contextualization variables.&lt;br /&gt;
&lt;br /&gt;
==== Global Section ====&lt;br /&gt;
&lt;br /&gt;
Global section is standardized for every appliance as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;global&lt;br /&gt;
    log         127.0.0.1 local2&lt;br /&gt;
    chroot      /var/lib/haproxy&lt;br /&gt;
    pidfile     /var/run/haproxy.pid&lt;br /&gt;
    # set default parameters to the intermediate configuration&lt;br /&gt;
    tune.ssl.default-dh-param 2048&lt;br /&gt;
    ssl-default-bind-ciphers ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS&lt;br /&gt;
    ssl-default-bind-options no-sslv3 no-tls-tickets&lt;br /&gt;
    ssl-default-server-ciphers ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS&lt;br /&gt;
    ssl-default-server-options no-sslv3 no-tls-tickets&lt;br /&gt;
    user        haproxy&lt;br /&gt;
    group       haproxy&lt;br /&gt;
    daemon&lt;br /&gt;
    maxconn     2000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Parameter &amp;lt;code&amp;gt;maxconn&amp;lt;/code&amp;gt; sets the maximum per-process number of concurrent connections. Proxies will stop accepting connections when this limit is reached. For further information see [https://cbonte.github.io/haproxy-dconv/1.7/configuration.html#3.2-maxconn this page]. This parameter can be modified using a contextualization variable.&lt;br /&gt;
&lt;br /&gt;
==== Proxy Section ====&lt;br /&gt;
&lt;br /&gt;
In HAProxy, the Proxy configuration for each service contains a set of sections, which can be either:&lt;br /&gt;
&lt;br /&gt;
* defaults [&amp;amp;lt;name&amp;amp;gt;]&lt;br /&gt;
* frontend &amp;amp;lt;name&amp;amp;gt;&lt;br /&gt;
* backend &amp;amp;lt;name&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or:&lt;br /&gt;
&lt;br /&gt;
* defaults [&amp;amp;lt;name&amp;amp;gt;]&lt;br /&gt;
* listen &amp;amp;lt;name&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;defaults&amp;lt;/code&amp;gt; section sets default parameters for all other sections following its declaration. Those default parameters are reset by the next &amp;lt;code&amp;gt;defaults&amp;lt;/code&amp;gt; section.&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;frontend&amp;lt;/code&amp;gt; section describes a set of listening sockets accepting client connections.&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;backend&amp;lt;/code&amp;gt; section describes a set of servers to which the proxy will connect to forward incoming connections.&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;listen&amp;lt;/code&amp;gt; section defines a complete proxy with its frontend and backend parts combined in one section. It is generally useful for TCP-only traffic.&lt;br /&gt;
&lt;br /&gt;
For the CipherSpace Load Balancer, we use only one &amp;lt;code&amp;gt;defaults&amp;lt;/code&amp;gt; section, valid for all services. We also don&amp;#039;t use the &amp;lt;code&amp;gt;listen&amp;lt;/code&amp;gt; section, as it can be replaced with one &amp;lt;code&amp;gt;frontend&amp;lt;/code&amp;gt;and one &amp;lt;code&amp;gt;backend&amp;lt;/code&amp;gt; section.&lt;br /&gt;
&lt;br /&gt;
Right now, two major proxy modes are supported: &amp;lt;code&amp;gt;tcp&amp;lt;/code&amp;gt;, also known as &amp;#039;&amp;#039;layer 4&amp;#039;&amp;#039;, and &amp;lt;code&amp;gt;http&amp;lt;/code&amp;gt;, also known as &amp;#039;&amp;#039;layer 7&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
In &amp;#039;&amp;#039;&amp;#039;layer 4 mode&amp;#039;&amp;#039;&amp;#039;, HAProxy simply forwards bidirectional traffic between two sides.&amp;lt;br /&amp;gt;&lt;br /&gt;
In &amp;#039;&amp;#039;&amp;#039;layer 7 mode&amp;#039;&amp;#039;&amp;#039;, HAProxy analyzes the protocol, and can interact with it by allowing, blocking, switching, adding, modifying, or removing arbitrary contents in requests or responses, based on arbitrary criteria.&lt;br /&gt;
&lt;br /&gt;
===== Defaults Section =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;defaults&amp;lt;/code&amp;gt; section is standardized for every appliance as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  defaults&lt;br /&gt;
     log                     global&lt;br /&gt;
     option                  redispatch&lt;br /&gt;
     retries                 3&lt;br /&gt;
     timeout http-request    10s&lt;br /&gt;
     timeout queue           1m&lt;br /&gt;
     timeout connect         10s&lt;br /&gt;
     timeout client          1m&lt;br /&gt;
     timeout server          1m&lt;br /&gt;
     timeout http-keep-alive 10s&lt;br /&gt;
     timeout check           10s&amp;lt;/pre&amp;gt;&lt;br /&gt;
===== Frontend and Backend Sections =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;frontend&amp;lt;/code&amp;gt;and &amp;lt;code&amp;gt;backend&amp;lt;/code&amp;gt;sections are configured using the contextualization variables defined in the section [[#all-variables|All Variables]].&lt;br /&gt;
&lt;br /&gt;
Variable &amp;lt;code&amp;gt;SERVICE_X_PROTO&amp;lt;/code&amp;gt; defines the mode in which the service works. Possible modes are:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;http&amp;#039;&amp;#039;&amp;#039;: the instance will work in HTTP mode. The client request will be analyzed in depth before connecting to any server. Any request which is not RFC-compliant will be rejected. Layer 7 filtering, processing and switching will be possible.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;tcp&amp;#039;&amp;#039;&amp;#039;: the instance will work in pure TCP mode. A full-duplex connection will be established between clients and servers, and no layer 7 examination will be performed. This is the default mode. It should be used for SSL, SSH, SMTP, ...&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;SERVICE_X_PROTO&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;http&amp;lt;/code&amp;gt;, the service is defined in &amp;lt;code&amp;gt;mode&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;http&amp;lt;/code&amp;gt; and the script generates the following configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  [...]&lt;br /&gt;
  frontend service_X&lt;br /&gt;
    mode http&lt;br /&gt;
    option                  httplog&lt;br /&gt;
    option http-server-close&lt;br /&gt;
    option forwardfor       except 127.0.0.0/8&lt;br /&gt;
    [...]&lt;br /&gt;
&lt;br /&gt;
  backend service_X_backend&lt;br /&gt;
    mode http&lt;br /&gt;
    balance source&lt;br /&gt;
    [...]  &amp;lt;/pre&amp;gt;&lt;br /&gt;
When &amp;lt;code&amp;gt;SERVICE_X_PROTO&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;tcp&amp;lt;/code&amp;gt;, the service is defined in &amp;lt;code&amp;gt;mode&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;tcp&amp;lt;/code&amp;gt; and the script generates the following configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;   [...]&lt;br /&gt;
   frontend service_X&lt;br /&gt;
     mode tcp&lt;br /&gt;
     option                  tcplog&lt;br /&gt;
     [...]&lt;br /&gt;
&lt;br /&gt;
   backend service_X_backend&lt;br /&gt;
     mode tcp&lt;br /&gt;
     balance source&lt;br /&gt;
     [...]  &amp;lt;/pre&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
In the following example, we define the following contextualization variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;   SERVICE_0_PROTO        = http&lt;br /&gt;
   SERVICE_0_LISTEN_PORT  = 80&lt;br /&gt;
   SERVICE_0_IP_RANGE     = 10.4.0.5 - 10.4.0.10&lt;br /&gt;
   SERVICE_0_BACKEND_PORT = 8080&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those variables generate the following complete HAProxy&amp;#039;s configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;   global&lt;br /&gt;
      log         127.0.0.1 local2&lt;br /&gt;
      chroot      /var/lib/haproxy&lt;br /&gt;
      pidfile     /var/run/haproxy.pid&lt;br /&gt;
      # set default parameters to the intermediate configuration&lt;br /&gt;
      tune.ssl.default-dh-param 2048&lt;br /&gt;
      ssl-default-bind-ciphers       ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA84:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHEECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RA-DES-CB       C3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS&lt;br /&gt;
      ssl-default-bind-options no-sslv3 no-tls-tickets&lt;br /&gt;
      ssl-default-server-ciphers       ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA84:DHE-R      SA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHEECDSA-AE      S256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RA-DES-CB       C3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS&lt;br /&gt;
      ssl-default-server-options no-sslv3 no-tls-tickets&lt;br /&gt;
      user        haproxy&lt;br /&gt;
      group       haproxy&lt;br /&gt;
      daemon&lt;br /&gt;
      maxconn     2000&lt;br /&gt;
&lt;br /&gt;
   defaults&lt;br /&gt;
      log                     global&lt;br /&gt;
      option                  redispatch&lt;br /&gt;
      retries                 3&lt;br /&gt;
      timeout http-request    10s&lt;br /&gt;
      timeout queue           1m&lt;br /&gt;
      timeout connect         10s&lt;br /&gt;
      timeout client          1m&lt;br /&gt;
      timeout server          1m&lt;br /&gt;
      timeout http-keep-alive 10s&lt;br /&gt;
      timeout check           10s&lt;br /&gt;
      maxconn                 3000&lt;br /&gt;
&lt;br /&gt;
   frontend service_0&lt;br /&gt;
      mode http&lt;br /&gt;
      option                  httplog&lt;br /&gt;
      option http-server-close&lt;br /&gt;
      option forwardfor       except 127.0.0.0/8&lt;br /&gt;
      bind :80&lt;br /&gt;
      default_backend service_0_backend&lt;br /&gt;
&lt;br /&gt;
   backend service_0_backend&lt;br /&gt;
      mode http&lt;br /&gt;
      balance source&lt;br /&gt;
      server server0 10.4.0.5:8080 check&lt;br /&gt;
      server server1 10.4.0.6:8080 check&lt;br /&gt;
      server server2 10.4.0.7:8080 check&lt;br /&gt;
      server server3 10.4.0.8:8080 check&lt;br /&gt;
      server server4 10.4.0.9:8080 check&lt;br /&gt;
      server server5 10.4.0.10:8080 check&amp;lt;/pre&amp;gt;&lt;br /&gt;
===== Health Checks =====&lt;br /&gt;
&lt;br /&gt;
When a &amp;#039;&amp;#039;server&amp;#039;&amp;#039; is defined in the &amp;#039;&amp;#039;backend&amp;#039;&amp;#039; section, it is possible to define a health check using the setting &amp;lt;code&amp;gt;check&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
By default, a &amp;#039;&amp;#039;server&amp;#039;&amp;#039; is always considered available. If &amp;lt;code&amp;gt;check&amp;lt;/code&amp;gt; is set, the server is available when it is accepting periodic TCP connections, to ensure that it is really able to serve requests.&amp;lt;br /&amp;gt;&lt;br /&gt;
The default address and port for these tests are those of the server, and the default source is the same as the one defined in the backend.&amp;lt;br /&amp;gt;&lt;br /&gt;
It is possible to change the port using the &amp;lt;code&amp;gt;port&amp;lt;/code&amp;gt; parameter (currently not implemented), and the interval (currently not implemented) and timers using the &amp;lt;code&amp;gt;inter&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;rise&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;fall&amp;lt;/code&amp;gt; parameters.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;inter&amp;lt;/code&amp;gt; default value of 2000 ms between two consecutive health checks is good enough.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  rise &amp;amp;lt;count&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;rise&amp;lt;/code&amp;gt; parameter states that a server will be considered as operational after &amp;lt;count&amp;gt; consecutive successful health checks. This value defaults to 2 if unspecified.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  fall &amp;amp;lt;count&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;fall&amp;lt;/code&amp;gt; parameter states that a server will be considered as dead after &amp;lt;count&amp;gt; consecutive unsuccessful health checks. This value defaults to 3 if unspecified.&lt;br /&gt;
&lt;br /&gt;
The request method is defined in the backend using the &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;httpchk&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;httpchk&amp;lt;/code&amp;gt; enables HTTP protocol to check on the servers health.&lt;br /&gt;
&lt;br /&gt;
Possible configuration are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;option httpchk &amp;amp;lt;uri&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Arguments are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;uri&amp;amp;gt;&amp;lt;/code&amp;gt;: is the URI referenced in the HTTP requests. It defaults to &amp;amp;quot;/&amp;amp;quot; which is accessible by default on almost any server, but may be changed to any other URI. Query strings are permitted.&lt;br /&gt;
&lt;br /&gt;
By default, server health checks only consist in trying to establish a TCP connection. When &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;httpchk&amp;lt;/code&amp;gt; is specified, a complete HTTP request is sent once the TCP connection is established, and responses 2xx and 3xx are considered valid, while all other ones indicate a server failure, including the lack of any response.&lt;br /&gt;
&lt;br /&gt;
The port and interval are specified in the &amp;#039;&amp;#039;server&amp;#039;&amp;#039; configuration.&lt;br /&gt;
&lt;br /&gt;
This option does not necessarily require an &amp;#039;&amp;#039;HTTP backend&amp;#039;&amp;#039;, it also works with plain &amp;#039;&amp;#039;TCP backend&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
In the following example, we define the following contextualization variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[...]&lt;br /&gt;
SERVICE_0_CHECK_URI  = &amp;amp;quot;/&amp;amp;quot;&lt;br /&gt;
SERVICE_0_CHECK_RISE = 3&lt;br /&gt;
SERVICE_0_CHECK_FALL = 4&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those variables generate the following HAProxy&amp;#039;s configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[...]&lt;br /&gt;
backend service_0_backend&lt;br /&gt;
   mode http&lt;br /&gt;
   option httpchk /&lt;br /&gt;
   balance source&lt;br /&gt;
   server server0 10.4.0.5:8080 check rise 3 fall 4&lt;br /&gt;
   server server1 10.4.0.6:8080 check rise 3 fall 4&lt;br /&gt;
   server server2 10.4.0.7:8080 check rise 3 fall 4&lt;br /&gt;
   server server3 10.4.0.8:8080 check rise 3 fall 4&lt;br /&gt;
   server server4 10.4.0.9:8080 check rise 3 fall 4&lt;br /&gt;
   server server5 10.4.0.10:8080 check rise 3 fall 4&amp;lt;/pre&amp;gt;&lt;br /&gt;
===== HTTPS Support =====&lt;br /&gt;
&lt;br /&gt;
To enable https support, we need to specify in the &amp;lt;code&amp;gt;frontend&amp;lt;/code&amp;gt; section the option &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; and the option &amp;lt;code&amp;gt;crt&amp;lt;/code&amp;gt; followed by path to the file which contains certificate, privkey, intermediate certificate and dhparam.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
In the following example, we define the following contextualization variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[...]&lt;br /&gt;
SERVICE_X_SSL_OFFLOAD_CERT  = &amp;amp;quot;crt.pem + key.pem + intermediate.pem&amp;amp;quot;;&lt;br /&gt;
SERVICE_X_REDIRECT_TO_HTTPS = True&lt;br /&gt;
SERVICE_X_SSL_HSTS_MAX_AGE  = 15768000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those variables generate the following HAProxy&amp;#039;s configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;frontend service_0&lt;br /&gt;
  mode    http&lt;br /&gt;
  bind    :443 ssl crt /path/to/&amp;amp;lt;cert+privkey+intermediate+dhparam&amp;amp;gt;&lt;br /&gt;
  bind    :80&lt;br /&gt;
  redirect scheme https code 301 if !{ ssl_fc }&lt;br /&gt;
&lt;br /&gt;
  # HSTS (15768000 seconds = 6 months)&lt;br /&gt;
  http-response set-header Strict-Transport-Security max-age=15768000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;Category:OpenNebula&amp;gt;&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=CipherSpace_Load_Balancer&amp;diff=753</id>
		<title>CipherSpace Load Balancer</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=CipherSpace_Load_Balancer&amp;diff=753"/>
		<updated>2017-08-02T14:52:03Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: /* Health Checks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OpenNebula]]&lt;br /&gt;
[[Category:How To]]&lt;br /&gt;
[[Category:CloudInfrastructure]]&lt;br /&gt;
== CipherSpace Load Balancer ==&lt;br /&gt;
&lt;br /&gt;
The CipherSpace Load Balancer uses [http://www.haproxy.org/ HAProxy] and its configuration is defined using OpenNebula Contextualization Variables within the appliance&amp;#039;s template.&lt;br /&gt;
&lt;br /&gt;
The CipherSpace Load Balancer uses the concept of &amp;amp;quot;sticky sessions&amp;amp;quot;, which is a mechanism to route requests from the same source to the same target (if the target is still available).&lt;br /&gt;
&lt;br /&gt;
== How to use the CipherSpace Load Balancer ==&lt;br /&gt;
&lt;br /&gt;
=== Download the Load Balancer from the App Market ===&lt;br /&gt;
&lt;br /&gt;
# Go to &amp;amp;quot;Storage&amp;amp;quot; in the left menu and click on &amp;amp;quot;Apps&amp;amp;quot; in the drop down menu.&lt;br /&gt;
#:[[file:lb_1.png|150px|border]]&lt;br /&gt;
#:A list with all existing apps will appear.&lt;br /&gt;
#:[[file:lb_2.png|700px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Select the CipherSpace Load Balancer and click on the &amp;amp;quot;-&amp;amp;gt; OpenNebula&amp;amp;quot; button.&lt;br /&gt;
#:[[file:lb_3.png|700px|border]]&lt;br /&gt;
#:A new window will appear.&lt;br /&gt;
#:[[file:lb_4.png|700px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# You can rename the image (&amp;amp;quot;Name&amp;amp;quot;) as well as the VM template name. Then select the datastore which is used for your VMs and click on &amp;amp;quot;Download&amp;amp;quot;. A new image as well as a new template will be created.&lt;br /&gt;
&lt;br /&gt;
=== Configure the Load Balancer ===&lt;br /&gt;
&lt;br /&gt;
# Go to &amp;amp;quot;Templates&amp;amp;quot; in the left menu and click on &amp;amp;quot;VMs&amp;amp;quot; in the drop down menu.&lt;br /&gt;
#:[[file:lb_5.png|125px|border]]&lt;br /&gt;
#:A list with all existing VM templates will appear.&lt;br /&gt;
#:[[file:lb_6.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Select the template for the load balancer and click on &amp;amp;quot;Update&amp;amp;quot;.&lt;br /&gt;
#:[[file:lb_7.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Click on the &amp;amp;quot;Network&amp;amp;quot; tab&lt;br /&gt;
#:[[file:lb_8.png|500px|border]]&lt;br /&gt;
#:and select a Virtual Network for your NIC (the same network as the VMs which provide the service you would like to load balance).&lt;br /&gt;
#:[[file:lb_9.png|600px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
#:If clients connect to your load balancer from a different network (Internet for example) you need to add another NIC and attach it to the appropriate Virtual Network.&lt;br /&gt;
#:[[file:lb_10.png|600px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Click on the &amp;amp;quot;Context&amp;amp;quot; tab&lt;br /&gt;
#:[[file:lb_11.png|500px|border]]&lt;br /&gt;
#:and then click on the &amp;amp;quot;Custom vars&amp;amp;quot; section.&lt;br /&gt;
#:[[file:lb_12.png|600px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# In the &amp;amp;quot;Custom vars&amp;amp;quot; section, click on the &amp;amp;quot;+&amp;amp;quot; button to enter all the necessary contextualization variables and their respective values (see the section [[#Load Balancer Contextualization Variables | Load Balancer Contextualization Variables]]).&lt;br /&gt;
#:[[file:lb_13.png|700px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# If you have 2 NICs, you should set default gateway by adding the variable &amp;lt;code&amp;gt;GATEWAY_IFACE&amp;lt;/code&amp;gt;and assign it with the number of the NIC on which requests from clients are coming.  (typically &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;).&lt;br /&gt;
#:&amp;lt;code&amp;gt;GATEWAY_IFACE = 1&amp;lt;/code&amp;gt;&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# When you&amp;#039;re done, click on &amp;amp;quot;Update&amp;amp;quot; to save your changes.&lt;br /&gt;
#:[[file:lb_14.png|700px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Load Balancer Contextualization Variables ===&lt;br /&gt;
&lt;br /&gt;
==== Basic Configuration ====&lt;br /&gt;
&lt;br /&gt;
In order to understand the contextualization variables, let&amp;#039;s use the following example.&lt;br /&gt;
&lt;br /&gt;
You have three web servers and a load balancer attached to the same virtual network. The web servers have the IP addresses &amp;lt;code&amp;gt;10.4.0.11&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;10.4.0.12&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;10.4.0.13&amp;lt;/code&amp;gt; respectively. They listen to &amp;lt;code&amp;gt;http&amp;lt;/code&amp;gt; traffic on port &amp;lt;code&amp;gt;8080&amp;lt;/code&amp;gt;. The load balancer listens to &amp;lt;code&amp;gt;http&amp;lt;/code&amp;gt; traffic on the port &amp;lt;code&amp;gt;80&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In this example you only have one service (http) which needs to be balanced.&amp;lt;br /&amp;gt;&lt;br /&gt;
Every contextualization variable for this service will have a name like &amp;lt;code&amp;gt;SERVICE_0_...&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
If you define more services, each new service variables will start with&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;SERVICE_1_&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;SERVICE_2_&amp;lt;/code&amp;gt;, etc..&lt;br /&gt;
&lt;br /&gt;
For this particular example you will define the following variables:&lt;br /&gt;
&lt;br /&gt;
* SERVICE_0_PROTO&lt;br /&gt;
* SERVICE_0_LISTEN_PORT&lt;br /&gt;
* SERVICE_0_IP_RANGE&lt;br /&gt;
* SERVICE_0_BACKEND_PORT&lt;br /&gt;
&lt;br /&gt;
The variable &amp;lt;code&amp;gt;SERVICE_X_PROTO&amp;lt;/code&amp;gt; defines the mode in which the service works. Possible modes are:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;http&amp;#039;&amp;#039;&amp;#039;: the instance will work in HTTP mode. The client request will be analyzed in depth before connecting to any server. Any request which is not RFC-compliant will be rejected. Layer 7 filtering, processing and switching will be possible.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;tcp&amp;#039;&amp;#039;&amp;#039;: the instance will work in pure TCP mode. A full-duplex connection will be established between clients and servers, and no layer 7 examination will be performed. It should be used for SSL, SSH, SMTP, ...&lt;br /&gt;
&lt;br /&gt;
In our example &amp;lt;code&amp;gt;SERVICE_0_PROTO&amp;lt;/code&amp;gt; has the value &amp;lt;code&amp;gt;HTTP&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variable &amp;lt;code&amp;gt;SERVICE_X_LISTEN_PORT&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the TCP port the load balancer is listening to.&amp;lt;br /&amp;gt;&lt;br /&gt;
This variable is &amp;#039;&amp;#039;&amp;#039;mandatory&amp;#039;&amp;#039;&amp;#039;. If this variable isn&amp;#039;t defined, the rest of the service definition will be ignored.&amp;lt;br /&amp;gt;&lt;br /&gt;
In our example &amp;lt;code&amp;gt;SERVICE_0_LISTEN_PORT&amp;lt;/code&amp;gt; has the value &amp;lt;code&amp;gt;80&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variable &amp;lt;code&amp;gt;SERVICE_X_IP_RANGE&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;dotted&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;notation&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the IP addresses of the backend servers. This variable is &amp;#039;&amp;#039;&amp;#039;mandatory&amp;#039;&amp;#039;&amp;#039;.&amp;lt;br /&amp;gt;&lt;br /&gt;
In our example &amp;lt;code&amp;gt;SERVICE_X_IP_RANGE&amp;lt;/code&amp;gt; has the value &amp;lt;code&amp;gt;10.4.0.11-10.4.0.13&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variable &amp;lt;code&amp;gt;SERVICE_X_BACKEND_PORT&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the TCP port the backend servers are listening to. This variable is optional. If this variable isn&amp;#039;t defined, the value of the variable &amp;lt;code&amp;gt;SERVICE_X_LISTEN_PORT&amp;lt;/code&amp;gt; will be used instead.&amp;lt;br /&amp;gt;&lt;br /&gt;
In our example &amp;lt;code&amp;gt;SERVICE_X_BACKEND_PORT&amp;lt;/code&amp;gt; has the value &amp;lt;code&amp;gt;8080&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, our example will be configured as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;   SERVICE_0_PROTO        = HTTP&lt;br /&gt;
   SERVICE_0_LISTEN_PORT  = 80&lt;br /&gt;
   SERVICE_0_IP_RANGE     = 10.4.0.11-10.4.0.13&lt;br /&gt;
   SERVICE_0_BACKEND_PORT = 8080&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Health Checks ====&lt;br /&gt;
&lt;br /&gt;
When you use the load balancer, your backend servers are periodically checked if they are available by accepting periodic TCP connections, to ensure that each server is still alive.&lt;br /&gt;
&lt;br /&gt;
Every 2 seconds, each backend server will be checked and its status will be either Up or Down based on the following rules:&lt;br /&gt;
&lt;br /&gt;
* A server is Up after 2 consecutive successful health checks.&lt;br /&gt;
* A server is Down after 3 consecutive unsuccessful health checks.&lt;br /&gt;
&lt;br /&gt;
You can change the number of consecutive successful health checks using the variable &amp;lt;code&amp;gt;SERVICE_X_CHECK_RISE&amp;lt;/code&amp;gt; and the number of consecutive unsuccessful health checks using the variable &amp;lt;code&amp;gt;SERVICE_X_CHECK_FALL&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s use the example defined in the [[#Basic Configuration|Basic Configuration]] section. If you want to set the number of successful and unsuccessful checks to &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt; respectively for your backend servers, you will add the following to your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;SERVICE_0_CHECK_RISE = 3&lt;br /&gt;
SERVICE_0_CHECK_FALL = 4&amp;lt;/pre&amp;gt;&lt;br /&gt;
By default, server health check only consist in trying to establish a TCP connection. You can add a complete HTTP request after an established TCP connection by adding the following variable:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SERVICE_X_CHECK_URI&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;uri&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;amp;lt;uri&amp;amp;gt;&amp;lt;/code&amp;gt;is the URI referenced in the HTTP requests.&amp;lt;br /&amp;gt;&lt;br /&gt;
Responses 2xx and 3xx are considered valid, while all other ones indicate a server failure, including the lack of any response.&lt;br /&gt;
&lt;br /&gt;
==== HTTPS Support ====&lt;br /&gt;
&lt;br /&gt;
To enable HTTPS support, you need to specify the following variables like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;   SERVICE_X_PROTO        = HTTP&lt;br /&gt;
   SERVICE_X_LISTEN_PORT  = 443&lt;br /&gt;
   SERVICE_X_SSL_OFFLOAD_CERT  = &amp;amp;quot;crt.pem + key.pem + intermediate.pem&amp;amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The variable &amp;lt;code&amp;gt;SERVICE_X_SSL_OFFLOAD_CERT&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the certificate chains to offload encrypted connections.&amp;lt;br /&amp;gt;&lt;br /&gt;
It has to be a string which contains the certificate, the key and the chain, all in PEM format; the file order is not important.&amp;lt;br /&amp;gt;&lt;br /&gt;
For instance let&amp;#039;s assume you are using [https://letsencrypt.org/ Let&amp;#039;s Encrypt] certificates, you will concatenate the two files &amp;lt;code&amp;gt;privkey.pem&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;fullchain.pem&amp;lt;/code&amp;gt; as follows:&lt;br /&gt;
&lt;br /&gt;
* In Linux (or in MacOS via terminal): &amp;lt;code&amp;gt;cat privkey.pem fullchain.pem&amp;lt;/code&amp;gt;&lt;br /&gt;
* In Windows (via command prompt): &amp;lt;code&amp;gt;type privkex.pem fullchain.pem&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then copy the result and paste it in the &amp;lt;code&amp;gt;Value&amp;lt;/code&amp;gt; field.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;If you need to redirect your HTTP traffic to HTTPS, you will assign the variable &amp;lt;code&amp;gt;SERVICE_X_REDIRECT_TO_HTTPS&amp;lt;/code&amp;gt; as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;SERVICE_X_REDIRECT_TO_HTTPS = True&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can also define the maximum age of your HTTP Strict Transport Security (HSTS) by assigning the variable &amp;lt;code&amp;gt;SERVICE_X_SSL_HSTS_MAX_AGE&amp;lt;/code&amp;gt; as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;SERVICE_X_SSL_HSTS_MAX_AGE  = 15768000   #corresponds to 6 months&amp;lt;/pre&amp;gt;&lt;br /&gt;
The variable &amp;lt;code&amp;gt;SERVICE_X_SSL_HSTS_MAX_AGE&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the HSTS policy maximum age in seconds. In our example 15768000 seconds correspond to approximatively 6 months.&lt;br /&gt;
&lt;br /&gt;
==== All Variables ====&lt;br /&gt;
&lt;br /&gt;
This sections list all available contextualization variables. Their name is composed as follows:&lt;br /&gt;
&lt;br /&gt;
# &amp;#039;&amp;#039;SERVICE_X_&amp;#039;&amp;#039; (where X is a number &amp;amp;gt;= 0) defines the load balancing service to be configured;&lt;br /&gt;
# &amp;#039;&amp;#039;Keyword&amp;#039;&amp;#039; defines the corresponding service item to be configured.&lt;br /&gt;
&lt;br /&gt;
Some variables are valid for both protocols (tcp and http) and some are valid only with protocol http.&lt;br /&gt;
&lt;br /&gt;
===== TCP and HTTP Variables =====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;MAXCONN&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the value of the &amp;lt;code&amp;gt;maxconn&amp;lt;/code&amp;gt; parameter, which sets the maximum per-process number of concurrent connections. Proxies will stop accepting connections when this limit is reached.&amp;lt;br /&amp;gt;&lt;br /&gt;
The default value is 2000. This variable isn&amp;#039;t mandatory.&lt;br /&gt;
* &amp;lt;code&amp;gt;SERVICE_X_PROTO&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;tcp|http&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the protocol in &amp;#039;&amp;#039;service&amp;#039;&amp;#039; number &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
Default value is http. This variable isn&amp;#039;t mandatory.&lt;br /&gt;
* &amp;lt;code&amp;gt;SERVICE_X_LISTEN_PORT&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the TCP port the load balancer is listening.&amp;lt;br /&amp;gt;&lt;br /&gt;
Default value is Null. This variable is &amp;#039;&amp;#039;&amp;#039;mandatory&amp;#039;&amp;#039;&amp;#039;.&amp;lt;br /&amp;gt;&lt;br /&gt;
If this variable isn&amp;#039;t defined, the rest of the service definition will be ignored.&lt;br /&gt;
* &amp;lt;code&amp;gt;SERVICE_X_IP_RANGE&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;dotted&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;notation&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the IP addresses of backend server(s).&amp;lt;br /&amp;gt;&lt;br /&gt;
Default value is Null. This variable is &amp;#039;&amp;#039;&amp;#039;mandatory&amp;#039;&amp;#039;&amp;#039;.&amp;lt;br /&amp;gt;&lt;br /&gt;
Example: &amp;lt;code&amp;gt;SERVICE_X_IP_RANGE&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;10.4.0.2-10.4.0.20&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;SERVICE_X_BACKEND_PORT&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines TCP port on which backend server(s) are listening.&amp;lt;br /&amp;gt;&lt;br /&gt;
Default value is Null. This variable isn&amp;#039;t mandatory.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE&amp;#039;&amp;#039;&amp;#039; if the variable isn&amp;#039;t defined, it will take the &amp;lt;code&amp;gt;SERVICE_X_LISTEN_PORT&amp;lt;/code&amp;gt; value.&lt;br /&gt;
* &amp;lt;code&amp;gt;SERVICE_X_CHECK_RISE&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the number of consecutive successful health checks that declare the backend server is alive.&amp;lt;br /&amp;gt;&lt;br /&gt;
Default value is 2. This variable isn&amp;#039;t mandatory.&lt;br /&gt;
* &amp;lt;code&amp;gt;SERVICE_X_CHECK_FALL&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the number of consecutive unsuccessful health checks that declare the backend server is dead.&amp;lt;br /&amp;gt;&lt;br /&gt;
Default value is 3. This variable isn&amp;#039;t mandatory.&lt;br /&gt;
&lt;br /&gt;
===== HTTP only Variables =====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;SERVICE_X_CHECK_URI&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the URI referenced in the HTTP health-check.&amp;lt;br /&amp;gt;&lt;br /&gt;
Default value is Null. This variable isn&amp;#039;t mandatory.&lt;br /&gt;
* &amp;lt;code&amp;gt;SERVICE_X_SSL_OFFLOAD_CERT&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the certificate chains to offload encrypted connections.&amp;lt;br /&amp;gt;&lt;br /&gt;
It has to be a string which contains the following files in PEM format: &amp;lt;code&amp;gt;chain&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;key&amp;lt;/code&amp;gt;and &amp;lt;code&amp;gt;intermediate&amp;lt;/code&amp;gt;. Order is not important. Default value is Null. This variable isn&amp;#039;t mandatory.&lt;br /&gt;
* &amp;lt;code&amp;gt;SERVICE_X_REDIRECT_TO_HTTPS&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;True&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the presence of a 301 redirect from http to https.&amp;lt;br /&amp;gt;&lt;br /&gt;
Default value is Null. This variable isn&amp;#039;t mandatory.&lt;br /&gt;
* &amp;lt;code&amp;gt;SERVICE_X_SSL_HSTS_MAX_AGE&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the HSTS policy max-age in seconds.&amp;lt;br /&amp;gt;&lt;br /&gt;
Default value is Null. This variable isn&amp;#039;t mandatory.&lt;br /&gt;
&lt;br /&gt;
Default Null value means that the related configuration is not applied if the variable isn&amp;#039;t defined.&lt;br /&gt;
&lt;br /&gt;
=== Start and Check the Load Balancer ===&lt;br /&gt;
&lt;br /&gt;
# Go to &amp;amp;quot;Templates&amp;amp;quot; in the left menu and click on &amp;amp;quot;VMs&amp;amp;quot; in the drop down menu.&lt;br /&gt;
#:[[file:lb_5.png|125px|border]]&lt;br /&gt;
#:A list with all existing VM templates will appear.&lt;br /&gt;
#:[[file:lb_6.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Select the configured load balancer template and click on &amp;amp;quot;Instantiate&amp;amp;quot;.&lt;br /&gt;
#:[[file:lb_15.png|500px|border]]&lt;br /&gt;
#:A new window will appear&lt;br /&gt;
#:[[file:lb_16.png|600px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# You can assign a name to your load balancer or leave the field empty. Click on &amp;amp;quot;Instantiate&amp;amp;quot; to start the instantiation.&lt;br /&gt;
# When the new VM is in the &amp;lt;code&amp;gt;RUNNING&amp;lt;/code&amp;gt; state, click on the console icon [[file:lb_17.png|25px]] to access the VM.&lt;br /&gt;
# In the console you will see the login prompt and after a while you will see wether the HAProxy configuration was successful or not. If not, terminate the VM, modify the variables in the template and re-instantiate the VM.&lt;br /&gt;
#:[[file:lb_18.png|700px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to Modify the Load Balancer&amp;#039;s Configuration. ==&lt;br /&gt;
&lt;br /&gt;
Currently you cannot modify the load balancer&amp;#039;s configuration while it is running. Also if you were to modify the HAProxy configuration within the load balancer VM, if the VM had to be terminated and re-instantiated, you would loose your modifications.&lt;br /&gt;
&lt;br /&gt;
In order to minimize the downtime, you should:&lt;br /&gt;
# Clone the Load Balancer&amp;#039;s Template in case you have to roll back.&lt;br /&gt;
# Change the configuration in the new template by adding variables, removing variables or modifying existing variables.&lt;br /&gt;
# Terminate the old load balancer VM&lt;br /&gt;
# Instantiate the new template again.&lt;br /&gt;
&lt;br /&gt;
== Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== Dissecting HAProxy&amp;#039;s configuration ===&lt;br /&gt;
&lt;br /&gt;
HAProxy configuration consists of several sections:&lt;br /&gt;
&lt;br /&gt;
* the &amp;lt;code&amp;gt;global&amp;lt;/code&amp;gt; section, which sets process-wide parameters (static, cannot be modified),&lt;br /&gt;
* and for each defined service, a &amp;lt;code&amp;gt;proxy&amp;lt;/code&amp;gt; section, which is built using the contextualization variables.&lt;br /&gt;
&lt;br /&gt;
==== Global Section ====&lt;br /&gt;
&lt;br /&gt;
Global section is standardized for every appliance as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;global&lt;br /&gt;
    log         127.0.0.1 local2&lt;br /&gt;
    chroot      /var/lib/haproxy&lt;br /&gt;
    pidfile     /var/run/haproxy.pid&lt;br /&gt;
    # set default parameters to the intermediate configuration&lt;br /&gt;
    tune.ssl.default-dh-param 2048&lt;br /&gt;
    ssl-default-bind-ciphers ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS&lt;br /&gt;
    ssl-default-bind-options no-sslv3 no-tls-tickets&lt;br /&gt;
    ssl-default-server-ciphers ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS&lt;br /&gt;
    ssl-default-server-options no-sslv3 no-tls-tickets&lt;br /&gt;
    user        haproxy&lt;br /&gt;
    group       haproxy&lt;br /&gt;
    daemon&lt;br /&gt;
    maxconn     2000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Parameter &amp;lt;code&amp;gt;maxconn&amp;lt;/code&amp;gt; sets the maximum per-process number of concurrent connections. Proxies will stop accepting connections when this limit is reached. For further information see [https://cbonte.github.io/haproxy-dconv/1.7/configuration.html#3.2-maxconn this page]. This parameter can be modified using a contextualization variable.&lt;br /&gt;
&lt;br /&gt;
==== Proxy Section ====&lt;br /&gt;
&lt;br /&gt;
In HAProxy, the Proxy configuration for each service contains a set of sections, which can be either:&lt;br /&gt;
&lt;br /&gt;
* defaults [&amp;amp;lt;name&amp;amp;gt;]&lt;br /&gt;
* frontend &amp;amp;lt;name&amp;amp;gt;&lt;br /&gt;
* backend &amp;amp;lt;name&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or:&lt;br /&gt;
&lt;br /&gt;
* defaults [&amp;amp;lt;name&amp;amp;gt;]&lt;br /&gt;
* listen &amp;amp;lt;name&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;defaults&amp;lt;/code&amp;gt; section sets default parameters for all other sections following its declaration. Those default parameters are reset by the next &amp;lt;code&amp;gt;defaults&amp;lt;/code&amp;gt; section.&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;frontend&amp;lt;/code&amp;gt; section describes a set of listening sockets accepting client connections.&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;backend&amp;lt;/code&amp;gt; section describes a set of servers to which the proxy will connect to forward incoming connections.&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;listen&amp;lt;/code&amp;gt; section defines a complete proxy with its frontend and backend parts combined in one section. It is generally useful for TCP-only traffic.&lt;br /&gt;
&lt;br /&gt;
For the CipherSpace Load Balancer, we use only one &amp;lt;code&amp;gt;defaults&amp;lt;/code&amp;gt; section, valid for all services. We also don&amp;#039;t use the &amp;lt;code&amp;gt;listen&amp;lt;/code&amp;gt; section, as it can be replaced with one &amp;lt;code&amp;gt;frontend&amp;lt;/code&amp;gt;and one &amp;lt;code&amp;gt;backend&amp;lt;/code&amp;gt; section.&lt;br /&gt;
&lt;br /&gt;
Right now, two major proxy modes are supported: &amp;lt;code&amp;gt;tcp&amp;lt;/code&amp;gt;, also known as &amp;#039;&amp;#039;layer 4&amp;#039;&amp;#039;, and &amp;lt;code&amp;gt;http&amp;lt;/code&amp;gt;, also known as &amp;#039;&amp;#039;layer 7&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
In &amp;#039;&amp;#039;&amp;#039;layer 4 mode&amp;#039;&amp;#039;&amp;#039;, HAProxy simply forwards bidirectional traffic between two sides.&amp;lt;br /&amp;gt;&lt;br /&gt;
In &amp;#039;&amp;#039;&amp;#039;layer 7 mode&amp;#039;&amp;#039;&amp;#039;, HAProxy analyzes the protocol, and can interact with it by allowing, blocking, switching, adding, modifying, or removing arbitrary contents in requests or responses, based on arbitrary criteria.&lt;br /&gt;
&lt;br /&gt;
===== Defaults Section =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;defaults&amp;lt;/code&amp;gt; section is standardized for every appliance as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  defaults&lt;br /&gt;
     log                     global&lt;br /&gt;
     option                  redispatch&lt;br /&gt;
     retries                 3&lt;br /&gt;
     timeout http-request    10s&lt;br /&gt;
     timeout queue           1m&lt;br /&gt;
     timeout connect         10s&lt;br /&gt;
     timeout client          1m&lt;br /&gt;
     timeout server          1m&lt;br /&gt;
     timeout http-keep-alive 10s&lt;br /&gt;
     timeout check           10s&amp;lt;/pre&amp;gt;&lt;br /&gt;
===== Frontend and Backend Sections =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;frontend&amp;lt;/code&amp;gt;and &amp;lt;code&amp;gt;backend&amp;lt;/code&amp;gt;sections are configured using the contextualization variables defined in the section [[#all-variables|All Variables]].&lt;br /&gt;
&lt;br /&gt;
Variable &amp;lt;code&amp;gt;SERVICE_X_PROTO&amp;lt;/code&amp;gt; defines the mode in which the service works. Possible modes are:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;http&amp;#039;&amp;#039;&amp;#039;: the instance will work in HTTP mode. The client request will be analyzed in depth before connecting to any server. Any request which is not RFC-compliant will be rejected. Layer 7 filtering, processing and switching will be possible.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;tcp&amp;#039;&amp;#039;&amp;#039;: the instance will work in pure TCP mode. A full-duplex connection will be established between clients and servers, and no layer 7 examination will be performed. This is the default mode. It should be used for SSL, SSH, SMTP, ...&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;SERVICE_X_PROTO&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;http&amp;lt;/code&amp;gt;, the service is defined in &amp;lt;code&amp;gt;mode&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;http&amp;lt;/code&amp;gt; and the script generates the following configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  [...]&lt;br /&gt;
  frontend service_X&lt;br /&gt;
    mode http&lt;br /&gt;
    option                  httplog&lt;br /&gt;
    option http-server-close&lt;br /&gt;
    option forwardfor       except 127.0.0.0/8&lt;br /&gt;
    [...]&lt;br /&gt;
&lt;br /&gt;
  backend service_X_backend&lt;br /&gt;
    mode http&lt;br /&gt;
    balance source&lt;br /&gt;
    [...]  &amp;lt;/pre&amp;gt;&lt;br /&gt;
When &amp;lt;code&amp;gt;SERVICE_X_PROTO&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;tcp&amp;lt;/code&amp;gt;, the service is defined in &amp;lt;code&amp;gt;mode&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;tcp&amp;lt;/code&amp;gt; and the script generates the following configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;   [...]&lt;br /&gt;
   frontend service_X&lt;br /&gt;
     mode tcp&lt;br /&gt;
     option                  tcplog&lt;br /&gt;
     [...]&lt;br /&gt;
&lt;br /&gt;
   backend service_X_backend&lt;br /&gt;
     mode tcp&lt;br /&gt;
     balance source&lt;br /&gt;
     [...]  &amp;lt;/pre&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
In the following example, we define the following contextualization variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;   SERVICE_0_PROTO        = http&lt;br /&gt;
   SERVICE_0_LISTEN_PORT  = 80&lt;br /&gt;
   SERVICE_0_IP_RANGE     = 10.4.0.5 - 10.4.0.10&lt;br /&gt;
   SERVICE_0_BACKEND_PORT = 8080&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those variables generate the following complete HAProxy&amp;#039;s configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;   global&lt;br /&gt;
      log         127.0.0.1 local2&lt;br /&gt;
      chroot      /var/lib/haproxy&lt;br /&gt;
      pidfile     /var/run/haproxy.pid&lt;br /&gt;
      # set default parameters to the intermediate configuration&lt;br /&gt;
      tune.ssl.default-dh-param 2048&lt;br /&gt;
      ssl-default-bind-ciphers       ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA84:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHEECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RA-DES-CB       C3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS&lt;br /&gt;
      ssl-default-bind-options no-sslv3 no-tls-tickets&lt;br /&gt;
      ssl-default-server-ciphers       ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA84:DHE-R      SA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHEECDSA-AE      S256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RA-DES-CB       C3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS&lt;br /&gt;
      ssl-default-server-options no-sslv3 no-tls-tickets&lt;br /&gt;
      user        haproxy&lt;br /&gt;
      group       haproxy&lt;br /&gt;
      daemon&lt;br /&gt;
      maxconn     2000&lt;br /&gt;
&lt;br /&gt;
   defaults&lt;br /&gt;
      log                     global&lt;br /&gt;
      option                  redispatch&lt;br /&gt;
      retries                 3&lt;br /&gt;
      timeout http-request    10s&lt;br /&gt;
      timeout queue           1m&lt;br /&gt;
      timeout connect         10s&lt;br /&gt;
      timeout client          1m&lt;br /&gt;
      timeout server          1m&lt;br /&gt;
      timeout http-keep-alive 10s&lt;br /&gt;
      timeout check           10s&lt;br /&gt;
      maxconn                 3000&lt;br /&gt;
&lt;br /&gt;
   frontend service_0&lt;br /&gt;
      mode http&lt;br /&gt;
      option                  httplog&lt;br /&gt;
      option http-server-close&lt;br /&gt;
      option forwardfor       except 127.0.0.0/8&lt;br /&gt;
      bind :80&lt;br /&gt;
      default_backend service_0_backend&lt;br /&gt;
&lt;br /&gt;
   backend service_0_backend&lt;br /&gt;
      mode http&lt;br /&gt;
      balance source&lt;br /&gt;
      server server0 10.4.0.5:8080 check&lt;br /&gt;
      server server1 10.4.0.6:8080 check&lt;br /&gt;
      server server2 10.4.0.7:8080 check&lt;br /&gt;
      server server3 10.4.0.8:8080 check&lt;br /&gt;
      server server4 10.4.0.9:8080 check&lt;br /&gt;
      server server5 10.4.0.10:8080 check&amp;lt;/pre&amp;gt;&lt;br /&gt;
===== Health Checks =====&lt;br /&gt;
&lt;br /&gt;
When a &amp;#039;&amp;#039;server&amp;#039;&amp;#039; is defined in the &amp;#039;&amp;#039;backend&amp;#039;&amp;#039; section, it is possible to define a health check using the setting &amp;lt;code&amp;gt;check&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
By default, a &amp;#039;&amp;#039;server&amp;#039;&amp;#039; is always considered available. If &amp;lt;code&amp;gt;check&amp;lt;/code&amp;gt; is set, the server is available when it is accepting periodic TCP connections, to ensure that it is really able to serve requests.&amp;lt;br /&amp;gt;&lt;br /&gt;
The default address and port for these tests are those of the server, and the default source is the same as the one defined in the backend.&amp;lt;br /&amp;gt;&lt;br /&gt;
It is possible to change the port using the &amp;lt;code&amp;gt;port&amp;lt;/code&amp;gt; parameter (currently not implemented), and the interval (currently not implemented) and timers using the &amp;lt;code&amp;gt;inter&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;rise&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;fall&amp;lt;/code&amp;gt; parameters.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;inter&amp;lt;/code&amp;gt; default value of 2000 ms between two consecutive health checks is good enough.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  rise &amp;amp;lt;count&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;rise&amp;lt;/code&amp;gt; parameter states that a server will be considered as operational after &amp;lt;count&amp;gt; consecutive successful health checks. This value defaults to 2 if unspecified.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  fall &amp;amp;lt;count&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;fall&amp;lt;/code&amp;gt; parameter states that a server will be considered as dead after &amp;lt;count&amp;gt; consecutive unsuccessful health checks. This value defaults to 3 if unspecified.&lt;br /&gt;
&lt;br /&gt;
The request method is defined in the backend using the &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;httpchk&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;httpchk&amp;lt;/code&amp;gt; enables HTTP protocol to check on the servers health.&lt;br /&gt;
&lt;br /&gt;
Possible configuration are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;option httpchk &amp;amp;lt;uri&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Arguments are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;uri&amp;amp;gt;&amp;lt;/code&amp;gt;: is the URI referenced in the HTTP requests. It defaults to &amp;amp;quot;/&amp;amp;quot; which is accessible by default on almost any server, but may be changed to any other URI. Query strings are permitted.&lt;br /&gt;
&lt;br /&gt;
By default, server health checks only consist in trying to establish a TCP connection. When &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;httpchk&amp;lt;/code&amp;gt; is specified, a complete HTTP request is sent once the TCP connection is established, and responses 2xx and 3xx are considered valid, while all other ones indicate a server failure, including the lack of any response.&lt;br /&gt;
&lt;br /&gt;
The port and interval are specified in the &amp;#039;&amp;#039;server&amp;#039;&amp;#039; configuration.&lt;br /&gt;
&lt;br /&gt;
This option does not necessarily require an &amp;#039;&amp;#039;HTTP backend&amp;#039;&amp;#039;, it also works with plain &amp;#039;&amp;#039;TCP backend&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
In the following example, we define the following contextualization variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[...]&lt;br /&gt;
SERVICE_0_CHECK_URI  = &amp;amp;quot;/&amp;amp;quot;&lt;br /&gt;
SERVICE_0_CHECK_RISE = 3&lt;br /&gt;
SERVICE_0_CHECK_FALL = 4&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those variables generate the following HAProxy&amp;#039;s configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[...]&lt;br /&gt;
backend service_0_backend&lt;br /&gt;
   mode http&lt;br /&gt;
   option httpchk /&lt;br /&gt;
   balance source&lt;br /&gt;
   server server0 10.4.0.5:8080 check rise 3 fall 4&lt;br /&gt;
   server server1 10.4.0.6:8080 check rise 3 fall 4&lt;br /&gt;
   server server2 10.4.0.7:8080 check rise 3 fall 4&lt;br /&gt;
   server server3 10.4.0.8:8080 check rise 3 fall 4&lt;br /&gt;
   server server4 10.4.0.9:8080 check rise 3 fall 4&lt;br /&gt;
   server server5 10.4.0.10:8080 check rise 3 fall 4&amp;lt;/pre&amp;gt;&lt;br /&gt;
===== HTTPS Support =====&lt;br /&gt;
&lt;br /&gt;
To enable https support, we need to specify in the &amp;lt;code&amp;gt;frontend&amp;lt;/code&amp;gt; section the option &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; and the option &amp;lt;code&amp;gt;crt&amp;lt;/code&amp;gt; followed by path to the file which contains certificate, privkey, intermediate certificate and dhparam.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
In the following example, we define the following contextualization variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[...]&lt;br /&gt;
SERVICE_X_SSL_OFFLOAD_CERT  = &amp;amp;quot;crt.pem + key.pem + intermediate.pem&amp;amp;quot;;&lt;br /&gt;
SERVICE_X_REDIRECT_TO_HTTPS = True&lt;br /&gt;
SERVICE_X_SSL_HSTS_MAX_AGE  = 15768000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those variables generate the following HAProxy&amp;#039;s configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;frontend service_0&lt;br /&gt;
  mode    http&lt;br /&gt;
  bind    :443 ssl crt /path/to/&amp;amp;lt;cert+privkey+intermediate+dhparam&amp;amp;gt;&lt;br /&gt;
  bind    :80&lt;br /&gt;
  redirect scheme https code 301 if !{ ssl_fc }&lt;br /&gt;
&lt;br /&gt;
  # HSTS (15768000 seconds = 6 months)&lt;br /&gt;
  http-response set-header Strict-Transport-Security max-age=15768000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;Category:OpenNebula&amp;gt;&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=CipherSpace_Load_Balancer&amp;diff=752</id>
		<title>CipherSpace Load Balancer</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=CipherSpace_Load_Balancer&amp;diff=752"/>
		<updated>2017-08-02T14:45:22Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: /* Configure the Load Balancer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OpenNebula]]&lt;br /&gt;
[[Category:How To]]&lt;br /&gt;
[[Category:CloudInfrastructure]]&lt;br /&gt;
== CipherSpace Load Balancer ==&lt;br /&gt;
&lt;br /&gt;
The CipherSpace Load Balancer uses [http://www.haproxy.org/ HAProxy] and its configuration is defined using OpenNebula Contextualization Variables within the appliance&amp;#039;s template.&lt;br /&gt;
&lt;br /&gt;
The CipherSpace Load Balancer uses the concept of &amp;amp;quot;sticky sessions&amp;amp;quot;, which is a mechanism to route requests from the same source to the same target (if the target is still available).&lt;br /&gt;
&lt;br /&gt;
== How to use the CipherSpace Load Balancer ==&lt;br /&gt;
&lt;br /&gt;
=== Download the Load Balancer from the App Market ===&lt;br /&gt;
&lt;br /&gt;
# Go to &amp;amp;quot;Storage&amp;amp;quot; in the left menu and click on &amp;amp;quot;Apps&amp;amp;quot; in the drop down menu.&lt;br /&gt;
#:[[file:lb_1.png|150px|border]]&lt;br /&gt;
#:A list with all existing apps will appear.&lt;br /&gt;
#:[[file:lb_2.png|700px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Select the CipherSpace Load Balancer and click on the &amp;amp;quot;-&amp;amp;gt; OpenNebula&amp;amp;quot; button.&lt;br /&gt;
#:[[file:lb_3.png|700px|border]]&lt;br /&gt;
#:A new window will appear.&lt;br /&gt;
#:[[file:lb_4.png|700px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# You can rename the image (&amp;amp;quot;Name&amp;amp;quot;) as well as the VM template name. Then select the datastore which is used for your VMs and click on &amp;amp;quot;Download&amp;amp;quot;. A new image as well as a new template will be created.&lt;br /&gt;
&lt;br /&gt;
=== Configure the Load Balancer ===&lt;br /&gt;
&lt;br /&gt;
# Go to &amp;amp;quot;Templates&amp;amp;quot; in the left menu and click on &amp;amp;quot;VMs&amp;amp;quot; in the drop down menu.&lt;br /&gt;
#:[[file:lb_5.png|125px|border]]&lt;br /&gt;
#:A list with all existing VM templates will appear.&lt;br /&gt;
#:[[file:lb_6.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Select the template for the load balancer and click on &amp;amp;quot;Update&amp;amp;quot;.&lt;br /&gt;
#:[[file:lb_7.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Click on the &amp;amp;quot;Network&amp;amp;quot; tab&lt;br /&gt;
#:[[file:lb_8.png|500px|border]]&lt;br /&gt;
#:and select a Virtual Network for your NIC (the same network as the VMs which provide the service you would like to load balance).&lt;br /&gt;
#:[[file:lb_9.png|600px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
#:If clients connect to your load balancer from a different network (Internet for example) you need to add another NIC and attach it to the appropriate Virtual Network.&lt;br /&gt;
#:[[file:lb_10.png|600px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Click on the &amp;amp;quot;Context&amp;amp;quot; tab&lt;br /&gt;
#:[[file:lb_11.png|500px|border]]&lt;br /&gt;
#:and then click on the &amp;amp;quot;Custom vars&amp;amp;quot; section.&lt;br /&gt;
#:[[file:lb_12.png|600px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# In the &amp;amp;quot;Custom vars&amp;amp;quot; section, click on the &amp;amp;quot;+&amp;amp;quot; button to enter all the necessary contextualization variables and their respective values (see the section [[#Load Balancer Contextualization Variables | Load Balancer Contextualization Variables]]).&lt;br /&gt;
#:[[file:lb_13.png|700px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# If you have 2 NICs, you should set default gateway by adding the variable &amp;lt;code&amp;gt;GATEWAY_IFACE&amp;lt;/code&amp;gt;and assign it with the number of the NIC on which requests from clients are coming.  (typically &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;).&lt;br /&gt;
#:&amp;lt;code&amp;gt;GATEWAY_IFACE = 1&amp;lt;/code&amp;gt;&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# When you&amp;#039;re done, click on &amp;amp;quot;Update&amp;amp;quot; to save your changes.&lt;br /&gt;
#:[[file:lb_14.png|700px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Load Balancer Contextualization Variables ===&lt;br /&gt;
&lt;br /&gt;
==== Basic Configuration ====&lt;br /&gt;
&lt;br /&gt;
In order to understand the contextualization variables, let&amp;#039;s use the following example.&lt;br /&gt;
&lt;br /&gt;
You have three web servers and a load balancer attached to the same virtual network. The web servers have the IP addresses &amp;lt;code&amp;gt;10.4.0.11&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;10.4.0.12&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;10.4.0.13&amp;lt;/code&amp;gt; respectively. They listen to &amp;lt;code&amp;gt;http&amp;lt;/code&amp;gt; traffic on port &amp;lt;code&amp;gt;8080&amp;lt;/code&amp;gt;. The load balancer listens to &amp;lt;code&amp;gt;http&amp;lt;/code&amp;gt; traffic on the port &amp;lt;code&amp;gt;80&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In this example you only have one service (http) which needs to be balanced.&amp;lt;br /&amp;gt;&lt;br /&gt;
Every contextualization variable for this service will have a name like &amp;lt;code&amp;gt;SERVICE_0_...&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
If you define more services, each new service variables will start with&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;SERVICE_1_&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;SERVICE_2_&amp;lt;/code&amp;gt;, etc..&lt;br /&gt;
&lt;br /&gt;
For this particular example you will define the following variables:&lt;br /&gt;
&lt;br /&gt;
* SERVICE_0_PROTO&lt;br /&gt;
* SERVICE_0_LISTEN_PORT&lt;br /&gt;
* SERVICE_0_IP_RANGE&lt;br /&gt;
* SERVICE_0_BACKEND_PORT&lt;br /&gt;
&lt;br /&gt;
The variable &amp;lt;code&amp;gt;SERVICE_X_PROTO&amp;lt;/code&amp;gt; defines the mode in which the service works. Possible modes are:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;http&amp;#039;&amp;#039;&amp;#039;: the instance will work in HTTP mode. The client request will be analyzed in depth before connecting to any server. Any request which is not RFC-compliant will be rejected. Layer 7 filtering, processing and switching will be possible.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;tcp&amp;#039;&amp;#039;&amp;#039;: the instance will work in pure TCP mode. A full-duplex connection will be established between clients and servers, and no layer 7 examination will be performed. It should be used for SSL, SSH, SMTP, ...&lt;br /&gt;
&lt;br /&gt;
In our example &amp;lt;code&amp;gt;SERVICE_0_PROTO&amp;lt;/code&amp;gt; has the value &amp;lt;code&amp;gt;HTTP&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variable &amp;lt;code&amp;gt;SERVICE_X_LISTEN_PORT&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the TCP port the load balancer is listening to.&amp;lt;br /&amp;gt;&lt;br /&gt;
This variable is &amp;#039;&amp;#039;&amp;#039;mandatory&amp;#039;&amp;#039;&amp;#039;. If this variable isn&amp;#039;t defined, the rest of the service definition will be ignored.&amp;lt;br /&amp;gt;&lt;br /&gt;
In our example &amp;lt;code&amp;gt;SERVICE_0_LISTEN_PORT&amp;lt;/code&amp;gt; has the value &amp;lt;code&amp;gt;80&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variable &amp;lt;code&amp;gt;SERVICE_X_IP_RANGE&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;dotted&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;notation&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the IP addresses of the backend servers. This variable is &amp;#039;&amp;#039;&amp;#039;mandatory&amp;#039;&amp;#039;&amp;#039;.&amp;lt;br /&amp;gt;&lt;br /&gt;
In our example &amp;lt;code&amp;gt;SERVICE_X_IP_RANGE&amp;lt;/code&amp;gt; has the value &amp;lt;code&amp;gt;10.4.0.11-10.4.0.13&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variable &amp;lt;code&amp;gt;SERVICE_X_BACKEND_PORT&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the TCP port the backend servers are listening to. This variable is optional. If this variable isn&amp;#039;t defined, the value of the variable &amp;lt;code&amp;gt;SERVICE_X_LISTEN_PORT&amp;lt;/code&amp;gt; will be used instead.&amp;lt;br /&amp;gt;&lt;br /&gt;
In our example &amp;lt;code&amp;gt;SERVICE_X_BACKEND_PORT&amp;lt;/code&amp;gt; has the value &amp;lt;code&amp;gt;8080&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, our example will be configured as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;   SERVICE_0_PROTO        = HTTP&lt;br /&gt;
   SERVICE_0_LISTEN_PORT  = 80&lt;br /&gt;
   SERVICE_0_IP_RANGE     = 10.4.0.11-10.4.0.13&lt;br /&gt;
   SERVICE_0_BACKEND_PORT = 8080&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Health Checks ====&lt;br /&gt;
&lt;br /&gt;
When you use the load balancer, your backend servers are periodically checked if they are available by accepting periodic TCP connections, to ensure that each server is still alive.&lt;br /&gt;
&lt;br /&gt;
Every 2 seconds, each backend server will be checked and its status will be either Up or Down based on the following rules:&lt;br /&gt;
&lt;br /&gt;
* A server is Up after 2 consecutive successful health checks.&lt;br /&gt;
* A server is Down after 3 consecutive unsuccessful health checks.&lt;br /&gt;
&lt;br /&gt;
You can change the number of consecutive successful health checks using the variable &amp;lt;code&amp;gt;SERVICE_X_CHECK_RISE&amp;lt;/code&amp;gt; and the number of consecutive unsuccessful health checks using the variable &amp;lt;code&amp;gt;SERVICE_X_CHECK_FALL&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s use the example defined in the [[#Basic Configuration|Basic Configuration]] section. If you want to set the number of successful and unsuccessful checks to &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt; respectively for your backend servers, you will add the following to your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;SERVICE_0_CHECK_RISE = 3&lt;br /&gt;
SERVICE_0_CHECK_FALL = 4&amp;lt;/pre&amp;gt;&lt;br /&gt;
By default, server health check only consist in trying to establish a TCP connection. You can add a complete HTTP request after an established TCP connection by adding the following variable:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SERVICE_X_CHECK_URI&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;&amp;amp;lt;uri&amp;amp;gt;&amp;lt;/code&amp;gt;is the URI referenced in the HTTP requests.&amp;lt;br /&amp;gt;&lt;br /&gt;
Responses 2xx and 3xx are considered valid, while all other ones indicate a server failure, including the lack of any response.&lt;br /&gt;
&lt;br /&gt;
==== HTTPS Support ====&lt;br /&gt;
&lt;br /&gt;
To enable HTTPS support, you need to specify the following variables like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;   SERVICE_X_PROTO        = HTTP&lt;br /&gt;
   SERVICE_X_LISTEN_PORT  = 443&lt;br /&gt;
   SERVICE_X_SSL_OFFLOAD_CERT  = &amp;amp;quot;crt.pem + key.pem + intermediate.pem&amp;amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The variable &amp;lt;code&amp;gt;SERVICE_X_SSL_OFFLOAD_CERT&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the certificate chains to offload encrypted connections.&amp;lt;br /&amp;gt;&lt;br /&gt;
It has to be a string which contains the certificate, the key and the chain, all in PEM format; the file order is not important.&amp;lt;br /&amp;gt;&lt;br /&gt;
For instance let&amp;#039;s assume you are using [https://letsencrypt.org/ Let&amp;#039;s Encrypt] certificates, you will concatenate the two files &amp;lt;code&amp;gt;privkey.pem&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;fullchain.pem&amp;lt;/code&amp;gt; as follows:&lt;br /&gt;
&lt;br /&gt;
* In Linux (or in MacOS via terminal): &amp;lt;code&amp;gt;cat privkey.pem fullchain.pem&amp;lt;/code&amp;gt;&lt;br /&gt;
* In Windows (via command prompt): &amp;lt;code&amp;gt;type privkex.pem fullchain.pem&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then copy the result and paste it in the &amp;lt;code&amp;gt;Value&amp;lt;/code&amp;gt; field.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;If you need to redirect your HTTP traffic to HTTPS, you will assign the variable &amp;lt;code&amp;gt;SERVICE_X_REDIRECT_TO_HTTPS&amp;lt;/code&amp;gt; as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;SERVICE_X_REDIRECT_TO_HTTPS = True&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can also define the maximum age of your HTTP Strict Transport Security (HSTS) by assigning the variable &amp;lt;code&amp;gt;SERVICE_X_SSL_HSTS_MAX_AGE&amp;lt;/code&amp;gt; as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;SERVICE_X_SSL_HSTS_MAX_AGE  = 15768000   #corresponds to 6 months&amp;lt;/pre&amp;gt;&lt;br /&gt;
The variable &amp;lt;code&amp;gt;SERVICE_X_SSL_HSTS_MAX_AGE&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the HSTS policy maximum age in seconds. In our example 15768000 seconds correspond to approximatively 6 months.&lt;br /&gt;
&lt;br /&gt;
==== All Variables ====&lt;br /&gt;
&lt;br /&gt;
This sections list all available contextualization variables. Their name is composed as follows:&lt;br /&gt;
&lt;br /&gt;
# &amp;#039;&amp;#039;SERVICE_X_&amp;#039;&amp;#039; (where X is a number &amp;amp;gt;= 0) defines the load balancing service to be configured;&lt;br /&gt;
# &amp;#039;&amp;#039;Keyword&amp;#039;&amp;#039; defines the corresponding service item to be configured.&lt;br /&gt;
&lt;br /&gt;
Some variables are valid for both protocols (tcp and http) and some are valid only with protocol http.&lt;br /&gt;
&lt;br /&gt;
===== TCP and HTTP Variables =====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;MAXCONN&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the value of the &amp;lt;code&amp;gt;maxconn&amp;lt;/code&amp;gt; parameter, which sets the maximum per-process number of concurrent connections. Proxies will stop accepting connections when this limit is reached.&amp;lt;br /&amp;gt;&lt;br /&gt;
The default value is 2000. This variable isn&amp;#039;t mandatory.&lt;br /&gt;
* &amp;lt;code&amp;gt;SERVICE_X_PROTO&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;tcp|http&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the protocol in &amp;#039;&amp;#039;service&amp;#039;&amp;#039; number &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
Default value is http. This variable isn&amp;#039;t mandatory.&lt;br /&gt;
* &amp;lt;code&amp;gt;SERVICE_X_LISTEN_PORT&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the TCP port the load balancer is listening.&amp;lt;br /&amp;gt;&lt;br /&gt;
Default value is Null. This variable is &amp;#039;&amp;#039;&amp;#039;mandatory&amp;#039;&amp;#039;&amp;#039;.&amp;lt;br /&amp;gt;&lt;br /&gt;
If this variable isn&amp;#039;t defined, the rest of the service definition will be ignored.&lt;br /&gt;
* &amp;lt;code&amp;gt;SERVICE_X_IP_RANGE&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;dotted&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;notation&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the IP addresses of backend server(s).&amp;lt;br /&amp;gt;&lt;br /&gt;
Default value is Null. This variable is &amp;#039;&amp;#039;&amp;#039;mandatory&amp;#039;&amp;#039;&amp;#039;.&amp;lt;br /&amp;gt;&lt;br /&gt;
Example: &amp;lt;code&amp;gt;SERVICE_X_IP_RANGE&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;10.4.0.2-10.4.0.20&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;SERVICE_X_BACKEND_PORT&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines TCP port on which backend server(s) are listening.&amp;lt;br /&amp;gt;&lt;br /&gt;
Default value is Null. This variable isn&amp;#039;t mandatory.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE&amp;#039;&amp;#039;&amp;#039; if the variable isn&amp;#039;t defined, it will take the &amp;lt;code&amp;gt;SERVICE_X_LISTEN_PORT&amp;lt;/code&amp;gt; value.&lt;br /&gt;
* &amp;lt;code&amp;gt;SERVICE_X_CHECK_RISE&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the number of consecutive successful health checks that declare the backend server is alive.&amp;lt;br /&amp;gt;&lt;br /&gt;
Default value is 2. This variable isn&amp;#039;t mandatory.&lt;br /&gt;
* &amp;lt;code&amp;gt;SERVICE_X_CHECK_FALL&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the number of consecutive unsuccessful health checks that declare the backend server is dead.&amp;lt;br /&amp;gt;&lt;br /&gt;
Default value is 3. This variable isn&amp;#039;t mandatory.&lt;br /&gt;
&lt;br /&gt;
===== HTTP only Variables =====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;SERVICE_X_CHECK_URI&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the URI referenced in the HTTP health-check.&amp;lt;br /&amp;gt;&lt;br /&gt;
Default value is Null. This variable isn&amp;#039;t mandatory.&lt;br /&gt;
* &amp;lt;code&amp;gt;SERVICE_X_SSL_OFFLOAD_CERT&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the certificate chains to offload encrypted connections.&amp;lt;br /&amp;gt;&lt;br /&gt;
It has to be a string which contains the following files in PEM format: &amp;lt;code&amp;gt;chain&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;key&amp;lt;/code&amp;gt;and &amp;lt;code&amp;gt;intermediate&amp;lt;/code&amp;gt;. Order is not important. Default value is Null. This variable isn&amp;#039;t mandatory.&lt;br /&gt;
* &amp;lt;code&amp;gt;SERVICE_X_REDIRECT_TO_HTTPS&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;True&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the presence of a 301 redirect from http to https.&amp;lt;br /&amp;gt;&lt;br /&gt;
Default value is Null. This variable isn&amp;#039;t mandatory.&lt;br /&gt;
* &amp;lt;code&amp;gt;SERVICE_X_SSL_HSTS_MAX_AGE&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; defines the HSTS policy max-age in seconds.&amp;lt;br /&amp;gt;&lt;br /&gt;
Default value is Null. This variable isn&amp;#039;t mandatory.&lt;br /&gt;
&lt;br /&gt;
Default Null value means that the related configuration is not applied if the variable isn&amp;#039;t defined.&lt;br /&gt;
&lt;br /&gt;
=== Start and Check the Load Balancer ===&lt;br /&gt;
&lt;br /&gt;
# Go to &amp;amp;quot;Templates&amp;amp;quot; in the left menu and click on &amp;amp;quot;VMs&amp;amp;quot; in the drop down menu.&lt;br /&gt;
#:[[file:lb_5.png|125px|border]]&lt;br /&gt;
#:A list with all existing VM templates will appear.&lt;br /&gt;
#:[[file:lb_6.png|500px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# Select the configured load balancer template and click on &amp;amp;quot;Instantiate&amp;amp;quot;.&lt;br /&gt;
#:[[file:lb_15.png|500px|border]]&lt;br /&gt;
#:A new window will appear&lt;br /&gt;
#:[[file:lb_16.png|600px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
# You can assign a name to your load balancer or leave the field empty. Click on &amp;amp;quot;Instantiate&amp;amp;quot; to start the instantiation.&lt;br /&gt;
# When the new VM is in the &amp;lt;code&amp;gt;RUNNING&amp;lt;/code&amp;gt; state, click on the console icon [[file:lb_17.png|25px]] to access the VM.&lt;br /&gt;
# In the console you will see the login prompt and after a while you will see wether the HAProxy configuration was successful or not. If not, terminate the VM, modify the variables in the template and re-instantiate the VM.&lt;br /&gt;
#:[[file:lb_18.png|700px|border]]&lt;br /&gt;
#:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to Modify the Load Balancer&amp;#039;s Configuration. ==&lt;br /&gt;
&lt;br /&gt;
Currently you cannot modify the load balancer&amp;#039;s configuration while it is running. Also if you were to modify the HAProxy configuration within the load balancer VM, if the VM had to be terminated and re-instantiated, you would loose your modifications.&lt;br /&gt;
&lt;br /&gt;
In order to minimize the downtime, you should:&lt;br /&gt;
# Clone the Load Balancer&amp;#039;s Template in case you have to roll back.&lt;br /&gt;
# Change the configuration in the new template by adding variables, removing variables or modifying existing variables.&lt;br /&gt;
# Terminate the old load balancer VM&lt;br /&gt;
# Instantiate the new template again.&lt;br /&gt;
&lt;br /&gt;
== Appendix ==&lt;br /&gt;
&lt;br /&gt;
=== Dissecting HAProxy&amp;#039;s configuration ===&lt;br /&gt;
&lt;br /&gt;
HAProxy configuration consists of several sections:&lt;br /&gt;
&lt;br /&gt;
* the &amp;lt;code&amp;gt;global&amp;lt;/code&amp;gt; section, which sets process-wide parameters (static, cannot be modified),&lt;br /&gt;
* and for each defined service, a &amp;lt;code&amp;gt;proxy&amp;lt;/code&amp;gt; section, which is built using the contextualization variables.&lt;br /&gt;
&lt;br /&gt;
==== Global Section ====&lt;br /&gt;
&lt;br /&gt;
Global section is standardized for every appliance as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;global&lt;br /&gt;
    log         127.0.0.1 local2&lt;br /&gt;
    chroot      /var/lib/haproxy&lt;br /&gt;
    pidfile     /var/run/haproxy.pid&lt;br /&gt;
    # set default parameters to the intermediate configuration&lt;br /&gt;
    tune.ssl.default-dh-param 2048&lt;br /&gt;
    ssl-default-bind-ciphers ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS&lt;br /&gt;
    ssl-default-bind-options no-sslv3 no-tls-tickets&lt;br /&gt;
    ssl-default-server-ciphers ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS&lt;br /&gt;
    ssl-default-server-options no-sslv3 no-tls-tickets&lt;br /&gt;
    user        haproxy&lt;br /&gt;
    group       haproxy&lt;br /&gt;
    daemon&lt;br /&gt;
    maxconn     2000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Parameter &amp;lt;code&amp;gt;maxconn&amp;lt;/code&amp;gt; sets the maximum per-process number of concurrent connections. Proxies will stop accepting connections when this limit is reached. For further information see [https://cbonte.github.io/haproxy-dconv/1.7/configuration.html#3.2-maxconn this page]. This parameter can be modified using a contextualization variable.&lt;br /&gt;
&lt;br /&gt;
==== Proxy Section ====&lt;br /&gt;
&lt;br /&gt;
In HAProxy, the Proxy configuration for each service contains a set of sections, which can be either:&lt;br /&gt;
&lt;br /&gt;
* defaults [&amp;amp;lt;name&amp;amp;gt;]&lt;br /&gt;
* frontend &amp;amp;lt;name&amp;amp;gt;&lt;br /&gt;
* backend &amp;amp;lt;name&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or:&lt;br /&gt;
&lt;br /&gt;
* defaults [&amp;amp;lt;name&amp;amp;gt;]&lt;br /&gt;
* listen &amp;amp;lt;name&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;defaults&amp;lt;/code&amp;gt; section sets default parameters for all other sections following its declaration. Those default parameters are reset by the next &amp;lt;code&amp;gt;defaults&amp;lt;/code&amp;gt; section.&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;frontend&amp;lt;/code&amp;gt; section describes a set of listening sockets accepting client connections.&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;backend&amp;lt;/code&amp;gt; section describes a set of servers to which the proxy will connect to forward incoming connections.&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;listen&amp;lt;/code&amp;gt; section defines a complete proxy with its frontend and backend parts combined in one section. It is generally useful for TCP-only traffic.&lt;br /&gt;
&lt;br /&gt;
For the CipherSpace Load Balancer, we use only one &amp;lt;code&amp;gt;defaults&amp;lt;/code&amp;gt; section, valid for all services. We also don&amp;#039;t use the &amp;lt;code&amp;gt;listen&amp;lt;/code&amp;gt; section, as it can be replaced with one &amp;lt;code&amp;gt;frontend&amp;lt;/code&amp;gt;and one &amp;lt;code&amp;gt;backend&amp;lt;/code&amp;gt; section.&lt;br /&gt;
&lt;br /&gt;
Right now, two major proxy modes are supported: &amp;lt;code&amp;gt;tcp&amp;lt;/code&amp;gt;, also known as &amp;#039;&amp;#039;layer 4&amp;#039;&amp;#039;, and &amp;lt;code&amp;gt;http&amp;lt;/code&amp;gt;, also known as &amp;#039;&amp;#039;layer 7&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
In &amp;#039;&amp;#039;&amp;#039;layer 4 mode&amp;#039;&amp;#039;&amp;#039;, HAProxy simply forwards bidirectional traffic between two sides.&amp;lt;br /&amp;gt;&lt;br /&gt;
In &amp;#039;&amp;#039;&amp;#039;layer 7 mode&amp;#039;&amp;#039;&amp;#039;, HAProxy analyzes the protocol, and can interact with it by allowing, blocking, switching, adding, modifying, or removing arbitrary contents in requests or responses, based on arbitrary criteria.&lt;br /&gt;
&lt;br /&gt;
===== Defaults Section =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;defaults&amp;lt;/code&amp;gt; section is standardized for every appliance as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  defaults&lt;br /&gt;
     log                     global&lt;br /&gt;
     option                  redispatch&lt;br /&gt;
     retries                 3&lt;br /&gt;
     timeout http-request    10s&lt;br /&gt;
     timeout queue           1m&lt;br /&gt;
     timeout connect         10s&lt;br /&gt;
     timeout client          1m&lt;br /&gt;
     timeout server          1m&lt;br /&gt;
     timeout http-keep-alive 10s&lt;br /&gt;
     timeout check           10s&amp;lt;/pre&amp;gt;&lt;br /&gt;
===== Frontend and Backend Sections =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;frontend&amp;lt;/code&amp;gt;and &amp;lt;code&amp;gt;backend&amp;lt;/code&amp;gt;sections are configured using the contextualization variables defined in the section [[#all-variables|All Variables]].&lt;br /&gt;
&lt;br /&gt;
Variable &amp;lt;code&amp;gt;SERVICE_X_PROTO&amp;lt;/code&amp;gt; defines the mode in which the service works. Possible modes are:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;http&amp;#039;&amp;#039;&amp;#039;: the instance will work in HTTP mode. The client request will be analyzed in depth before connecting to any server. Any request which is not RFC-compliant will be rejected. Layer 7 filtering, processing and switching will be possible.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;tcp&amp;#039;&amp;#039;&amp;#039;: the instance will work in pure TCP mode. A full-duplex connection will be established between clients and servers, and no layer 7 examination will be performed. This is the default mode. It should be used for SSL, SSH, SMTP, ...&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;SERVICE_X_PROTO&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;http&amp;lt;/code&amp;gt;, the service is defined in &amp;lt;code&amp;gt;mode&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;http&amp;lt;/code&amp;gt; and the script generates the following configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  [...]&lt;br /&gt;
  frontend service_X&lt;br /&gt;
    mode http&lt;br /&gt;
    option                  httplog&lt;br /&gt;
    option http-server-close&lt;br /&gt;
    option forwardfor       except 127.0.0.0/8&lt;br /&gt;
    [...]&lt;br /&gt;
&lt;br /&gt;
  backend service_X_backend&lt;br /&gt;
    mode http&lt;br /&gt;
    balance source&lt;br /&gt;
    [...]  &amp;lt;/pre&amp;gt;&lt;br /&gt;
When &amp;lt;code&amp;gt;SERVICE_X_PROTO&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;tcp&amp;lt;/code&amp;gt;, the service is defined in &amp;lt;code&amp;gt;mode&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;tcp&amp;lt;/code&amp;gt; and the script generates the following configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;   [...]&lt;br /&gt;
   frontend service_X&lt;br /&gt;
     mode tcp&lt;br /&gt;
     option                  tcplog&lt;br /&gt;
     [...]&lt;br /&gt;
&lt;br /&gt;
   backend service_X_backend&lt;br /&gt;
     mode tcp&lt;br /&gt;
     balance source&lt;br /&gt;
     [...]  &amp;lt;/pre&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
In the following example, we define the following contextualization variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;   SERVICE_0_PROTO        = http&lt;br /&gt;
   SERVICE_0_LISTEN_PORT  = 80&lt;br /&gt;
   SERVICE_0_IP_RANGE     = 10.4.0.5 - 10.4.0.10&lt;br /&gt;
   SERVICE_0_BACKEND_PORT = 8080&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those variables generate the following complete HAProxy&amp;#039;s configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;   global&lt;br /&gt;
      log         127.0.0.1 local2&lt;br /&gt;
      chroot      /var/lib/haproxy&lt;br /&gt;
      pidfile     /var/run/haproxy.pid&lt;br /&gt;
      # set default parameters to the intermediate configuration&lt;br /&gt;
      tune.ssl.default-dh-param 2048&lt;br /&gt;
      ssl-default-bind-ciphers       ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA84:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHEECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RA-DES-CB       C3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS&lt;br /&gt;
      ssl-default-bind-options no-sslv3 no-tls-tickets&lt;br /&gt;
      ssl-default-server-ciphers       ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA84:DHE-R      SA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHEECDSA-AE      S256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RA-DES-CB       C3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS&lt;br /&gt;
      ssl-default-server-options no-sslv3 no-tls-tickets&lt;br /&gt;
      user        haproxy&lt;br /&gt;
      group       haproxy&lt;br /&gt;
      daemon&lt;br /&gt;
      maxconn     2000&lt;br /&gt;
&lt;br /&gt;
   defaults&lt;br /&gt;
      log                     global&lt;br /&gt;
      option                  redispatch&lt;br /&gt;
      retries                 3&lt;br /&gt;
      timeout http-request    10s&lt;br /&gt;
      timeout queue           1m&lt;br /&gt;
      timeout connect         10s&lt;br /&gt;
      timeout client          1m&lt;br /&gt;
      timeout server          1m&lt;br /&gt;
      timeout http-keep-alive 10s&lt;br /&gt;
      timeout check           10s&lt;br /&gt;
      maxconn                 3000&lt;br /&gt;
&lt;br /&gt;
   frontend service_0&lt;br /&gt;
      mode http&lt;br /&gt;
      option                  httplog&lt;br /&gt;
      option http-server-close&lt;br /&gt;
      option forwardfor       except 127.0.0.0/8&lt;br /&gt;
      bind :80&lt;br /&gt;
      default_backend service_0_backend&lt;br /&gt;
&lt;br /&gt;
   backend service_0_backend&lt;br /&gt;
      mode http&lt;br /&gt;
      balance source&lt;br /&gt;
      server server0 10.4.0.5:8080 check&lt;br /&gt;
      server server1 10.4.0.6:8080 check&lt;br /&gt;
      server server2 10.4.0.7:8080 check&lt;br /&gt;
      server server3 10.4.0.8:8080 check&lt;br /&gt;
      server server4 10.4.0.9:8080 check&lt;br /&gt;
      server server5 10.4.0.10:8080 check&amp;lt;/pre&amp;gt;&lt;br /&gt;
===== Health Checks =====&lt;br /&gt;
&lt;br /&gt;
When a &amp;#039;&amp;#039;server&amp;#039;&amp;#039; is defined in the &amp;#039;&amp;#039;backend&amp;#039;&amp;#039; section, it is possible to define a health check using the setting &amp;lt;code&amp;gt;check&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
By default, a &amp;#039;&amp;#039;server&amp;#039;&amp;#039; is always considered available. If &amp;lt;code&amp;gt;check&amp;lt;/code&amp;gt; is set, the server is available when it is accepting periodic TCP connections, to ensure that it is really able to serve requests.&amp;lt;br /&amp;gt;&lt;br /&gt;
The default address and port for these tests are those of the server, and the default source is the same as the one defined in the backend.&amp;lt;br /&amp;gt;&lt;br /&gt;
It is possible to change the port using the &amp;lt;code&amp;gt;port&amp;lt;/code&amp;gt; parameter (currently not implemented), and the interval (currently not implemented) and timers using the &amp;lt;code&amp;gt;inter&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;rise&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;fall&amp;lt;/code&amp;gt; parameters.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;inter&amp;lt;/code&amp;gt; default value of 2000 ms between two consecutive health checks is good enough.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  rise &amp;amp;lt;count&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;rise&amp;lt;/code&amp;gt; parameter states that a server will be considered as operational after &amp;lt;count&amp;gt; consecutive successful health checks. This value defaults to 2 if unspecified.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  fall &amp;amp;lt;count&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;fall&amp;lt;/code&amp;gt; parameter states that a server will be considered as dead after &amp;lt;count&amp;gt; consecutive unsuccessful health checks. This value defaults to 3 if unspecified.&lt;br /&gt;
&lt;br /&gt;
The request method is defined in the backend using the &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;httpchk&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;httpchk&amp;lt;/code&amp;gt; enables HTTP protocol to check on the servers health.&lt;br /&gt;
&lt;br /&gt;
Possible configuration are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;option httpchk &amp;amp;lt;uri&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Arguments are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;uri&amp;amp;gt;&amp;lt;/code&amp;gt;: is the URI referenced in the HTTP requests. It defaults to &amp;amp;quot;/&amp;amp;quot; which is accessible by default on almost any server, but may be changed to any other URI. Query strings are permitted.&lt;br /&gt;
&lt;br /&gt;
By default, server health checks only consist in trying to establish a TCP connection. When &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;httpchk&amp;lt;/code&amp;gt; is specified, a complete HTTP request is sent once the TCP connection is established, and responses 2xx and 3xx are considered valid, while all other ones indicate a server failure, including the lack of any response.&lt;br /&gt;
&lt;br /&gt;
The port and interval are specified in the &amp;#039;&amp;#039;server&amp;#039;&amp;#039; configuration.&lt;br /&gt;
&lt;br /&gt;
This option does not necessarily require an &amp;#039;&amp;#039;HTTP backend&amp;#039;&amp;#039;, it also works with plain &amp;#039;&amp;#039;TCP backend&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
In the following example, we define the following contextualization variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[...]&lt;br /&gt;
SERVICE_0_CHECK_URI  = &amp;amp;quot;/&amp;amp;quot;&lt;br /&gt;
SERVICE_0_CHECK_RISE = 3&lt;br /&gt;
SERVICE_0_CHECK_FALL = 4&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those variables generate the following HAProxy&amp;#039;s configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[...]&lt;br /&gt;
backend service_0_backend&lt;br /&gt;
   mode http&lt;br /&gt;
   option httpchk /&lt;br /&gt;
   balance source&lt;br /&gt;
   server server0 10.4.0.5:8080 check rise 3 fall 4&lt;br /&gt;
   server server1 10.4.0.6:8080 check rise 3 fall 4&lt;br /&gt;
   server server2 10.4.0.7:8080 check rise 3 fall 4&lt;br /&gt;
   server server3 10.4.0.8:8080 check rise 3 fall 4&lt;br /&gt;
   server server4 10.4.0.9:8080 check rise 3 fall 4&lt;br /&gt;
   server server5 10.4.0.10:8080 check rise 3 fall 4&amp;lt;/pre&amp;gt;&lt;br /&gt;
===== HTTPS Support =====&lt;br /&gt;
&lt;br /&gt;
To enable https support, we need to specify in the &amp;lt;code&amp;gt;frontend&amp;lt;/code&amp;gt; section the option &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; and the option &amp;lt;code&amp;gt;crt&amp;lt;/code&amp;gt; followed by path to the file which contains certificate, privkey, intermediate certificate and dhparam.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
In the following example, we define the following contextualization variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[...]&lt;br /&gt;
SERVICE_X_SSL_OFFLOAD_CERT  = &amp;amp;quot;crt.pem + key.pem + intermediate.pem&amp;amp;quot;;&lt;br /&gt;
SERVICE_X_REDIRECT_TO_HTTPS = True&lt;br /&gt;
SERVICE_X_SSL_HSTS_MAX_AGE  = 15768000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those variables generate the following HAProxy&amp;#039;s configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;frontend service_0&lt;br /&gt;
  mode    http&lt;br /&gt;
  bind    :443 ssl crt /path/to/&amp;amp;lt;cert+privkey+intermediate+dhparam&amp;amp;gt;&lt;br /&gt;
  bind    :80&lt;br /&gt;
  redirect scheme https code 301 if !{ ssl_fc }&lt;br /&gt;
&lt;br /&gt;
  # HSTS (15768000 seconds = 6 months)&lt;br /&gt;
  http-response set-header Strict-Transport-Security max-age=15768000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;Category:OpenNebula&amp;gt;&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=How_To_Create_and_Use_Security_Groups_in_OpenNebula&amp;diff=742</id>
		<title>How To Create and Use Security Groups in OpenNebula</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=How_To_Create_and_Use_Security_Groups_in_OpenNebula&amp;diff=742"/>
		<updated>2017-07-27T06:48:49Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: /* What is a Security Group ? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OpenNebula]]&lt;br /&gt;
[[Category:How To]]&lt;br /&gt;
[[Category:CloudInfrastructure]]&lt;br /&gt;
== What is a Security Group ? ==&lt;br /&gt;
&lt;br /&gt;
A Security Group define firewall rules, which can then be applied to your VMs and/or your Virtual Networks.&lt;br /&gt;
&lt;br /&gt;
== Create a new Security Group ==&lt;br /&gt;
&lt;br /&gt;
#[[OpenNebula_Administrative_Functions | Log into OpenNebula Sunstone]].&lt;br /&gt;
# Go to &amp;amp;quot;Network&amp;amp;quot; in the left menu and click on &amp;amp;quot;Security Groups&amp;amp;quot; in the drop down menu.&lt;br /&gt;
#:[[File:SecGp_1.png|150px]]&lt;br /&gt;
#: &amp;lt;br&amp;gt;&lt;br /&gt;
#:A list with all existing security groups will appear.&lt;br /&gt;
#:[[File:SecGp_2.png|700px]]&lt;br /&gt;
# Click on the &amp;amp;quot;+&amp;amp;quot; button to create a new Security group.&lt;br /&gt;
&lt;br /&gt;
== Define a Security Group ==&lt;br /&gt;
&lt;br /&gt;
A security group is defined by its name, an optional description and one or several rules.&lt;br /&gt;
:[[File:SecGp_3.png|600px]]&lt;br /&gt;
&lt;br /&gt;
=== Create a new rule ===&lt;br /&gt;
&lt;br /&gt;
To create a new rule, you must specify the following parameters:&lt;br /&gt;
&lt;br /&gt;
* Traffic direction: Choose between &amp;amp;quot;Inbound&amp;amp;quot; and &amp;amp;quot;Outbound&amp;amp;quot;&lt;br /&gt;
* Protocol: Choose between the following values:&lt;br /&gt;
** TCP&lt;br /&gt;
** UDP&lt;br /&gt;
** ICMP&lt;br /&gt;
** IPsec&lt;br /&gt;
** All&lt;br /&gt;
* Port range: Only available with TCP or UDP. You can either select &amp;amp;quot;All&amp;amp;quot; or you can specify a port range. Multiple ports or port ranges are separated using a comma, and a port range is specified using a colon. Example: &amp;lt;code&amp;gt;22,53,80:90,110,1024:65535&amp;lt;/code&amp;gt;&lt;br /&gt;
* ICMP Type: Only available with ICMP. Use the dropdown to select the desired type or you can leave it blank to allow all ICMP traffic.&lt;br /&gt;
* Target network: you can define wether this rule can be applied to&lt;br /&gt;
** any virtual network (&amp;amp;quot;Any network&amp;amp;quot;),&lt;br /&gt;
** a specific virtual network (&amp;amp;quot;OpenNebula Virtual Network&amp;amp;quot;),&lt;br /&gt;
** or a specific IP range (&amp;amp;quot;Manual Network&amp;amp;quot;)&lt;br /&gt;
&lt;br /&gt;
If you choose &amp;amp;quot;Manual Network&amp;amp;quot;, you must specify the following values: - First IP address: the first IP of your range - Size: the number of IP adresses in your range (including the first)&lt;br /&gt;
&lt;br /&gt;
When all the parameters are specified, click on &amp;amp;quot;Add rule&amp;amp;quot; to create the new rule.&lt;br /&gt;
:[[File:SecGp_4.png|700px]]&lt;br /&gt;
&lt;br /&gt;
When all the rules have been defined, click on &amp;amp;quot;Create&amp;amp;quot; to finish the creation of the new Security Group.&lt;br /&gt;
:[[File:SecGp_5.png|600px]]&lt;br /&gt;
&lt;br /&gt;
== Use a Security Group ==&lt;br /&gt;
=== Apply the group to a Virtual Network ===&lt;br /&gt;
&lt;br /&gt;
After you have applied a security group to a Virtual Network, the security group rules are copied to a new VM (attached to that Network) during the instantiation process.&lt;br /&gt;
&lt;br /&gt;
To apply a security group to a Virtual Network, do the following steps:&lt;br /&gt;
&lt;br /&gt;
# Go to &amp;amp;quot;Network&amp;amp;quot; in the left menu and click on &amp;amp;quot;Virtual Networks&amp;amp;quot; in the drop down menu.&lt;br /&gt;
#:[[File:SecGp_6.png|150px]]&lt;br /&gt;
#:&amp;lt;br&amp;gt;&lt;br /&gt;
#:A list with all existing virtual networks will appear.&lt;br /&gt;
# Select the virtual network you want to apply these rules to and click on &amp;amp;quot;Update&amp;amp;quot;&lt;br /&gt;
#:[[File:SecGp_7.png|700px]]&lt;br /&gt;
#:&amp;lt;br&amp;gt;&lt;br /&gt;
# Go on the Security tab,&lt;br /&gt;
#:[[File:SecGp_8.png|700px]]&lt;br /&gt;
#:&amp;lt;br&amp;gt;&lt;br /&gt;
#:and click on the security group you want to add.&lt;br /&gt;
#:[[File:SecGp_9.png|700px]]&lt;br /&gt;
#:&amp;lt;br&amp;gt;&lt;br /&gt;
# Click on &amp;amp;quot;Update&amp;amp;quot; to save your changes.&lt;br /&gt;
#:[[File:SecGp_10.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Apply the group to a specific Virtual Machine ===&lt;br /&gt;
&lt;br /&gt;
If  you need to apply the security group only to specific VM, you can attach a security group to a VM Template NIC as follows:&lt;br /&gt;
# Go to &amp;amp;quot;Template&amp;amp;quot; in the left menu and click on &amp;amp;quot;VMs&amp;amp;quot; in the drop down menu.&lt;br /&gt;
#:[[File:SecGp_11.png|150px]]&lt;br /&gt;
#:&amp;lt;br&amp;gt;&lt;br /&gt;
#:A list with all existing templates will appear.&lt;br /&gt;
# Select the template you want to apply these rules to and click on &amp;amp;quot;Update&amp;amp;quot;&lt;br /&gt;
#:[[File:SecGp_12.png|700px]]&lt;br /&gt;
#:&amp;lt;br&amp;gt;&lt;br /&gt;
# Go on the Network tab&lt;br /&gt;
#:[[File:SecGp_13.png|700px]]&lt;br /&gt;
#:&amp;lt;br&amp;gt;&lt;br /&gt;
# Click on &amp;quot;Advanced options&amp;quot; and scroll down to &amp;quot;Security Groups&amp;quot;&lt;br /&gt;
#:[[File:SecGp_14.png|700px]]&lt;br /&gt;
#:&amp;lt;br&amp;gt;&lt;br /&gt;
#:and click on the security group you want to add.&lt;br /&gt;
#:[[File:SecGp_15.png|700px]]&lt;br /&gt;
#:&amp;lt;br&amp;gt;&lt;br /&gt;
# Click on &amp;amp;quot;Update&amp;amp;quot; to save your changes.&lt;br /&gt;
#:[[File:SecGp_16.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Update a Security Group ==&lt;br /&gt;
&lt;br /&gt;
Security Groups can be updated to edit or add new rules. These changes are propagated to all VMs in the security group, so it may take some time till the changes are applied. The particular status of a VM can be checked in the security group properties, where outdated and up-to-date VMs are listed.&lt;br /&gt;
&lt;br /&gt;
To update a security group:&lt;br /&gt;
&lt;br /&gt;
# Go to &amp;amp;quot;Network&amp;amp;quot; in the left menu and click on &amp;amp;quot;Security Groups&amp;amp;quot; in the drop down menu.&lt;br /&gt;
#:[[File:SecGp_1.png|150px]]&lt;br /&gt;
#: &amp;lt;br&amp;gt;&lt;br /&gt;
#:A list with all existing security groups will appear.&lt;br /&gt;
#:[[File:SecGp_2.png|800px]]&lt;br /&gt;
# Select the group you want to update and click on &amp;quot;Update&amp;quot;&lt;br /&gt;
#:[[File:SecGp_16.png|800px]]&lt;br /&gt;
# Add rules accordingly or remove existing rules by clicking on the &amp;quot;x&amp;quot; button next to the rule.&lt;br /&gt;
# Click &amp;quot;Update&amp;quot; to save the changes. The updated rules are then propagated to all VMs in the security group&lt;br /&gt;
&lt;br /&gt;
To see the propagation status, go back to the security group list, click on the group you&amp;#039;ve just updated and click on the VMs tab.&lt;br /&gt;
You will see all VMs in this group and their status.&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=CipherSpace_Virtual_Router&amp;diff=681</id>
		<title>CipherSpace Virtual Router</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=CipherSpace_Virtual_Router&amp;diff=681"/>
		<updated>2017-05-10T06:49:48Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OpenNebula]]&lt;br /&gt;
[[Category:How To]]&lt;br /&gt;
[[Category:CloudInfrastructure]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;CipherSpace Virtual Router&amp;#039;&amp;#039;&amp;#039; is meant to be used as:&lt;br /&gt;
* Router (masquerade)&lt;br /&gt;
* DHCP server&lt;br /&gt;
* DNS server&lt;br /&gt;
* RADVD server&lt;br /&gt;
* Port forwarding server&lt;br /&gt;
* Bastion host for SSH tunnels&lt;br /&gt;
* OpenVPN server&lt;br /&gt;
&lt;br /&gt;
CipherSpace Virtual Router allows using VMs which are not contextualized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CipherSpace-VirtualRouter-Diagram.png|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The virtual router image is non-persistent and takes its entire configuration from the contextualization script. Default VM size is 256MB RAM, 0.5 CPU and 1 vCPU. &lt;br /&gt;
You can install it from the Appmarket.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color: red&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;When using DHCP or OpenVPN make sure IP spoofing and MAC spoofing protections are turned off for the internal network.&amp;#039;&amp;#039;&amp;#039;&amp;lt;/span&amp;gt; Otherwise it will not work.&lt;br /&gt;
&lt;br /&gt;
== Virtual Router Configuration ==&lt;br /&gt;
Following configurations can be added in the virtual router template in &amp;quot;Context&amp;quot; menu under &amp;quot;Custom Vars&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The virtual router can be configured with 1 or 2 network interfaces. With 1 network interface it can be used only as &amp;#039;&amp;#039;&amp;#039;DHCP&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;RADVD&amp;#039;&amp;#039;&amp;#039; server. &lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;TEMPLATE&amp;#039;&amp;#039;&amp;#039; - this is &amp;#039;&amp;#039;&amp;#039;required&amp;#039;&amp;#039;&amp;#039;. Otherwise most of the other functionality will not work. Usage:&lt;br /&gt;
 TEMPLATE   = &amp;quot;$TEMPLATE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;PRIVNET&amp;#039;&amp;#039;&amp;#039; - private network. For example:&lt;br /&gt;
 PRIVNET = &amp;quot;$NETWORK[TEMPLATE, NETWORK=\&amp;quot;&amp;lt;private_network_name&amp;gt;\&amp;quot;]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;PUBNET&amp;#039;&amp;#039;&amp;#039; - public network. For example:&lt;br /&gt;
 PUBNET = &amp;quot;$NETWORK[TEMPLATE, NETWORK=\&amp;quot;&amp;lt;public_network_name&amp;gt;\&amp;quot;]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;RADVD&amp;#039;&amp;#039;&amp;#039; - enables or disabled RADVD server. Possible values are &amp;#039;&amp;#039;&amp;#039;YES&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;NO&amp;#039;&amp;#039;&amp;#039;. For example&lt;br /&gt;
 RADVD = &amp;quot;NO&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;DHCP&amp;#039;&amp;#039;&amp;#039; - enables or disabled DHCP server. Possible values are &amp;#039;&amp;#039;&amp;#039;YES&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;NO&amp;#039;&amp;#039;&amp;#039;. For example&lt;br /&gt;
 DHCP = &amp;quot;YES&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;DNS&amp;#039;&amp;#039;&amp;#039; - list of DNS servers to use in DHCP leases. If not specified DHCP server will use VMs private network IP address. For example:&lt;br /&gt;
 DNS = &amp;quot;10.1.1.1 10.2.2.2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SEARCH&amp;#039;&amp;#039;&amp;#039; - DNS search option. For example:&lt;br /&gt;
 SEARCH = &amp;quot;zh4.cipherspace.net&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;NTP_SERVER&amp;#039;&amp;#039;&amp;#039; - IP of the NTP server. The DHCP server will be configured to serve the NTP parameter to its leases. For example:&lt;br /&gt;
 NTP_SERVER = &amp;quot;10.0.0.10&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FORWARDING&amp;#039;&amp;#039;&amp;#039; -  list of forwarding rules separated by spaces. Syntax:&lt;br /&gt;
 [[protocol:]route_port:]destination:vm_port&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;protocol&amp;#039;&amp;#039;&amp;#039; is not validated but it only makes sense to use &amp;#039;&amp;#039;&amp;#039;tcp&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;udp&amp;#039;&amp;#039;&amp;#039;.Default is &amp;#039;&amp;#039;&amp;#039;tcp&amp;#039;&amp;#039;&amp;#039;. If &amp;#039;&amp;#039;&amp;#039;router_port&amp;#039;&amp;#039;&amp;#039; is omitted too then port &amp;#039;&amp;#039;&amp;#039;vm_port&amp;#039;&amp;#039;&amp;#039; on the router will be forwarded to &amp;#039;&amp;#039;&amp;#039;vm_port&amp;#039;&amp;#039;&amp;#039; on the VM. For example:&lt;br /&gt;
 FORWARDING = &amp;quot;udp:8888:10.0.0.10:53 8080:10.0.0.10:80 10.0.0.10:22&amp;quot;&lt;br /&gt;
{|&lt;br /&gt;
|style=&amp;quot;text-align:right;&amp;quot;|&amp;lt;code lang=&amp;quot;text&amp;quot;&amp;gt;udp:8888:10.0.0.10:53&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;padding-left: 15px&amp;quot;|Forward UDP port 8888 on the router to port 53 on 10.0.0.10.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:right;&amp;quot;|&amp;lt;code lang=&amp;quot;text&amp;quot;&amp;gt;8080:10.0.0.10:80&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;padding-left: 15px&amp;quot;|Forward TCP port 8080 on the router to port 80 on 10.0.0.10.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:right;&amp;quot;|&amp;lt;code lang=&amp;quot;text&amp;quot;&amp;gt;10.0.0.10:22&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;padding-left: 15px&amp;quot;|Forward TCP port 22 the router to port 22 on 10.0.0.10.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ROOT_PASSWORD&amp;#039;&amp;#039;&amp;#039; - base64 encoded &amp;#039;&amp;#039;&amp;#039;root&amp;#039;&amp;#039;&amp;#039; password hash. For example one can use the following command:&lt;br /&gt;
 openssl passwd -1 | base64&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SSH_PUBLIC_KEY&amp;#039;&amp;#039;&amp;#039; - single line, base64 encoded list of SSH keys to be set as &amp;#039;&amp;#039;&amp;#039;root&amp;#039;s authorized_keys&amp;#039;&amp;#039;&amp;#039;. That is the &amp;#039;&amp;#039;&amp;#039;Public key&amp;#039;&amp;#039;&amp;#039; field in &amp;#039;&amp;#039;&amp;#039;Context&amp;#039;&amp;#039;&amp;#039;-&amp;gt;&amp;#039;&amp;#039;&amp;#039;Network &amp;amp; SSH&amp;#039;&amp;#039;&amp;#039;. This is not a custom field. To generate the string you can use command like this:&lt;br /&gt;
 cat &amp;lt;pub_key1&amp;gt; &amp;lt;pub_key2&amp;gt; ... &amp;lt;pub_keyN&amp;gt; | base64 | paste -s -d &amp;#039;\0&amp;#039; -&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SSHD&amp;#039;&amp;#039;&amp;#039; - if set to YES and SSH_PUBLIC_KEY is set, then sshd will be launched. The idea is that Virtual Router VMs will not need active maintenance thus sshd does not need to be on all the time. If SSH_PUBLIC_KEY is set keys will be installed for root regardless of whether SSHD is enabled or not. That way one can login on the console and launch sshd if required. Command is:&lt;br /&gt;
 rc-service sshd start&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OPENVPN&amp;#039;&amp;#039;&amp;#039; - controls whether OpenVPN should be started or not. If OPENVPN_CA_CERT, OPENVPN_SERVER_CERT and OPENVPN_SERVER_KEY are defined openvpn is configured but it is only launched if OPENVPN is set to YES. Please note that when image is instantiated and openvpn is configured it will take &amp;#039;&amp;#039;&amp;#039;several minutes&amp;#039;&amp;#039;&amp;#039;, depending on allocated CPU, to boot because VM is generating DH 2048 bit parameters file.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OPENVPN_CA_CERT&amp;#039;&amp;#039;&amp;#039; - single line, PEM formatted, base64 encoded, Certification Authority certificate. That is the certificate used to sign OPENVPN_SERVER_CERT and all client certificates. Use the following command to encode:&lt;br /&gt;
 cat ca.crt | base64 | paste -s -d &amp;#039;\0&amp;#039; -&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OPENVPN_SERVER_CERT&amp;#039;&amp;#039;&amp;#039; - single line, PEM formatted, base64 encoded, server certificate.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OPENVPN_SERVER_KEY&amp;#039;&amp;#039;&amp;#039; - single line, PEM formatted, base64 encoded, server key&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OPENVPN_TA_KEY&amp;#039;&amp;#039;&amp;#039; - optional but &amp;#039;&amp;#039;&amp;#039;highly recommended&amp;#039;&amp;#039;&amp;#039;, single line, PEM formatted, base64 encoded, pre-shared key to use with &amp;#039;&amp;#039;&amp;#039;--tls-auth&amp;#039;&amp;#039;&amp;#039;. This features adds &amp;quot;extra protection&amp;quot; to the TLS channel by requiring that incoming packets have a valid signature generated using the pre-shared key. &amp;#039;&amp;#039;&amp;#039;Key must be set on both server and client.&amp;#039;&amp;#039;&amp;#039; If this key is ever changed, it must be changed on all peers at the same time.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OPENVPN_REVOKED&amp;#039;&amp;#039;&amp;#039; - optional, single line, base64 encoded content of a file containing revoked certificates.&lt;br /&gt;
 &lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OPENVPN_INT_NET&amp;#039;&amp;#039;&amp;#039; - Network to be used for communication between the server and the clients. It has to be different from the internal OpenNebula network and client&amp;#039;s network. Is omitted it default to 10.255.255.0. OpenVPN allows user to maintain more than one tunnel at the same time. It is good idea to use different networks especially in the same client setup. That way one can have multiple tunnels opened at the same time if destination networks don&amp;#039;t overlap of course.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OPENVPN_INT_NETMASK&amp;#039;&amp;#039;&amp;#039; - Network mask for the network between the server and the clients. Defaults to 255.255.255.0. &amp;#039;&amp;#039;&amp;#039;Warning:&amp;#039;&amp;#039;&amp;#039; OpenVPN is very picky. It will complain and it will not start if netmask zeros out any bit from the network. For example: net 10.1.1.1 netmask 255.255.255.0 will not work. You need to use: net 10.1.1.0 netmask 255.255.255.0&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OPENVPN_MAX_CLIENTS&amp;#039;&amp;#039;&amp;#039; - Maximum number of simultaneously connected users. It defaults to 3. Tests showed that is a good number for the default size VM.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CipherSpace Virtual Router can be used as a bastion host to build ssh tunnels. This is controlled by the following context variables:&lt;br /&gt;
 &lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;TUNNEL_USER&amp;#039;&amp;#039;&amp;#039; - user name. &amp;#039;&amp;#039;&amp;#039;It must not exist.&amp;#039;&amp;#039;&amp;#039; If user exists it will not be reconfigured. That is to prevent messing up system users. User shell is set to /bin/false.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;TUNNEL_USER_SSH_PUBLIC_KEY&amp;#039;&amp;#039;&amp;#039; - single line, base64 encoded, list of keys to install in &amp;#039;&amp;#039;&amp;#039;authorized_keys&amp;#039;&amp;#039;&amp;#039; file. Since it can can be multi-line it has to be formatted the same way as SSH_PUBLIC_KEY.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;TUNNEL_USER_KEY_RESTRICTIONS&amp;#039;&amp;#039;&amp;#039; - optional string that goes before the key in authorized_keys file. Defaults to &amp;#039;&amp;#039;&amp;#039;&amp;quot;no-pty,no-agent-forwarding,no-X11-forwarding,no-user-rc&amp;quot;&amp;#039;&amp;#039;&amp;#039;. Even though user shell is set to /bin/false one must be careful what goes in this variable.&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=Contextualization_of_Linux_VMs&amp;diff=664</id>
		<title>Contextualization of Linux VMs</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=Contextualization_of_Linux_VMs&amp;diff=664"/>
		<updated>2017-04-24T13:26:22Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: /* Custom Vars */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OpenNebula]]&lt;br /&gt;
[[Category:How To]]&lt;br /&gt;
[[Category:CloudInfrastructure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OpenNebula uses a method called contextualization to send information to the VM at boot time. Information is collected in the Template and is essential to configure the VM.&lt;br /&gt;
&lt;br /&gt;
The VM template has a section called &amp;quot;&amp;#039;&amp;#039;&amp;#039;Context&amp;#039;&amp;#039;&amp;#039;&amp;quot; where you can automate different configuration aspects.&lt;br /&gt;
&lt;br /&gt;
The Context section has 3 parts:&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Configuration&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
 &lt;br /&gt;
[[File:Template-Configuration.png|768px]]&lt;br /&gt;
&lt;br /&gt;
This is the most basic context configuration provided by OpenNebula, where you can:&lt;br /&gt;
* Enable &amp;#039;&amp;#039;&amp;#039;Network&amp;#039;&amp;#039;&amp;#039; contextualization. The VM will be configured with the information added in the network section or in [[#Custom Vars|Custom Var]] section of the template.&lt;br /&gt;
* Enable &amp;#039;&amp;#039;&amp;#039;SSH&amp;#039;&amp;#039;&amp;#039; contextualization. Ssh service will be enabled.&lt;br /&gt;
* Add &amp;#039;&amp;#039;&amp;#039;SSH public keys&amp;#039;&amp;#039;&amp;#039;. Keys will be added to USERNAME authorized_keys file ([[#Custom Vars|See custom section]]) or to root in case USERNAME is not set.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;START_SCRIPT&amp;#039;&amp;#039;&amp;#039; -  Script which is executed when the machine starts up. It can contain either shell script or Shebang. For example START_SCRIPT=&amp;quot;yum upgrade&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Files&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
&lt;br /&gt;
[[File:Template-Files.png|768px]]&lt;br /&gt;
&lt;br /&gt;
In this section you can include files in your vm. Files can be added in OpenNebula in &amp;quot;Files&amp;quot; section in the left menu under &amp;quot;Images&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You can select files from the list and they will be automatically added in FILES_DS attribute.&lt;br /&gt;
&lt;br /&gt;
If the file is a script you want to run at boot you can add it INIT_SCRIPTS attribute.&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Custom Vars&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
&lt;br /&gt;
[[File:Template-CustomVars.png|768px]]&lt;br /&gt;
&lt;br /&gt;
In this section you can setup a more advanced contextualization, the attributes available are:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;VARIABLE&amp;#039;&amp;#039;&amp;#039; -  Variables that store values related to this virtual machine or others . The name of the variable is arbitrary (in the example, we use hostname).&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SET_HOSTNAME&amp;#039;&amp;#039;&amp;#039; -  This parameter value will be the hostname of the VM.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;DNS_HOSTNAME&amp;#039;&amp;#039;&amp;#039; -   	YES to set the VM hostname to the reverse dns name (from the first IP)&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;GATEWAY_IFACE&amp;#039;&amp;#039;&amp;#039; -  This variable can be set to the interface number you want to configure the gateway. It is useful when several networks have GATEWAY parameter and you want yo choose the one that configures it. For example to set the first interface to configure the gateway you use GATEWAY_IFACE=0&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;DNS&amp;#039;&amp;#039;&amp;#039; -  Specific DNS server for the Virtual Machine&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;USERNAME&amp;#039;&amp;#039;&amp;#039; -  User to be created in the guest OS. If any password attribute is defined (see below) it will change this user (defaults to root). &amp;#039;&amp;#039;&amp;#039;Please note:&amp;#039;&amp;#039;&amp;#039; SSH daemon on the host is configured to deny access to user &amp;#039;&amp;#039;&amp;#039;root&amp;#039;&amp;#039;&amp;#039; and it does not support password authentication. If you specify &amp;#039;&amp;#039;&amp;#039;USERNAME&amp;#039;&amp;#039;&amp;#039; such account will be created and any SSH keys you may have configured will be allowed to login as that user. If you use any of the context variables below then password will be set for the user too. If username is not root you will be able to SSH in using SSH key and you will be able to login on the VNC console but you will &amp;#039;&amp;#039;&amp;#039;not be able escalate your privileges&amp;#039;&amp;#039;&amp;#039; to root. If username is &amp;#039;&amp;#039;&amp;#039;root&amp;#039;&amp;#039;&amp;#039; or you do not use &amp;#039;&amp;#039;&amp;#039;USERNAME&amp;#039;&amp;#039;&amp;#039; then you will be able to login on the VNC console but you will not be able to SSH in. &amp;#039;&amp;#039;&amp;#039;Contextualization script always creates an user &amp;#039;&amp;#039;cloudUser&amp;#039;&amp;#039; which is allowed to login SSH using the keys you have configured in the template. Also cloudUser is allowed to elevate its privileges via sudo without password. the following command will make you root without password:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*: sudo -s&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CRYPTED_PASSWORD_BASE64&amp;#039;&amp;#039;&amp;#039; -  Crypted password encoded in base64. You can use the following command:&lt;br /&gt;
*: openssl passwd -1 | base64&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CRYPTED_PASSWORD&amp;#039;&amp;#039;&amp;#039; -  Crypted password. This parameter is not recommended, use CRYPTED_PASSWORD_BASE64 instead. You can use the following command:&lt;br /&gt;
*: openssl passwd -1&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;PASSWORD_BASE64&amp;#039;&amp;#039;&amp;#039; -  Clear text password encoded in base64. This parameter is not recommended, use CRYPTED_PASSWORD_BASE64 instead. Example command:&lt;br /&gt;
*: echo &amp;quot;Password&amp;quot; | base64&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;PASSWORD&amp;#039;&amp;#039;&amp;#039; -  Clear text password  to be set for the user USERNAME. This parameter is not recommended, use CRYPTED_PASSWORD_BASE64 instead.&lt;br /&gt;
&lt;br /&gt;
The following attributes are automatically filled up configuring the Network section of the template: &lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ETHx_MAC&amp;#039;&amp;#039;&amp;#039; -  Used to find the correct interface&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ETHx_IP&amp;#039;&amp;#039;&amp;#039; -  IPv4 address for the interface&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ETHx_IPV6&amp;#039;&amp;#039;&amp;#039; -  IPv6 address for the interface&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ETHx_NETWORK&amp;#039;&amp;#039;&amp;#039; -  Network address of the interface&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ETHx_MASK&amp;#039;&amp;#039;&amp;#039; -  Network mask&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ETHx_GATEWAY&amp;#039;&amp;#039;&amp;#039; -  Default IPv4 gateway for the interface&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ETHx_GATEWAY6&amp;#039;&amp;#039;&amp;#039; -  Default IPv6 gateway for the interface&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ETHx_MTU&amp;#039;&amp;#039;&amp;#039; -  MTU value for the interface&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ETHx_DNS&amp;#039;&amp;#039;&amp;#039; - DNS for the network&lt;br /&gt;
&lt;br /&gt;
These last attributes are also automatically filled up adding SSH public keys in the [[Contextualization_of_Linux_VMs#Configuration | Context Configuration Section]] of the template:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SSH_PUBLIC_KEY&amp;#039;&amp;#039;&amp;#039; -  Key to be added to USERNAME authorized_keys file or root in case USERNAME is not set.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;EC2_PUBLIC_KEY&amp;#039;&amp;#039;&amp;#039; - Same as SSH_PUBLIC_KEY&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=Contextualization_of_Linux_VMs&amp;diff=663</id>
		<title>Contextualization of Linux VMs</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=Contextualization_of_Linux_VMs&amp;diff=663"/>
		<updated>2017-04-24T13:25:23Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: /* Custom Vars */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OpenNebula]]&lt;br /&gt;
[[Category:How To]]&lt;br /&gt;
[[Category:CloudInfrastructure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OpenNebula uses a method called contextualization to send information to the VM at boot time. Information is collected in the Template and is essential to configure the VM.&lt;br /&gt;
&lt;br /&gt;
The VM template has a section called &amp;quot;&amp;#039;&amp;#039;&amp;#039;Context&amp;#039;&amp;#039;&amp;#039;&amp;quot; where you can automate different configuration aspects.&lt;br /&gt;
&lt;br /&gt;
The Context section has 3 parts:&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Configuration&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
 &lt;br /&gt;
[[File:Template-Configuration.png|768px]]&lt;br /&gt;
&lt;br /&gt;
This is the most basic context configuration provided by OpenNebula, where you can:&lt;br /&gt;
* Enable &amp;#039;&amp;#039;&amp;#039;Network&amp;#039;&amp;#039;&amp;#039; contextualization. The VM will be configured with the information added in the network section or in [[#Custom Vars|Custom Var]] section of the template.&lt;br /&gt;
* Enable &amp;#039;&amp;#039;&amp;#039;SSH&amp;#039;&amp;#039;&amp;#039; contextualization. Ssh service will be enabled.&lt;br /&gt;
* Add &amp;#039;&amp;#039;&amp;#039;SSH public keys&amp;#039;&amp;#039;&amp;#039;. Keys will be added to USERNAME authorized_keys file ([[#Custom Vars|See custom section]]) or to root in case USERNAME is not set.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;START_SCRIPT&amp;#039;&amp;#039;&amp;#039; -  Script which is executed when the machine starts up. It can contain either shell script or Shebang. For example START_SCRIPT=&amp;quot;yum upgrade&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Files&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
&lt;br /&gt;
[[File:Template-Files.png|768px]]&lt;br /&gt;
&lt;br /&gt;
In this section you can include files in your vm. Files can be added in OpenNebula in &amp;quot;Files&amp;quot; section in the left menu under &amp;quot;Images&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You can select files from the list and they will be automatically added in FILES_DS attribute.&lt;br /&gt;
&lt;br /&gt;
If the file is a script you want to run at boot you can add it INIT_SCRIPTS attribute.&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Custom Vars&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
&lt;br /&gt;
[[File:Template-CustomVars.png|768px]]&lt;br /&gt;
&lt;br /&gt;
In this section you can setup a more advanced contextualization, the attributes available are:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;VARIABLE&amp;#039;&amp;#039;&amp;#039; -  Variables that store values related to this virtual machine or others . The name of the variable is arbitrary (in the example, we use hostname).&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SET_HOSTNAME&amp;#039;&amp;#039;&amp;#039; -  This parameter value will be the hostname of the VM.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;DNS_HOSTNAME&amp;#039;&amp;#039;&amp;#039; -   	YES to set the VM hostname to the reverse dns name (from the first IP)&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;GATEWAY_IFACE&amp;#039;&amp;#039;&amp;#039; -  This variable can be set to the interface number you want to configure the gateway. It is useful when several networks have GATEWAY parameter and you want yo choose the one that configures it. For example to set the first interface to configure the gateway you use GATEWAY_IFACE=0&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;DNS&amp;#039;&amp;#039;&amp;#039; -  Specific DNS server for the Virtual Machine&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;USERNAME&amp;#039;&amp;#039;&amp;#039; -  User to be created in the guest OS. If any password attribute is defined (see below) it will change this user (defaults to root). &amp;#039;&amp;#039;&amp;#039;Please note:&amp;#039;&amp;#039;&amp;#039; SSH daemon on the host is configured to deny access to user &amp;#039;&amp;#039;&amp;#039;root&amp;#039;&amp;#039;&amp;#039; and it does not support password authentication. If you specify &amp;#039;&amp;#039;&amp;#039;USERNAME&amp;#039;&amp;#039;&amp;#039; such account will be created and any SSH keys you may have configured will be allowed to login as that user. If you use any of the context variables below then password will be set for the user too. If username is not root you will be able to SSH in using SSH key and you will be able to login on the VNC console but you will &amp;#039;&amp;#039;&amp;#039;not be able escalate your privileges&amp;#039;&amp;#039;&amp;#039; to root. If username is &amp;#039;&amp;#039;&amp;#039;root&amp;#039;&amp;#039;&amp;#039; or you do not use &amp;#039;&amp;#039;&amp;#039;USERNAME&amp;#039;&amp;#039;&amp;#039; then you will be able to login on the VNC console but you will not be able to SSH in. &amp;#039;&amp;#039;&amp;#039;Contextualization script always creates an user &amp;#039;&amp;#039;cloudUser&amp;#039;&amp;#039; which is allowed to login SSH using the keys you have configured in the template. Also cloudUser is allowed to elevate its privileges via sudo without password. the following command will make you root without password:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*: sudo -s&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CRYPTED_PASSWORD_BASE64&amp;#039;&amp;#039;&amp;#039; -  Crypted password encoded in base64. To be set for the user USERNAME. If not defined it will change root user. You can use the following command:&lt;br /&gt;
*: openssl passwd -1 | base64&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CRYPTED_PASSWORD&amp;#039;&amp;#039;&amp;#039; -  Crypted password. This parameter is not recommended, use CRYPTED_PASSWORD_BASE64 instead. You can use the following command:&lt;br /&gt;
*: openssl passwd -1&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;PASSWORD_BASE64&amp;#039;&amp;#039;&amp;#039; -  Clear text password encoded in base64. This parameter is not recommended, use CRYPTED_PASSWORD_BASE64 instead. Example command:&lt;br /&gt;
*: echo &amp;quot;Password&amp;quot; | base64&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;PASSWORD&amp;#039;&amp;#039;&amp;#039; -  Clear text password  to be set for the user USERNAME. This parameter is not recommended, use CRYPTED_PASSWORD_BASE64 instead.&lt;br /&gt;
&lt;br /&gt;
The following attributes are automatically filled up configuring the Network section of the template: &lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ETHx_MAC&amp;#039;&amp;#039;&amp;#039; -  Used to find the correct interface&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ETHx_IP&amp;#039;&amp;#039;&amp;#039; -  IPv4 address for the interface&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ETHx_IPV6&amp;#039;&amp;#039;&amp;#039; -  IPv6 address for the interface&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ETHx_NETWORK&amp;#039;&amp;#039;&amp;#039; -  Network address of the interface&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ETHx_MASK&amp;#039;&amp;#039;&amp;#039; -  Network mask&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ETHx_GATEWAY&amp;#039;&amp;#039;&amp;#039; -  Default IPv4 gateway for the interface&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ETHx_GATEWAY6&amp;#039;&amp;#039;&amp;#039; -  Default IPv6 gateway for the interface&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ETHx_MTU&amp;#039;&amp;#039;&amp;#039; -  MTU value for the interface&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ETHx_DNS&amp;#039;&amp;#039;&amp;#039; - DNS for the network&lt;br /&gt;
&lt;br /&gt;
These last attributes are also automatically filled up adding SSH public keys in the [[Contextualization_of_Linux_VMs#Configuration | Context Configuration Section]] of the template:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SSH_PUBLIC_KEY&amp;#039;&amp;#039;&amp;#039; -  Key to be added to USERNAME authorized_keys file or root in case USERNAME is not set.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;EC2_PUBLIC_KEY&amp;#039;&amp;#039;&amp;#039; - Same as SSH_PUBLIC_KEY&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=Contextualization_of_Linux_VMs&amp;diff=638</id>
		<title>Contextualization of Linux VMs</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=Contextualization_of_Linux_VMs&amp;diff=638"/>
		<updated>2017-04-21T08:50:46Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: /* Custom Vars */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OpenNebula]]&lt;br /&gt;
[[Category:How To]]&lt;br /&gt;
[[Category:CloudInfrastructure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OpenNebula uses a method called contextualization to send information to the VM at boot time. Information is collected in the Template and is essential to configure the VM.&lt;br /&gt;
&lt;br /&gt;
The VM template has a section called &amp;quot;&amp;#039;&amp;#039;&amp;#039;Context&amp;#039;&amp;#039;&amp;#039;&amp;quot; where you can automate different configuration aspects.&lt;br /&gt;
&lt;br /&gt;
The Context section has 3 parts:&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Configuration&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
 &lt;br /&gt;
[[File:Template-Configuration.png|768px]]&lt;br /&gt;
&lt;br /&gt;
This is the most basic context configuration provided by OpenNebula, where you can:&lt;br /&gt;
* Enable &amp;#039;&amp;#039;&amp;#039;Network&amp;#039;&amp;#039;&amp;#039; contextualization. The VM will be configured with the information added in the network section or in [[#Custom Vars|Custom Var]] section of the template.&lt;br /&gt;
* Enable &amp;#039;&amp;#039;&amp;#039;SSH&amp;#039;&amp;#039;&amp;#039; contextualization. Ssh service will be enabled.&lt;br /&gt;
* Add &amp;#039;&amp;#039;&amp;#039;SSH public keys&amp;#039;&amp;#039;&amp;#039;. Keys will be added to USERNAME authorized_keys file ([[#Custom Vars|See custom section]]) or to root in case USERNAME is not set.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;START_SCRIPT&amp;#039;&amp;#039;&amp;#039; -  Script which is executed when the machine starts up. It can contain either shell script or Shebang. For example START_SCRIPT=&amp;quot;yum upgrade&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Files&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
&lt;br /&gt;
[[File:Template-Files.png|768px]]&lt;br /&gt;
&lt;br /&gt;
In this section you can include files in your vm. Files can be added in OpenNebula in &amp;quot;Files&amp;quot; section in the left menu under &amp;quot;Images&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You can select files from the list and they will be automatically added in FILES_DS attribute.&lt;br /&gt;
&lt;br /&gt;
If the file is a script you want to run at boot you can add it INIT_SCRIPTS attribute.&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Custom Vars&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
&lt;br /&gt;
[[File:Template-CustomVars.png|768px]]&lt;br /&gt;
&lt;br /&gt;
In this section you can setup a more advanced contextualization, the attributes available are:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;VARIABLE&amp;#039;&amp;#039;&amp;#039; -  Variables that store values related to this virtual machine or others . The name of the variable is arbitrary (in the example, we use hostname).&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SET_HOSTNAME&amp;#039;&amp;#039;&amp;#039; -  This parameter value will be the hostname of the VM.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;DNS_HOSTNAME&amp;#039;&amp;#039;&amp;#039; -   	YES to set the VM hostname to the reverse dns name (from the first IP)&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;GATEWAY_IFACE&amp;#039;&amp;#039;&amp;#039; -  This variable can be set to the interface number you want to configure the gateway. It is useful when several networks have GATEWAY parameter and you want yo choose the one that configures it. For example to set the first interface to configure the gateway you use GATEWAY_IFACE=0&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;DNS&amp;#039;&amp;#039;&amp;#039; -  Specific DNS server for the Virtual Machine&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ETHx_MAC&amp;#039;&amp;#039;&amp;#039; -  Used to find the correct interface&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ETHx_IP&amp;#039;&amp;#039;&amp;#039; -  IPv4 address for the interface&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ETHx_IPV6&amp;#039;&amp;#039;&amp;#039; -  IPv6 address for the interface&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ETHx_NETWORK&amp;#039;&amp;#039;&amp;#039; -  Network address of the interface&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ETHx_MASK&amp;#039;&amp;#039;&amp;#039; -  Network mask&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ETHx_GATEWAY&amp;#039;&amp;#039;&amp;#039; -  Default IPv4 gateway for the interface&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ETHx_GATEWAY6&amp;#039;&amp;#039;&amp;#039; -  Default IPv6 gateway for the interface&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ETHx_MTU&amp;#039;&amp;#039;&amp;#039; -  MTU value for the interface&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ETHx_DNS&amp;#039;&amp;#039;&amp;#039; - DNS for the network&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;USERNAME&amp;#039;&amp;#039;&amp;#039; -  User to be created in the guest OS. If any password attribute is defined (see below) it will change this user (defaults to root). &amp;#039;&amp;#039;&amp;#039;Please note:&amp;#039;&amp;#039;&amp;#039; SSH daemon on the host is configured to deny access to user &amp;#039;&amp;#039;&amp;#039;root&amp;#039;&amp;#039;&amp;#039; and it does not support password authentication. If you specify &amp;#039;&amp;#039;&amp;#039;USERNAME&amp;#039;&amp;#039;&amp;#039; such account will be created and any SSH keys you may have configured will be allowed to login as that user. If you use any of the context variables below then password will be set for the user too. If username is not root you will be able to SSH in using SSH key and you will be able to login on the VNC console but you will &amp;#039;&amp;#039;&amp;#039;not be able escalate your privileges&amp;#039;&amp;#039;&amp;#039; to root. If username is &amp;#039;&amp;#039;&amp;#039;root&amp;#039;&amp;#039;&amp;#039; or you do not use &amp;#039;&amp;#039;&amp;#039;USERNAME&amp;#039;&amp;#039;&amp;#039; then you will be able to login on the VNC console but you will not be able to SSH in. &amp;#039;&amp;#039;&amp;#039;Contextualization script always creates an user &amp;#039;&amp;#039;cloudUser&amp;#039;&amp;#039; which is allowed to login SSH using the keys you have configured in the template. Also cloudUser is allowed to elevate its privileges via sudo without password. the following command will make you root without password:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*: sudo -s&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CRYPTED_PASSWORD_BASE64&amp;#039;&amp;#039;&amp;#039; -  Crypted password encoded in base64. To be set for the user USERNAME. If not defined it will change root user. You can use the following command:&lt;br /&gt;
*: openssl passwd -1 | base64&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;PASSWORD_BASE64&amp;#039;&amp;#039;&amp;#039; -  Password encoded in base64. To be set for the user USERNAME.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CRYPTED_PASSWORD&amp;#039;&amp;#039;&amp;#039; -  Crypted password. To be set for the user USERNAME. This parameter is not recommended, use CRYPTED_PASSWORD_BASE64 instead. You can use the following command:&lt;br /&gt;
*: openssl passwd -1&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;PASSWORD&amp;#039;&amp;#039;&amp;#039; -  Password to be set for the user USERNAME. This parameter is not recommended, use PASSWORD_BASE64 instead.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SSH_PUBLIC_KEY&amp;#039;&amp;#039;&amp;#039; -  Key to be added to USERNAME authorized_keys file or root in case USERNAME is not set.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;EC2_PUBLIC_KEY&amp;#039;&amp;#039;&amp;#039; - Same as SSH_PUBLIC_KEY&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=MediaWiki:Aboutsite&amp;diff=637</id>
		<title>MediaWiki:Aboutsite</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=MediaWiki:Aboutsite&amp;diff=637"/>
		<updated>2017-03-28T07:36:50Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: Created blank page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=MediaWiki:Privacy&amp;diff=636</id>
		<title>MediaWiki:Privacy</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=MediaWiki:Privacy&amp;diff=636"/>
		<updated>2017-03-28T07:36:19Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: Created blank page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=CipherSpace_Client_Wiki:About&amp;diff=635</id>
		<title>CipherSpace Client Wiki:About</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=CipherSpace_Client_Wiki:About&amp;diff=635"/>
		<updated>2017-03-28T07:34:29Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the CipherSpace Client Wiki. It is a repository of information for our clients documenting the services we provide.&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=CipherSpace_Client_Wiki:About&amp;diff=634</id>
		<title>CipherSpace Client Wiki:About</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=CipherSpace_Client_Wiki:About&amp;diff=634"/>
		<updated>2017-03-28T07:34:17Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: Blanked the page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=MediaWiki:About&amp;diff=633</id>
		<title>MediaWiki:About</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=MediaWiki:About&amp;diff=633"/>
		<updated>2017-03-28T07:33:57Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;About&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=MediaWiki:About&amp;diff=632</id>
		<title>MediaWiki:About</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=MediaWiki:About&amp;diff=632"/>
		<updated>2017-03-28T07:32:56Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: Created blank page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=MediaWiki:Disclaimers&amp;diff=631</id>
		<title>MediaWiki:Disclaimers</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=MediaWiki:Disclaimers&amp;diff=631"/>
		<updated>2017-03-28T07:32:28Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: Created blank page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=OpenNebula_Templates&amp;diff=414</id>
		<title>OpenNebula Templates</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=OpenNebula_Templates&amp;diff=414"/>
		<updated>2016-10-05T09:29:27Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OpenNebula]]&lt;br /&gt;
[[Category:How To]]&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Create a new Template==&lt;br /&gt;
#[[OpenNebula_Administrative_Functions | Log into OpenNebula Sunstone]].&lt;br /&gt;
#Go to “Virtual Resources” in the left menu and click on “Templates” in the drop down menu. &lt;br /&gt;
#:[[File:Templates_menu.png|thumb|none|upright=0.5]]&lt;br /&gt;
#:&amp;lt;br&amp;gt;&lt;br /&gt;
#Click on the &amp;quot;+&amp;quot; button to create a new template. See below.&lt;br /&gt;
#Click &amp;quot;Create&amp;quot; button.&lt;br /&gt;
===Configure Template===&lt;br /&gt;
The basic procedure is as follows:&lt;br /&gt;
* Add a template name in &amp;quot;General&amp;quot; menu.&lt;br /&gt;
[[File:Template_name.png|thumb|none|upright=2]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* In &amp;quot;Storage&amp;quot; tab, choose a storage disk. If your template requires more disks, click on &amp;quot;Add another disk&amp;quot; and select it accordingly.&lt;br /&gt;
[[File:Template_storage.png|thumb|none|upright=2.5]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* In &amp;quot;Network&amp;quot; tab, select a Virtual Network, which the instantiated virtual machine(s) will be connected to. If your template requires more network interfaces, click on &amp;quot;Add another nic&amp;quot; and select it accordingly.&lt;br /&gt;
[[File:Template_interface.png|thumb|none|upright=2.5]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* If a fixed ip address is required, click on &amp;quot;Advanced Option&amp;quot; button and type the fixed address in the &amp;quot;IP&amp;quot; field.&lt;br /&gt;
[[File:Template_adv_net_opt.png|thumb|none|upright=2.0]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* In &amp;quot;Input/Output&amp;quot; menu, select &amp;quot;VNC&amp;quot; Graphics and tick &amp;quot;Generate Random Password&amp;quot;. &lt;br /&gt;
[[File:Template_vnc.png|thumb|none|upright=1.5]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* In &amp;quot;Context&amp;quot; menu, add SSH keys in the &amp;quot;Public Key&amp;quot; field and make sure that &amp;quot;Add SSH contextualization&amp;quot; and &amp;quot;Add Network contextualization&amp;quot; are ticked.&lt;br /&gt;
[[File:Template_context.png|thumb|none|upright=2.5]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* In &amp;quot;Context&amp;quot; menu, you can define a root password under &amp;quot;Custom Vars&amp;quot;. Add the following entries: KEY= ROOT_PASSWORD, VALUE= &amp;quot;password&amp;quot; and press &amp;quot;Add&amp;quot; button.&lt;br /&gt;
[[File:Template_rootpwd.png|thumb|none|upright=2.5]]&lt;br /&gt;
&lt;br /&gt;
==Update a Template==&lt;br /&gt;
#[[OpenNebula_Administrative_Functions | Log into OpenNebula Sunstone]].&lt;br /&gt;
#Go to “Virtual Resources” in the left menu and click on “Templates” in the drop down menu. &lt;br /&gt;
#:[[File:Templates_menu.png|thumb|none|upright=0.5]]&lt;br /&gt;
#:&amp;lt;br&amp;gt;&lt;br /&gt;
#Click on the template and press &amp;quot;Update&amp;quot; button.&lt;br /&gt;
#Make the necessary changes and press the green &amp;quot;Update&amp;quot; button to save.&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=CipherSpace_Virtual_Router&amp;diff=413</id>
		<title>CipherSpace Virtual Router</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=CipherSpace_Virtual_Router&amp;diff=413"/>
		<updated>2016-10-05T09:26:59Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OpenNebula]]&lt;br /&gt;
[[Category:How To]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;CipherSpace Virtual Router&amp;#039;&amp;#039;&amp;#039; is based on &amp;#039;&amp;#039;&amp;#039;OpenNebula Virtual Router&amp;#039;&amp;#039;&amp;#039; (http://docs.opennebula.org/4.8/administration/networking/router.html) with some modifications plus OpenVPN. It is meant to be used as:&lt;br /&gt;
* Router (masquerade)&lt;br /&gt;
* DHCP server&lt;br /&gt;
* DNS server&lt;br /&gt;
* RADVD server&lt;br /&gt;
* Port forwarding server&lt;br /&gt;
* Bastion host for SSH tunnels&lt;br /&gt;
* OpenVPN server&lt;br /&gt;
&lt;br /&gt;
CipherSpace Virtual Router allows using VMs which are not contextualized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CipherSpace-VirtualRouter-Diagram.png|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The virtual router image is non-persistent and takes its entire configuration from the contextualization script. Default VM size is 256MB RAM, 0.5 CPU and 1 vCPU. &lt;br /&gt;
You can install it from the Appmarket.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color: red&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;When using DHCP or OpenVPN make sure IP spoofing and MAC spoofing protections are turned off for the internal network.&amp;#039;&amp;#039;&amp;#039;&amp;lt;/span&amp;gt; Otherwise it will not work.&lt;br /&gt;
&lt;br /&gt;
== Virtual Router Configuration ==&lt;br /&gt;
Following configurations can be added in the virtual router template in &amp;quot;Context&amp;quot; menu under &amp;quot;Custom Vars&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The virtual router can be configured with 1 or 2 network interfaces. With 1 network interface it can be used only as &amp;#039;&amp;#039;&amp;#039;DHCP&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;RADVD&amp;#039;&amp;#039;&amp;#039; server. &lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;TEMPLATE&amp;#039;&amp;#039;&amp;#039; - this is &amp;#039;&amp;#039;&amp;#039;required&amp;#039;&amp;#039;&amp;#039;. Otherwise most of the other functionality will not work. Usage:&lt;br /&gt;
 TEMPLATE   = &amp;quot;$TEMPLATE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;PRIVNET&amp;#039;&amp;#039;&amp;#039; - private network. For example:&lt;br /&gt;
 PRIVNET = &amp;quot;$NETWORK[TEMPLATE, NETWORK=\&amp;quot;&amp;lt;private_network_name&amp;gt;\&amp;quot;]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;PUBNET&amp;#039;&amp;#039;&amp;#039; - public network. For example:&lt;br /&gt;
 PUBNET = &amp;quot;$NETWORK[TEMPLATE, NETWORK=\&amp;quot;&amp;lt;public_network_name&amp;gt;\&amp;quot;]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;RADVD&amp;#039;&amp;#039;&amp;#039; - enables or disabled RADVD server. Possible values are &amp;#039;&amp;#039;&amp;#039;YES&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;NO&amp;#039;&amp;#039;&amp;#039;. For example&lt;br /&gt;
 RADVD = &amp;quot;NO&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;DHCP&amp;#039;&amp;#039;&amp;#039; - enables or disabled DHCP server. Possible values are &amp;#039;&amp;#039;&amp;#039;YES&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;NO&amp;#039;&amp;#039;&amp;#039;. For example&lt;br /&gt;
 DHCP = &amp;quot;YES&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;DNS&amp;#039;&amp;#039;&amp;#039; - list of DNS servers to use in DHCP leases. If not specified DHCP server will use VMs private network IP address. For example:&lt;br /&gt;
 DNS = &amp;quot;10.1.1.1 10.2.2.2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SEARCH&amp;#039;&amp;#039;&amp;#039; - DNS search option. For example:&lt;br /&gt;
 SEARCH = &amp;quot;zh4.cipherspace.net&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;NTP_SERVER&amp;#039;&amp;#039;&amp;#039; - IP of the NTP server. The DHCP server will be configured to serve the NTP parameter to its leases. For example:&lt;br /&gt;
 NTP_SERVER = &amp;quot;10.0.0.10&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FORWARDING&amp;#039;&amp;#039;&amp;#039; -  list of forwarding rules separated by spaces. Syntax:&lt;br /&gt;
 [[protocol:]route_port:]destination:vm_port&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;protocol&amp;#039;&amp;#039;&amp;#039; is not validated but it only makes sense to use &amp;#039;&amp;#039;&amp;#039;tcp&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;udp&amp;#039;&amp;#039;&amp;#039;.Default is &amp;#039;&amp;#039;&amp;#039;tcp&amp;#039;&amp;#039;&amp;#039;. If &amp;#039;&amp;#039;&amp;#039;router_port&amp;#039;&amp;#039;&amp;#039; is omitted too then port &amp;#039;&amp;#039;&amp;#039;vm_port&amp;#039;&amp;#039;&amp;#039; on the router will be forwarded to &amp;#039;&amp;#039;&amp;#039;vm_port&amp;#039;&amp;#039;&amp;#039; on the VM. For example:&lt;br /&gt;
 FORWARDING = &amp;quot;udp:8888:10.0.0.10:53 8080:10.0.0.10:80 10.0.0.10:22&amp;quot;&lt;br /&gt;
{|&lt;br /&gt;
|style=&amp;quot;text-align:right;&amp;quot;|&amp;lt;code lang=&amp;quot;text&amp;quot;&amp;gt;udp:8888:10.0.0.10:53&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;padding-left: 15px&amp;quot;|Forward UDP port 8888 on the router to port 53 on 10.0.0.10.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:right;&amp;quot;|&amp;lt;code lang=&amp;quot;text&amp;quot;&amp;gt;8080:10.0.0.10:80&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;padding-left: 15px&amp;quot;|Forward TCP port 8080 on the router to port 80 on 10.0.0.10.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:right;&amp;quot;|&amp;lt;code lang=&amp;quot;text&amp;quot;&amp;gt;10.0.0.10:22&amp;lt;/code&amp;gt;&lt;br /&gt;
|style=&amp;quot;padding-left: 15px&amp;quot;|Forward TCP port 22 the router to port 22 on 10.0.0.10.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ROOT_PASSWORD&amp;#039;&amp;#039;&amp;#039; - base64 encoded &amp;#039;&amp;#039;&amp;#039;root&amp;#039;&amp;#039;&amp;#039; password hash. For example one can use the following command:&lt;br /&gt;
 openssl passwd -1 | base64&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SSH_PUBLIC_KEY&amp;#039;&amp;#039;&amp;#039; - single line, base64 encoded list of SSH keys to be set as &amp;#039;&amp;#039;&amp;#039;root&amp;#039;s authorized_keys&amp;#039;&amp;#039;&amp;#039;. That is the &amp;#039;&amp;#039;&amp;#039;Public key&amp;#039;&amp;#039;&amp;#039; field in &amp;#039;&amp;#039;&amp;#039;Context&amp;#039;&amp;#039;&amp;#039;-&amp;gt;&amp;#039;&amp;#039;&amp;#039;Network &amp;amp; SSH&amp;#039;&amp;#039;&amp;#039;. This is not a custom field. The way scripts are implemented they cannot parse parameters which contain &amp;#039;new line&amp;#039; character. Because of that CipherSpace Virtual Router expects the value of SSH_PUBLIC_KEY to be a single base64 encoded string. That way we can pass multiple SSH keys. To generate the string you can use command like this:&lt;br /&gt;
 cat &amp;lt;pub_key1&amp;gt; &amp;lt;pub_key2&amp;gt; ... &amp;lt;pub_keyN&amp;gt; | base64 | paste -s -d &amp;#039;\0&amp;#039; -&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SSHD&amp;#039;&amp;#039;&amp;#039; - if set to YES and SSH_PUBLIC_KEY is set, then sshd will be launched. The idea is that Virtual Router VMs will not need active maintenance thus sshd does not need to be on all the time. If SSH_PUBLIC_KEY is set keys will be installed for root regardless of whether SSHD is enabled or not. That way one can login on the console and launch sshd if required. Command for Apline Linux is:&lt;br /&gt;
 rc-service sshd start&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OPENVPN&amp;#039;&amp;#039;&amp;#039; - controls whether OpenVPN should be started or not. If OPENVPN_CA_CERT, OPENVPN_SERVER_CERT and OPENVPN_SERVER_KEY are defined openvpn is configured but it is only launched if OPENVPN is set to YES. Please note that when image is instantiated and openvpn is configured it will take &amp;#039;&amp;#039;&amp;#039;several minutes&amp;#039;&amp;#039;&amp;#039;, depending on allocated CPU, to boot because VM is generating DH 2048 bit parameters file.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OPENVPN_CA_CERT&amp;#039;&amp;#039;&amp;#039; - single line, PEM formatted, base64 encoded, Certification Authority certificate. That is the certificate used to sign OPENVPN_SERVER_CERT and all client certificates. Use the following command to encode:&lt;br /&gt;
 cat ca.crt | base64 | paste -s -d &amp;#039;\0&amp;#039; -&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OPENVPN_SERVER_CERT&amp;#039;&amp;#039;&amp;#039; - single line, PEM formatted, base64 encoded, server certificate.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OPENVPN_SERVER_KEY&amp;#039;&amp;#039;&amp;#039; - single line, PEM formatted, base64 encoded, server key&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OPENVPN_TA_KEY&amp;#039;&amp;#039;&amp;#039; - optional but &amp;#039;&amp;#039;&amp;#039;highly recommended&amp;#039;&amp;#039;&amp;#039;, single line, PEM formatted, base64 encoded, preshared key to use with &amp;#039;&amp;#039;&amp;#039;--tls-auth&amp;#039;&amp;#039;&amp;#039;. This features adds &amp;quot;extra protection&amp;quot; to the TLS channel by requiring that incoming packets have a valid signature generated using the PSK key. &amp;#039;&amp;#039;&amp;#039;Key must be set on both server and client.&amp;#039;&amp;#039;&amp;#039; If this key is ever changed, it must be changed on all peers at the same time.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OPENVPN_REVOKED&amp;#039;&amp;#039;&amp;#039; - optional, single line, base64 encoded content of a file containing revoked certificates.&lt;br /&gt;
 &lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OPENVPN_INT_NET&amp;#039;&amp;#039;&amp;#039; - Network to be used for communication between the server and the clients. It has to be different from the internal OpenNebula network and client&amp;#039;s network. Is omitted it default to 10.255.255.0. It is good idea to use different networks especially in one client setup. That way one can have multiple tunnels at the same time if destination networks don&amp;#039;t overlap of course.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OPENVPN_INT_NETMASK&amp;#039;&amp;#039;&amp;#039; - Network mask for the network between the server and the clients. Defaults to 255.255.255.0. &amp;#039;&amp;#039;&amp;#039;Warning:&amp;#039;&amp;#039;&amp;#039; OpenVPN is very picky. It will complain and it will not start if netmask zeros out any bit from the network. For example: net 10.1.1.1 netmask 255.255.255.0 will not work. One needs to use: net 10.1.1.0 netmask 255.255.255.0&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OPENVPN_MAX_CLIENTS&amp;#039;&amp;#039;&amp;#039; - Maximum number of simultaneously connected users. It defaults to 3. Tests showed that is a good number for the default size VM.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CipherSpace Virtual Router can be used as a bastion host to build ssh tunnels. This is controlled by the following context variables:&lt;br /&gt;
 &lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;TUNNEL_USER&amp;#039;&amp;#039;&amp;#039; - user name. &amp;#039;&amp;#039;&amp;#039;It must not exist.&amp;#039;&amp;#039;&amp;#039; If user exists it will not be reconfigured. That is to prevent messing up system users. User shell is set to /bin/false.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;TUNNEL_USER_SSH_PUBLIC_KEY&amp;#039;&amp;#039;&amp;#039; - single line, base64 encoded, list of keys to install in &amp;#039;&amp;#039;&amp;#039;authorized_keys&amp;#039;&amp;#039;&amp;#039; file. Since it can can be multi-line it has to be formatted the same way as SSH_PUBLIC_KEY.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;TUNNEL_USER_KEY_RESTRICTIONS&amp;#039;&amp;#039;&amp;#039; - optional string that goes before the key in authorized_keys file. Defaults to &amp;#039;&amp;#039;&amp;#039;&amp;quot;no-pty,no-agent-forwarding,no-X11-forwarding,no-user-rc&amp;quot;&amp;#039;&amp;#039;&amp;#039;. Even though user shell is set to /bin/false one must be careful what goes in this variable.&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=How_To_Manage_OpenNebula_Virtual_Machines&amp;diff=412</id>
		<title>How To Manage OpenNebula Virtual Machines</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=How_To_Manage_OpenNebula_Virtual_Machines&amp;diff=412"/>
		<updated>2016-10-05T09:25:29Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OpenNebula]]&lt;br /&gt;
[[Category:How To]]&lt;br /&gt;
==Look at running Virtual Machines==&lt;br /&gt;
&lt;br /&gt;
#[[OpenNebula_Administrative_Functions | Log into OpenNebula Sunstone]].&lt;br /&gt;
#Go to “Virtual Resources” in the left menu and click on “Virtual Machines” in the drop down menu.&lt;br /&gt;
#:[[File:VM_menu.png|thumb|none|upright=0.5]]&lt;br /&gt;
#:&amp;lt;br&amp;gt;&lt;br /&gt;
#:A list of all instantiated virtual machines will apear. Some basic information is showed.&lt;br /&gt;
#:[[File:vm_list.png|thumb|none|upright=2.5]]&lt;br /&gt;
#:&amp;lt;br&amp;gt;&lt;br /&gt;
#:Click on a virtual machine to see all its configuration.&lt;br /&gt;
#:[[File:vm_detail.png|thumb|none|upright=2.5]]&lt;br /&gt;
&lt;br /&gt;
==Open VNC console==&lt;br /&gt;
#[[OpenNebula_Administrative_Functions | Log into OpenNebula Sunstone]].&lt;br /&gt;
#Go to “Virtual Resources” in the left menu and click on “Virtual Machines” in the drop down menu.&lt;br /&gt;
#:[[File:VM_menu.png|thumb|none|upright=0.5]]&lt;br /&gt;
#:&amp;lt;br&amp;gt;&lt;br /&gt;
#Select the virtual machine you want to access and click on the &amp;quot;VNC&amp;quot; button.&lt;br /&gt;
#:[[File:vnc_button.png|thumb|none|upright=1]]&lt;br /&gt;
#:&amp;lt;br&amp;gt;&lt;br /&gt;
#:A flyout will appear with the virtual machine console. To move the console in a separate browser window or tab press [[File:expand_button.png|20px]] button.&lt;br /&gt;
#:[[File:vnc_view.png|thumb|none|900px]]&lt;br /&gt;
&lt;br /&gt;
==Instantiate a Virtual Machine==&lt;br /&gt;
&lt;br /&gt;
#Go to “Virtual Resources” in the left menu and click on “Templates” in the drop down menu. &lt;br /&gt;
#:[[File:Templates_menu.png|thumb|none|upright=0.5]]&lt;br /&gt;
#[[OpenNebula_Templates | Create or modify a template]]. This template will then be used to instantiate a virtual machine on which the operative system will be install.&lt;br /&gt;
#Click on the template just created and press &amp;quot;Instantiate&amp;quot; button to power on the virtual machine.&lt;br /&gt;
#:[[File:vm_instantiate.png|thumb|none|upright=1.2]]&lt;br /&gt;
&lt;br /&gt;
==Terminate Virtual Machine Instances==&lt;br /&gt;
You can terminate a running instance with the following operations:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;shutdown&amp;#039;&amp;#039;&amp;#039;: Gracefully shuts down a running VM, sending the ACPI signal. Once the VM is shut down, the host is cleaned, and persistent disk(s) will be moved to the associated datastore. If after a given time the VM is still running (e.g. guest ignoring ACPI signals), OpenNebula will return the VM to the RUNNING state.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;shutdown --hard&amp;#039;&amp;#039;&amp;#039;: Same as above but the VM is immediately destroyed. Use this action instead of shutdown when the VM doesn’t have ACPI support.&lt;br /&gt;
&lt;br /&gt;
If you need to terminate an instance in any state use:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;delete&amp;#039;&amp;#039;&amp;#039;: The VM is immediately destroyed no matter its state. Hosts are cleaned as needed but no images are moved to the repository, leaving then in error. Think of delete as &amp;quot;kill -9&amp;quot; for a process, an so it should be only used when the VM is not responding to other actions.&lt;br /&gt;
&lt;br /&gt;
All the above operations free the resources used by the VM.&lt;br /&gt;
===Shutdown===&lt;br /&gt;
#[[OpenNebula_Administrative_Functions | Log into OpenNebula Sunstone]].&lt;br /&gt;
#Go to “Virtual Resources” in the left menu and click on “Virtual Machines” in the drop down menu.&lt;br /&gt;
#:[[File:VM_menu.png|thumb|none|upright=0.5]]&lt;br /&gt;
#:&amp;lt;br&amp;gt;&lt;br /&gt;
#Click on the virtual machine, press the red button with the bin and click &amp;quot;Shutdown&amp;quot;.&lt;br /&gt;
#:[[File:vm_shutdown.png|thumb|none|upright=1.5]]&lt;br /&gt;
#:If more than one virtual machine need to be shut down, select each of them, press the red button with the bin and click &amp;quot;Shutdown&amp;quot;.&lt;br /&gt;
#:[[File:vm_multishutdown.png|thumb|none|upright=2.5]]&lt;br /&gt;
===Shutdown Hard===&lt;br /&gt;
#[[OpenNebula_Administrative_Functions | Log into OpenNebula Sunstone]].&lt;br /&gt;
#Go to “Virtual Resources” in the left menu and click on “Virtual Machines” in the drop down menu.&lt;br /&gt;
#:[[File:VM_menu.png|thumb|none|upright=0.5]]&lt;br /&gt;
#:&amp;lt;br&amp;gt;&lt;br /&gt;
#Click on the virtual machine, press the red button with the bin and click &amp;quot;Shutdown hard&amp;quot;.&lt;br /&gt;
#:[[File:vm_shutdown_hard.png|thumb|none|upright=1.5]]&lt;br /&gt;
#:If more than one virtual machine need to be shut down, select each of them, press the red button with the bin and click &amp;quot;Shutdown Hard&amp;quot;.&lt;br /&gt;
#:[[File:vm_multishutdown_hard.png|thumb|none|upright=2.5]]&lt;br /&gt;
===Delete===&lt;br /&gt;
#[[OpenNebula_Administrative_Functions | Log into OpenNebula Sunstone]].&lt;br /&gt;
#Go to “Virtual Resources” in the left menu and click on “Virtual Machines” in the drop down menu.&lt;br /&gt;
#:[[File:VM_menu.png|thumb|none|upright=0.5]]&lt;br /&gt;
#:&amp;lt;br&amp;gt;&lt;br /&gt;
#Click on the virtual machine, press the red button with the bin and click &amp;quot;Delete&amp;quot;.&lt;br /&gt;
#:[[File:vm_delete.png|thumb|none|upright=1.5]]&lt;br /&gt;
#:If more than one virtual machine need to be shut down, select each of them, press the red button with the bin and click &amp;quot;Delete&amp;quot;.&lt;br /&gt;
#:[[File:vm_multidelete.png|thumb|none|upright=2.5]]&lt;br /&gt;
&lt;br /&gt;
==Pause Virtual Machine Instances==&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;Be aware that VMs, which are in some of the states below, may still occupy resources even though they are not actually running. Those resources will be accounted for and, based on your subscription plan, can be charged to you.&amp;#039;&amp;#039;&amp;#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are two different ways to temporarily stop the execution of a VM: short and long term pauses. A short term pause keeps all the VM resources allocated to the hosts so its resume its operation in the same hosts quickly. Use the following actions:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;suspend&amp;#039;&amp;#039;&amp;#039;: the VM state is saved in the running Host. When a suspended VM is resumed, it is immediately deployed in the same Host by restoring its saved state.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;poweroff&amp;#039;&amp;#039;&amp;#039;: Gracefully powers off a running VM by sending the ACPI signal. It is similar to suspend but without saving the VM state. When the VM is resumed it will boot immediately in the same Host.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;poweroff --hard&amp;#039;&amp;#039;&amp;#039;: Same as above but the VM is immediately powered off. Use this action when the VM doesn’t have ACPI support.&lt;br /&gt;
&lt;br /&gt;
You can also plan a long term pause. The Host resources used by the VM are freed and the Host is cleaned. Any needed disk is saved in the system datastore. The following actions are useful if you want to preserve network and storage allocations (e.g. IPs, persistent disk images):&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;undeploy&amp;#039;&amp;#039;&amp;#039;: Gracefully shuts down a running VM, sending the ACPI signal. The Virtual Machine disks are transferred back to the system datastore. When an undeployed VM is resumed, it is be moved to the pending state, and the scheduler will choose where to re-deploy it.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;undeploy --hard&amp;#039;&amp;#039;&amp;#039;: Same as above but the running VM is immediately destroyed.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;stop&amp;#039;&amp;#039;&amp;#039;: Same as undeploy but also the VM state is saved to later resume it.&lt;br /&gt;
&lt;br /&gt;
When the VM is successfully paused you can resume its execution with:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;resume&amp;#039;&amp;#039;&amp;#039;: Resumes the execution of VMs in the stopped, suspended, undeployed and poweroff states.&lt;br /&gt;
===Suspend===&lt;br /&gt;
#[[OpenNebula_Administrative_Functions | Log into OpenNebula Sunstone]].&lt;br /&gt;
#Go to “Virtual Resources” in the left menu and click “Virtual Machines” in the drop down menu.&lt;br /&gt;
#:[[File:VM_menu.png|thumb|none|upright=0.5]]&lt;br /&gt;
#Click on the virtual machine, press the hold button and click &amp;quot;Suspend&amp;quot;.&lt;br /&gt;
#:[[File:vm_suspend.png|thumb|none|upright=1.5]]&lt;br /&gt;
#:If more than one virtual machine need to be suspended, select each of them, press the hold button and click &amp;quot;Suspend&amp;quot;.&lt;br /&gt;
#:[[File:Vm_multisuspend.png|thumb|none|upright=2.5]]&lt;br /&gt;
===Poweroff===&lt;br /&gt;
#[[OpenNebula_Administrative_Functions | Log into OpenNebula Sunstone]].&lt;br /&gt;
#Go to “Virtual Resources” in the left menu and click “Virtual Machines” in the drop down menu.&lt;br /&gt;
#:[[File:VM_menu.png|thumb|none|upright=0.5]]&lt;br /&gt;
#Click on the virtual machine, press the hold button and click &amp;quot;Poweroff&amp;quot;.&lt;br /&gt;
#:[[File:vm_poweroff.png|thumb|none|upright=1.5]]&lt;br /&gt;
#:If more than one virtual machine need to be powered off, select each of them, press the hold button and click &amp;quot;Poweroff&amp;quot;.&lt;br /&gt;
#:[[File:Vm_multipoweroff.png|thumb|none|upright=2.5]]&lt;br /&gt;
===Poweroff Hard===&lt;br /&gt;
#[[OpenNebula_Administrative_Functions | Log into OpenNebula Sunstone]].&lt;br /&gt;
#Go to “Virtual Resources” in the left menu and click “Virtual Machines” in the drop down menu.&lt;br /&gt;
#:[[File:VM_menu.png|thumb|none|upright=0.5]]&lt;br /&gt;
#Click on the virtual machine, press the hold button and click &amp;quot;Poweroff Hard&amp;quot;.&lt;br /&gt;
#:[[File:vm_poweroff_hard.png|thumb|none|upright=1.5]]&lt;br /&gt;
#:If more than one virtual machine need to be powered off hard, select each of them, press the hold button and click &amp;quot;Poweroff Hard&amp;quot;.&lt;br /&gt;
#:[[File:Vm_multipoweroff_hard.png|thumb|none|upright=2.5]]&lt;br /&gt;
===Undeploy===&lt;br /&gt;
#[[OpenNebula_Administrative_Functions | Log into OpenNebula Sunstone]].&lt;br /&gt;
#Go to “Virtual Resources” in the left menu and click “Virtual Machines” in the drop down menu.&lt;br /&gt;
#:[[File:VM_menu.png|thumb|none|upright=0.5]]&lt;br /&gt;
#Click on the virtual machine, press the stop button and click &amp;quot;Undeploy&amp;quot;.&lt;br /&gt;
#:[[File:vm_undeploy.png|thumb|none|upright=1.5]]&lt;br /&gt;
#:If more than one virtual machine need to be undeployed, select each of them, press the stop button and click &amp;quot;Undeploy&amp;quot;.&lt;br /&gt;
#:[[File:Vm_multiundeploy.png|thumb|none|upright=2.5]]&lt;br /&gt;
===Undeploy Hard===&lt;br /&gt;
#[[OpenNebula_Administrative_Functions | Log into OpenNebula Sunstone]].&lt;br /&gt;
#Go to “Virtual Resources” in the left menu and click “Virtual Machines” in the drop down menu.&lt;br /&gt;
#:[[File:VM_menu.png|thumb|none|upright=0.5]]&lt;br /&gt;
#Click on the virtual machine, press the stop button and click &amp;quot;Undeploy Hard&amp;quot;.&lt;br /&gt;
#:[[File:vm_undeploy_hard.png|thumb|none|upright=1.5]]&lt;br /&gt;
#:If more than one virtual machine need to be undeployed hard, select each of them, press the stop button and click &amp;quot;Undeploy Hard&amp;quot;.&lt;br /&gt;
#:[[File:Vm_multiundeploy_hard.png|thumb|none|upright=2.5]]&lt;br /&gt;
===Stop===&lt;br /&gt;
#[[OpenNebula_Administrative_Functions | Log into OpenNebula Sunstone]].&lt;br /&gt;
#Go to “Virtual Resources” in the left menu and click “Virtual Machines” in the drop down menu.&lt;br /&gt;
#:[[File:VM_menu.png|thumb|none|upright=0.5]]&lt;br /&gt;
#Click on the virtual machine, press the stop button and click &amp;quot;Stop&amp;quot;.&lt;br /&gt;
#:[[File:vm_stop.png|thumb|none|upright=1.5]]&lt;br /&gt;
#:If more than one virtual machine need to be stopped, select each of them, press the stop button and click &amp;quot;Stop&amp;quot;.&lt;br /&gt;
#:[[File:Vm_multistop.png|thumb|none|upright=2.5]]&lt;br /&gt;
===Resume===&lt;br /&gt;
#[[OpenNebula_Administrative_Functions | Log into OpenNebula Sunstone]].&lt;br /&gt;
#Go to “Virtual Resources” in the left menu and click “Virtual Machines” in the drop down menu.&lt;br /&gt;
#:[[File:VM_menu.png|thumb|none|upright=0.5]]&lt;br /&gt;
#Click on the virtual machine, press the play button to resume.&lt;br /&gt;
#:[[File:vm_resume.png|thumb|none|upright=1]]&lt;br /&gt;
#:If more than one virtual machine need to be resumed, select each of them, press the play button to resume.&lt;br /&gt;
#:[[File:Vm_multiresume.png|thumb|none|upright=2.5]]&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=How_To_Use_OpenNebula_AppMarket&amp;diff=323</id>
		<title>How To Use OpenNebula AppMarket</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=How_To_Use_OpenNebula_AppMarket&amp;diff=323"/>
		<updated>2016-09-22T06:01:18Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OpenNebula]]&lt;br /&gt;
[[Category:How To]]&lt;br /&gt;
&lt;br /&gt;
1. Open OpenNebula Sunstone and [[OpenNebula_Administrative_Functions | login]].&lt;br /&gt;
&lt;br /&gt;
2. Go to “AppMarket” in the left menu and click “Appliances” in the drop down menu.&lt;br /&gt;
&lt;br /&gt;
A list of all available appliances will appear.&lt;br /&gt;
[[File:appmarket page.png|thumb|none|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Every appliance contains an image and an example template. Click on one appliance to view more details.&lt;br /&gt;
[[File:Appmarket_info.png|thumb|none|upright=3.0]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. To import an appliance, select it and click “Import” button.&lt;br /&gt;
[[File:appmarket select.png|thumb|none|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A flyout will appear asking for a new image and new template name. &amp;#039;&amp;#039;&amp;#039;It is very important to change the proposed image and template names otherwise import may fail because image or a template with the same name may already exist.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
[[File:appmarket_import.png|thumb|none|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Go to “Virtual Resources” in the left menu to see the image and the template just imported. &amp;#039;&amp;#039;&amp;#039;Remember to [[How To Create OpenNebula Template | adjust]] the template to your preferences before instantiating a new virtual machine.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
[[File:appmarket_templates.png|thumb|none|900px]]&lt;br /&gt;
[[File:Appmarket_images.png|thumb|none|900px]]&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=How_To_Create_a_New_Disk_Image_in_OpenNebula&amp;diff=322</id>
		<title>How To Create a New Disk Image in OpenNebula</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=How_To_Create_a_New_Disk_Image_in_OpenNebula&amp;diff=322"/>
		<updated>2016-09-20T08:40:05Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OpenNebula]]&lt;br /&gt;
[[Category:How To]]&lt;br /&gt;
1.[[OpenNebula_Administrative_Functions | Log into OpenNebula Sunstone]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Go to “Virtual Resources” in the left menu and click on “Images” in the drop down menu.&lt;br /&gt;
[[File:Img_menu.png|thumb|none|upright=0.5]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Click the &amp;quot;+&amp;quot; button to add a new image.&lt;br /&gt;
&lt;br /&gt;
[[File:Add_img_options.png|thumb|none|upright=2.5]]&lt;br /&gt;
&lt;br /&gt;
The following parameters must be specified:&lt;br /&gt;
* Name = &amp;quot;your image name&amp;quot;&lt;br /&gt;
* Type = DATABLOCK&lt;br /&gt;
* Tick Persistent&lt;br /&gt;
* Set Image Location to Empty datablock&lt;br /&gt;
* Size = &amp;quot;your required space in MB&amp;quot;&lt;br /&gt;
* FS type = qcow2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Open &amp;quot;Advanced Options&amp;quot;.&lt;br /&gt;
[[File:New_img_advanced_options.png|thumb|none|upright=2]]&lt;br /&gt;
&lt;br /&gt;
Fill in the following fields:&lt;br /&gt;
* Device Prefix = vd&lt;br /&gt;
* Driver = qcow2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Click on the &amp;quot;Create&amp;quot; button.&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=How_To_Use_OpenNebula_AppMarket&amp;diff=320</id>
		<title>How To Use OpenNebula AppMarket</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=How_To_Use_OpenNebula_AppMarket&amp;diff=320"/>
		<updated>2016-09-20T08:39:31Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OpenNebula]]&lt;br /&gt;
[[Category:How To]]&lt;br /&gt;
&lt;br /&gt;
1. Open OpenNebula Sunstone and [[OpenNebula_Administrative_Functions | login]].&lt;br /&gt;
&lt;br /&gt;
2. Go to “AppMarket” in the left menu and click “Appliances” in the drop down menu.&lt;br /&gt;
&lt;br /&gt;
A list of all available appliances will appear.&lt;br /&gt;
[[File:appmarket page.png|thumb|none|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Every appliance contains an Image and a default Template. Click on one appliance to view more details.&lt;br /&gt;
[[File:Appmarket_info.png|thumb|none|upright=3.0]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. To import an appliance, select it and click “Import” button.&lt;br /&gt;
[[File:appmarket select.png|thumb|none|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A flyout will appear asking for a new Image and Template name. &amp;#039;&amp;#039;&amp;#039;It is very important to change the proposed Image and Template names.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
[[File:appmarket_import.png|thumb|none|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Go to “Virtual Resources” in the left menu to see the Image and the Template just imported. Remember to personalize the template before instantiating a new virtual machine.&lt;br /&gt;
[[File:appmarket_templates.png|thumb|none|900px]]&lt;br /&gt;
[[File:Appmarket_images.png|thumb|none|900px]]&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=OpenNebula_Administrative_Functions&amp;diff=319</id>
		<title>OpenNebula Administrative Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=OpenNebula_Administrative_Functions&amp;diff=319"/>
		<updated>2016-09-20T08:39:09Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OpenNebula]]&lt;br /&gt;
[[Category:How To]]&lt;br /&gt;
== Log into OpenNebula ==&lt;br /&gt;
&lt;br /&gt;
As a CipherSpace vDC customer, you have received a website address as well as your username and temporary password.&lt;br /&gt;
&lt;br /&gt;
Type in your browser the website address. You should see the following screen:&lt;br /&gt;
&lt;br /&gt;
[[File:one_admin_log1.png|240px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Type in your username and password and click on “Login”:&lt;br /&gt;
&lt;br /&gt;
[[File:one_admin_log2.png|240px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will then arrive on the Dashboard screen, from where you will then be able to access the various OpenNebula functions.&lt;br /&gt;
&lt;br /&gt;
[[File:one_admin_log3.png|border|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Password Change ==&lt;br /&gt;
&lt;br /&gt;
To change your temporary password, click on your username at the top-right of the dashboard screen:&lt;br /&gt;
&lt;br /&gt;
[[File:one_admin_pwch1.png|border|240px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And then click on “Settings”:&lt;br /&gt;
&lt;br /&gt;
[[File:one_admin_pwch2.png|border|240px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Configuration screen appears:&lt;br /&gt;
&lt;br /&gt;
[[File:one_admin_pwch3.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on “Update password”:&lt;br /&gt;
&lt;br /&gt;
[[File:one_admin_pwch4.png|border|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Update Password screen appears:&lt;br /&gt;
&lt;br /&gt;
[[File:one_admin_pwch5.png|border|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Type and confirm your new password and click on “Change”. You can now log in using your new password.&lt;br /&gt;
&lt;br /&gt;
== View Change ==&lt;br /&gt;
&lt;br /&gt;
A vDC user has access to two different user interfaces: the “User” view and the “Cloud” view. The “User” view allows the user to access the more advanced functionalities of OpenNebula. The “Cloud” view is a simplified user interface, which allows a user to deploy virtual machines (VMs) and to monitor and manage the running VMs as well as other limited functionalities.&lt;br /&gt;
&lt;br /&gt;
To change to the “Cloud” view, start from the “Configuration” Screen (see [[#Password Change|Password Change]]) and click on “Conf”:&lt;br /&gt;
&lt;br /&gt;
[[File:one_admin_viewch1.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on “Views:” and select the “cloud” view:&lt;br /&gt;
&lt;br /&gt;
[[File:one_admin_viewch2.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And then click on “Update config”. You are now in the cloud view:&lt;br /&gt;
&lt;br /&gt;
[[File:one_admin_viewch3.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To go back to the “User” view, click on your username at the top-right of the screen:&lt;br /&gt;
&lt;br /&gt;
[[File:one_admin_viewch4.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then click on “Change view”:&lt;br /&gt;
&lt;br /&gt;
[[File:one_admin_viewch5.png|border|450px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on “cloud”, then select “user” and finish by clicking on “Update view”. You are now back to the “User” view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== View Quotas ==&lt;br /&gt;
&lt;br /&gt;
You can see how much of your vDC is used either on the Dashboard under Quotas:&lt;br /&gt;
&lt;br /&gt;
[[File:one_admin_vq1.png|border|630px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or in the Configuration screen by clicking on “Quotas” and then clicking on “Group Quotas”:&lt;br /&gt;
&lt;br /&gt;
[[File:one_admin_vq2.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Accounting ==&lt;br /&gt;
&lt;br /&gt;
You can see how many resources you have been using the “Accounting” function. You can access it either from the Dashboard (under the “Quotas” information) or in the Configuration screen by clicking on “Accounting”:&lt;br /&gt;
&lt;br /&gt;
[[File:one_admin_acc1.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Select a time period and click on “Get Accounting”. A similar screen appears with the corresponding information.&lt;br /&gt;
&lt;br /&gt;
[[File:one_admin_acc2.png|border|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By clicking on “Accounting Tables”, you can see your data in tabular form.&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=How_To_Build_New_OpenNebula_Image_Using_ISO_file&amp;diff=318</id>
		<title>How To Build New OpenNebula Image Using ISO file</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=How_To_Build_New_OpenNebula_Image_Using_ISO_file&amp;diff=318"/>
		<updated>2016-09-20T08:38:15Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OpenNebula]]&lt;br /&gt;
[[Category:How To]]&lt;br /&gt;
1. You can use an existing ISO image or you can [[How_To_Upload_ISOs_On_OpenNebula | upload a new one]].&lt;br /&gt;
&lt;br /&gt;
2. [[How_To_Create_OpenNebula_Datablock | Create an empty disk image where the operating system will be installed]].&lt;br /&gt;
&lt;br /&gt;
3. [[OpenNebula_Templates | Create or modify a template]]. This template will then be used to instantiate a virtual machine on which the operating system will be install.&lt;br /&gt;
&lt;br /&gt;
* Add the ISO image and the empty image in &amp;quot;Storage&amp;quot; menu&lt;br /&gt;
* Configure the boot order in the template in &amp;quot;OS Booting&amp;quot; menu, choosing the ISO image (CDROM) as first option&lt;br /&gt;
[[File:template_bootorder.png|thumb|none|upright=2]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Click on the template just created and press &amp;quot;Instantiate&amp;quot; button to power on the virtual machine.&lt;br /&gt;
[[File:vm_instantiate.png|thumb|none|upright=1.2]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Install the operating system. &lt;br /&gt;
Once the operating system is installed, [[How_To_Manage_OpenNebula_Virtual_Machines#Shutdown_a_Virtual_Machine | shutdown]] the virtual machine.&lt;br /&gt;
&lt;br /&gt;
6. Go to “Virtual Resources” in the left menu, click on “Images” in the drop down menu and select the disk image on which you installed the operating system.&lt;br /&gt;
&lt;br /&gt;
7. Click on the [[File:Img_changetype.png|50px]] icon next to the &amp;quot;type&amp;quot; field and modify the image type from &amp;quot;DATABLOCK&amp;quot; to &amp;quot;OS&amp;quot;.&lt;br /&gt;
[[File:img_toos.png|thumb|none|upright=1.5]]&lt;br /&gt;
&lt;br /&gt;
8. Go to “Virtual Resources” in the left menu, click on “Templates” in the drop down menu and select the template used to instantiate the virtual machine.&lt;br /&gt;
* Remove the uploaded ISO file  in &amp;quot;Storage&amp;quot; menu&lt;br /&gt;
* &amp;quot;OS Booting&amp;quot; menu change &amp;quot;1st boot&amp;quot; to nothing.&lt;br /&gt;
[[File:Template_afterinstall.png|thumb|none|upright=2]]&lt;br /&gt;
&lt;br /&gt;
Now you can use this template to instantiate a VM.&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=How_To_Upload_ISOs_On_OpenNebula&amp;diff=317</id>
		<title>How To Upload ISOs On OpenNebula</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=How_To_Upload_ISOs_On_OpenNebula&amp;diff=317"/>
		<updated>2016-09-20T08:25:05Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OpenNebula]]&lt;br /&gt;
[[Category:How To]]&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Upload an ISO using an URL==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.[[OpenNebula_Administrative_Functions | Log into OpenNebula Sunstone]].&lt;br /&gt;
&lt;br /&gt;
2. Go to “Virtual Resources” in the left menu and click on “Images” in the drop down menu. &lt;br /&gt;
[[File:Img_menu.png|thumb|none|upright=0.5]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Click on the &amp;quot;+&amp;quot; button to add a new image. &lt;br /&gt;
&lt;br /&gt;
[[File:Add_iso_path_options.png|thumb|none|upright=2.5]]&lt;br /&gt;
&lt;br /&gt;
The following parameters must be specified:&lt;br /&gt;
* Name = &amp;quot;your image name&amp;quot;&lt;br /&gt;
* Type = CDROM&lt;br /&gt;
* Set Image Location to &amp;quot;Provide a path&amp;quot;&lt;br /&gt;
* Path = &amp;quot;The URL of the ISO image&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Open &amp;quot;Advanced Options&amp;quot;.&lt;br /&gt;
[[File:New_img_advanced_options.png|thumb|none|upright=2]]&lt;br /&gt;
Fill in the following fields:&lt;br /&gt;
* Device Prefix = vd&lt;br /&gt;
* Driver = qcow2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Click &amp;quot;Create&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Upload a local ISO image==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.[[OpenNebula_Administrative_Functions | Log into OpenNebula Sunstone]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Go to “Virtual Resources” in the left menu and click on “Images” in the drop down menu. &lt;br /&gt;
[[File:Img_menu.png|thumb|none|upright=0.5]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Click on the &amp;quot;+&amp;quot; button to add a new image. &lt;br /&gt;
[[File:Add_iso_upload_options.png|thumb|none|upright=2.5]]&lt;br /&gt;
The following parameters must be specified:&lt;br /&gt;
* Name = &amp;quot;your image name&amp;quot;&lt;br /&gt;
* Type = CDROM&lt;br /&gt;
* Set Image Location to &amp;quot;Upload&amp;quot;&lt;br /&gt;
* Click &amp;quot;Browse..&amp;quot; button and select the image on your local PC&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Open &amp;quot;Advanced Options&amp;quot;.&lt;br /&gt;
[[File:New_img_advanced_options.png|thumb|none|upright=2]]&lt;br /&gt;
Fill in the following fields:&lt;br /&gt;
* Device Prefix = vd&lt;br /&gt;
* Driver = qcow2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Click &amp;quot;Create&amp;quot; button.&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=OpenNebula_Attach_Additional_Storage_To_A_Virtual_Machine&amp;diff=316</id>
		<title>OpenNebula Attach Additional Storage To A Virtual Machine</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=OpenNebula_Attach_Additional_Storage_To_A_Virtual_Machine&amp;diff=316"/>
		<updated>2016-09-20T08:03:24Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OpenNebula]]&lt;br /&gt;
[[Category:How To]]&lt;br /&gt;
&lt;br /&gt;
#[[OpenNebula_Administrative_Functions | Log into OpenNebula Sunstone]].&lt;br /&gt;
# You can attach and existing disk image or [[How To Create a New Disk Image in OpenNebula | you can create a new one.]]&lt;br /&gt;
# Go to “Virtual Resources” in the left menu and click on “Virtual Machines” in the drop down menu.&lt;br /&gt;
#:[[File:VM_menu.png|thumb|none|upright=0.5]]&lt;br /&gt;
#: &amp;lt;br&amp;gt;&lt;br /&gt;
# Click on the virtual machine you need to add the storage and go to &amp;quot;Storage&amp;quot; menu.&lt;br /&gt;
#:[[File:vm_storage_menu.png|thumb|none|upright=2.5]]&lt;br /&gt;
#: &amp;lt;br&amp;gt;&lt;br /&gt;
# Click on the &amp;quot;Attach Disk&amp;quot; button. A flyout will appear where you can select the image you want to attach. &lt;br /&gt;
#:[[File:vm_attach_disk.png|thumb|none|upright=2.5]]&lt;br /&gt;
#: &amp;lt;br&amp;gt;&lt;br /&gt;
# Click on &amp;quot;Advanced Option&amp;quot; and select &amp;quot;none&amp;quot; as cache option.&lt;br /&gt;
#:&amp;#039;&amp;#039;&amp;#039;Warning: without that option VM cannot be live migrated. In case the server it is running on needs to be taken out for maintenance your and will have to be shutdown.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
#:[[File:Attach_cache.png|thumb|none|upright=1.5]]&lt;br /&gt;
#: &amp;lt;br&amp;gt;&lt;br /&gt;
# Click on the &amp;quot;Attach&amp;quot; button to add the storage to the Virtual Machine.&lt;br /&gt;
#: &amp;lt;br&amp;gt;&lt;br /&gt;
# If you want to have the storage attached to the virtual machine next time it is instantiated, you must update the machine&amp;#039;s template accordingly. See [[OpenNebula_Templates#Configure Template| Configure Template]].&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=How_To_Create_OpenNebula_Datablock&amp;diff=315</id>
		<title>How To Create OpenNebula Datablock</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=How_To_Create_OpenNebula_Datablock&amp;diff=315"/>
		<updated>2016-09-20T07:47:49Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: Stoyan moved page How To Create OpenNebula Datablock to How To Create a New Disk Image in OpenNebula&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[How To Create a New Disk Image in OpenNebula]]&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=How_To_Create_a_New_Disk_Image_in_OpenNebula&amp;diff=314</id>
		<title>How To Create a New Disk Image in OpenNebula</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=How_To_Create_a_New_Disk_Image_in_OpenNebula&amp;diff=314"/>
		<updated>2016-09-20T07:47:49Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: Stoyan moved page How To Create OpenNebula Datablock to How To Create a New Disk Image in OpenNebula&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
1.[[OpenNebula_Administrative_Functions | Log into OpenNebula Sunstone]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Go to “Virtual Resources” in the left menu and click on “Images” in the drop down menu.&lt;br /&gt;
[[File:Img_menu.png|thumb|none|upright=0.5]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Click the &amp;quot;+&amp;quot; button to add a new image.&lt;br /&gt;
&lt;br /&gt;
[[File:Add_img_options.png|thumb|none|upright=2.5]]&lt;br /&gt;
&lt;br /&gt;
The following parameters must be specified:&lt;br /&gt;
* Name = &amp;quot;your image name&amp;quot;&lt;br /&gt;
* Type = DATABLOCK&lt;br /&gt;
* Tick Persistent&lt;br /&gt;
* Set Image Location to Empty datablock&lt;br /&gt;
* Size = &amp;quot;your required space in MB&amp;quot;&lt;br /&gt;
* FS type = qcow2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Open &amp;quot;Advanced Options&amp;quot;.&lt;br /&gt;
[[File:New_img_advanced_options.png|thumb|none|upright=2]]&lt;br /&gt;
&lt;br /&gt;
Fill in the following fields:&lt;br /&gt;
* Device Prefix = vd&lt;br /&gt;
* Driver = qcow2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Click on the &amp;quot;Create&amp;quot; button.&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
	<entry>
		<id>https://wiki.cipherspace.com/index.php?title=How_To_Use_OpenNebula_AppMarket&amp;diff=313</id>
		<title>How To Use OpenNebula AppMarket</title>
		<link rel="alternate" type="text/html" href="https://wiki.cipherspace.com/index.php?title=How_To_Use_OpenNebula_AppMarket&amp;diff=313"/>
		<updated>2016-09-20T07:25:57Z</updated>

		<summary type="html">&lt;p&gt;Stoyan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
1. Open OpenNebula Sunstone and [[OpenNebula_Administrative_Functions | login]].&lt;br /&gt;
&lt;br /&gt;
2. Go to “AppMarket” in the left menu and click “Appliances” in the drop down menu.&lt;br /&gt;
&lt;br /&gt;
A list of all available appliances will appear.&lt;br /&gt;
[[File:appmarket page.png|thumb|none|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Every appliance contains an Image and a default Template. Click on one appliance to view more details.&lt;br /&gt;
[[File:Appmarket_info.png|thumb|none|upright=3.0]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. To import an appliance, select it and click “Import” button.&lt;br /&gt;
[[File:appmarket select.png|thumb|none|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A flyout will appear asking for a new Image and Template name. &amp;#039;&amp;#039;&amp;#039;It is very important to change the proposed Image and Template names.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
[[File:appmarket_import.png|thumb|none|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Go to “Virtual Resources” in the left menu to see the Image and the Template just imported. Remember to personalize the template before instantiating a new virtual machine.&lt;br /&gt;
[[File:appmarket_templates.png|thumb|none|900px]]&lt;br /&gt;
[[File:Appmarket_images.png|thumb|none|900px]]&lt;/div&gt;</summary>
		<author><name>Stoyan</name></author>
	</entry>
</feed>