Difference between revisions of "Contextualization of Windows VMs"
(→Files) |
|||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
[[Category:OpenNebula]] | [[Category:OpenNebula]] | ||
[[Category:How To]] | [[Category:How To]] | ||
[[Category:CloudInfrastructure]] | |||
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. | 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. | ||
The VM template has a section called | The VM template has a section called "'''Context'''" where you can automate different configuration aspects. | ||
Context section has 3 parts: | The Context section has 3 parts: | ||
==='''''Configuration'''''=== | ==='''''Configuration'''''=== | ||
[[File:Template-Configuration.png]] | [[File:Template-Configuration.png|768px]] | ||
This is the most basic context configuration | This is the most basic context configuration provided by OpenNebula, where you can: | ||
* Enable ''' | * Enable '''Network''' contextualization. The VM will be configured with the information added in the network section or in [[#Custom Vars|Custom Var]] section of the template. | ||
* Add '''SSH public keys'''. Keys will be added to USERNAME authorized_keys file or root in case USERNAME is not set. | * Enable '''SSH''' contextualization. Ssh service will be enabled. | ||
* '''START_SCRIPT''' - | * Add '''SSH public keys'''. Keys will be added to USERNAME authorized_keys file ([[#Custom Vars|See custom section]]) or to root in case USERNAME is not set. | ||
* '''START_SCRIPT''' - Script which is executed when the machine starts up. It can contain either shell script or Shebang. For example START_SCRIPT="yum upgrade". | |||
==='''''Files'''''=== | ==='''''Files'''''=== | ||
[[File:Template-Files.png]] | [[File:Template-Files.png|768px]] | ||
In this section you can include files in your vm. Files can be added in OpenNebula in "Files" section in the left menu under "Images". | |||
You can select files from the list and they will be automatically added in FILES_DS attribute. | |||
If the file is a script you want to run at boot you can add it INIT_SCRIPTS attribute. | |||
==='''''Custom Vars'''''=== | ==='''''Custom Vars'''''=== | ||
Line 42: | Line 38: | ||
* '''SET_HOSTNAME''' - This parameter value will be the hostname of the VM. | * '''SET_HOSTNAME''' - This parameter value will be the hostname of the VM. | ||
* '''USERNAME''' - User to be created in the guest OS. If any password attribute is defined (see below) it will change this user (defaults to root). | |||
* '''PASSWORD''' - Password to be set for the user USERNAME. This parameter is not recommended, use PASSWORD_BASE64 instead. | |||
* '''PASSWORD_BASE64''' - Password encoded in base64. To be set for the user USERNAME. | |||
The following attributes are automatically filled up configuring the network section of the template: | |||
* '''ETHx_MAC''' - Used to find the correct interface | * '''ETHx_MAC''' - Used to find the correct interface | ||
Line 54: | Line 58: | ||
* '''ETHx_DNS''' - DNS for the network | * '''ETHx_DNS''' - DNS for the network | ||
Latest revision as of 13:02, 21 April 2017
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.
The VM template has a section called "Context" where you can automate different configuration aspects.
The Context section has 3 parts:
Configuration
This is the most basic context configuration provided by OpenNebula, where you can:
- Enable Network contextualization. The VM will be configured with the information added in the network section or in Custom Var section of the template.
- Enable SSH contextualization. Ssh service will be enabled.
- Add SSH public keys. Keys will be added to USERNAME authorized_keys file (See custom section) or to root in case USERNAME is not set.
- START_SCRIPT - Script which is executed when the machine starts up. It can contain either shell script or Shebang. For example START_SCRIPT="yum upgrade".
Files
In this section you can include files in your vm. Files can be added in OpenNebula in "Files" section in the left menu under "Images".
You can select files from the list and they will be automatically added in FILES_DS attribute.
If the file is a script you want to run at boot you can add it INIT_SCRIPTS attribute.
Custom Vars
In this section you can setup a more advanced contextualization, the attributes available are:
- VARIABLE - Variables that store values related to this virtual machine or others . The name of the variable is arbitrary (in the example, we use hostname).
- SET_HOSTNAME - This parameter value will be the hostname of the VM.
- USERNAME - User to be created in the guest OS. If any password attribute is defined (see below) it will change this user (defaults to root).
- PASSWORD - Password to be set for the user USERNAME. This parameter is not recommended, use PASSWORD_BASE64 instead.
- PASSWORD_BASE64 - Password encoded in base64. To be set for the user USERNAME.
The following attributes are automatically filled up configuring the network section of the template:
- ETHx_MAC - Used to find the correct interface
- ETHx_IP - IPv4 address for the interface
- ETHx_NETWORK - Network address of the interface
- ETHx_MASK - Network mask
- ETHx_GATEWAY - Default IPv4 gateway for the interface
- ETHx_DNS - DNS for the network