The information defined at the VM Template building time is presented to the VM using the VMware VMCI channel. This information comes encoded in base64 and can be gathered using the VMware Tools.
VMware tools are needed in the guestOS to enable several features (contextualization and networking feedback). Please install VMware Tools (for Windows) or Open Virtual Machine Tools (for *nix) in the guestOS.
In order to make your VMs aware of OpenNebula, you must install the official packages. Packages for both Linux and Windows exist that can collect this data and configure the supported parameters.
In Linux guests, the information can be consumed using the following command:
$ vmtoolsd --cmd 'info-get guestinfo.opennebula.context' | base64 -d MYSQLPASSWORD = 'MyPassword' ENABLEWORDPRESS = 'YES'
Step 1. Start a VM with the OS you want to Customize¶
Supported contextualization packages are available for the following OS’s:
- CentOS/RHEL >= 6
- Debian >= 6
- Ubuntu >= 11.10
- Windows >= 7
- Windows Server >= 2008
If you already happen to have a VM or Template in vCenter with the installed OS you can start it and prepare it to be used with vOneCloud. Alternatively you can start an installation process with the OS media.
Step 2. Download Contextualization Packages to the VM¶
# wget https://github.com/OpenNebula/addon-context-linux/releases/download/v5.0.3/one-context_5.0.3.rpm
# wget https://github.com/OpenNebula/addon-context-linux/releases/download/v5.0.3/one-context_5.0.3.deb
Download and install the MSI package (preferred way) into
Or download particular contextualization scripts to
Step 3. Install Contextualization Packages and Dependencies¶
# rpm -Uvh one-context*rpm # yum install -y epel-release # yum install ruby # only needed for onegate command # yum install -i dracut-modules-growroot # dracut -f
# rpm -Uvh one-context*rpm # yum install -y epel-release # yum install ruby # only needed for onegate command # yum install -y cloud-utils-growpart
# dpkg -i one-context*deb # apt-get install ruby # only needed for onegate command # apt-get install -y cloud-utils
- Open the Local Group Policy Dialog by running
- Go to Computer Configuration -> Windows Settings -> Scripts -> startup (right click).
- Browse to the
startup.vbsfile and enable it as a startup script.
Step 4. Install VMware Tools¶
# yum install open-vm-tools
# apt-get install open-vm-tools
In vCenter open the VM menu, go to “Guest OS” section, click in “Install VMware Tools...” and follow the instructions.
Step 5. Power Off the Machine and Save it¶
These are the steps needed to finish the preparation and import it to OpenNebula:
- Power off the machine so it is in a consistent state the next time it boots
- Make sure that you take out any installation media used in the previous steps
- Remove the network interfaces from the VM
- Convert the VM into a Template
- Import the template in OpenNebula
Alternatively use the instantiate as persistent functionality for this step, that will create the new VM Template as soon as you terminate the VM.