vCenter customization wizard for CentOS

0 Flares Twitter 0 Facebook 0 LinkedIn 0 Email -- 0 Flares ×

Customazion Wizard is a really cool feature in vCenter, but I often found many customers not using it, mainly because they do not even know it exists, or because they had a weak knowledge about how to use it. This is even more true if the template is a linux VM. On CentOS, the main problem comes from Network Manager and its non-friendly management of ethernet connection: since it identifies ethernet cards by mac address, everytime you clone a VM a new network interface is created, with a different and randomly generated mac address. Previous configuration get lost, and Network Manager is not able to find eth0.

Usually, people ends up updating by hand network configurations everytime a new VM is deployed, thus wasting the benefits of automatic deploys. However, once you know some little tricks that needs to be applied, even deploying CentOS VMs from templates and automatically customizing it, can become an easy task.

First, you obviously need to prepare the template. Install CentOS as you would do for a standard VM, add all the packages you want, and remember to install also VMware Tools. Just before powering it down, delete these two files:

This will ensure the new VM will not have any reference to the previous MAC address used while creating the template.

Then, you have to “cheat” vCenter: customization wizard does not supports CentOS, but it does support RedHat. So, simply edit the VM settings and configure the VM as a RedHat 6 64bit VM.

Next, convert the VM into a template.

Create a new customization wizard, choosing linux as type. Use your preferred configuration settings and save the Customization.

You are now ready to deploy a new VM: select the template you created and choose to deploy a new VM from this template. At the customization tab, choose to customize the new VM using an existing customization (the one you created before…).

 

Depending on how many parameters you already configured into the Customization, the wizard is going to ask you for the remaining ones. Set every parameter and finish the wizard itself. My wizard for example uses the VM name as hostname inside linux, and asks me only for the IP address, while subnet, gateway and DNS servers and even time zone are all pre-configured.

Then, let vCenter finish the deployment of the new VM. After it has finished, you will see directly in the summary of the VM, it is using the TCP parameters you configured:

 

and also inside the Guest OS, everything is working as expected:

 

 

 

The chosen IP address has been assigned to the “new” eth0 network interface, all the network parameters has been correctly configured, and the hostname has been configured from the VM name itself.