Difference between revisions of "Contextualization of Windows VMs"
(→Files) |
(→Files) |
||
Line 23: | Line 23: | ||
You can select files you want to include from the list and they will be automatically added in FILES_DS attribute. | You can select files you want to include from the list and they will be automatically added in FILES_DS attribute. | ||
Also you can define a space-separated list of scripts that will run at boot, using INIT_SCRIPTS attribute. | Also you can define a space-separated list of scripts that will run at boot, using INIT_SCRIPTS attribute. | ||
Files can be added in "Files" section in the left menu under "Images". | |||
[[File:Images-Files.png|thumb|none|upright=0.5]] | |||
Revision as of 14:05, 9 March 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.
Context section has 3 parts:
Configuration
This is the most basic context configuration, provided by OpenNebula, where you can:
- Enable SSH and Network contextualization
- Add SSH public keys. Keys will be added to USERNAME authorized_keys file or root in case USERNAME is not set.
- START_SCRIPT - Text of the script executed when the machine starts up. It can contain shebang in case it is not shell script. For example START_SCRIPT="yum upgrade".
Files
You can select files you want to include from the list and they will be automatically added in FILES_DS attribute.
Also you can define a space-separated list of scripts that will run at boot, using INIT_SCRIPTS attribute.
Files can be added in "Files" section in the left menu under "Images".
Make sure that context.ps1 has been selected.
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.
- 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
- 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_BASE64 - Password encoded in base64. To be set for the user USERNAME.
- PASSWORD - Password to be set for the user USERNAME. This parameter is not recommended, use PASSWORD_BASE64 instead.