In this article by Konstantin Kuminsky author of the book, VMware vCenter Cookbook, we will review some options and features available in vCenter to improve an administrator's efficiency.
(For more resources related to this topic, see here.)
Scripted installation is an alternative way to deploy ESXi hosts. It can be used when several hosts need to be deployed or upgraded.
The installation script contains ESXi settings and can be accessed by a host during the ESXi boot from the following locations:
The following sections describe the process of creating an installation script and using it to boot the ESXi host.
An installation script contains installation options for ESXi. It's a text file with the .cfg extension.
The best way to create an installation script is to use the default script supplied with the ESXi installer and modify it. The default script is located in the /etc/vmware/weasel/ folder location and is called ks.cfg.
Commands that can be modified include, but are not limited to:
A full list of installation and upgrade commands can be found in the vSphere5 documentation on the VMware website at https://www.vmware.com/support/pubs/.
In order to use the installation script, you will need to use additional ESXi boot options.
ks=<location of the script> <additional boot options>
The valid locations are as follows:
The additional options available are as follows:
For example, for the HTTP location, the command will look like this:
ks=http://XX.XX.XX.XX/scripts/ks-v1.cfg nameserver=XX.XX.XX.XX ip=XX.XX.XX.XX netmask=255.255.255.0 gateway=XX.XX.XX.XX
vSphere Auto Deploy is VMware's solution to simplify the deployment of large numbers of ESXi hosts. It is one of the available options for ESXi deployment along with an interactive and scripted installation.
The main difference of Auto Deploy compared to other deployment options is that the ESXi configuration is not stored on the host's disk. Instead, it's managed with image and host profiles by the Auto Deploy server.
Before using Auto Deploy, confirm the following:
It can be installed as a standalone server or as part of the vCenter installation.
Once prerequisites are met, the following steps are required to start deploying hosts.
In order to configure the TFTP server with the correct boot image for ESXi, execute the following steps:
Image profies are created using Image Builder PowerCLI cmdlets. Image Builder requires PowerCLI and can be installed on a machine that's used to run administrative tasks. It doesn't have to be a vCenter server or Auto Deploy server and the only requirement for this machine is that it must have access to the software depot—a file server that stores image profiles.
Image profiles can be created from scratch or by cloning an existing profile. The following steps outline the process of creating an image profile by cloning. The steps assume that:
Cloning an existing profile included in the depot is the easiest way to create a new profile. The steps to do so are as follows:
Add-EsxSoftwareDepot -DepotUrl <Path to softwaredepot>
New-EsxImageProfile -CloneProfile <Existing profile name> - Name <New profile name>
Add-EsxSoftwarePackage -ImageProfile <New profile name> - SoftwarePackage <Package>
At this point, the software package will be validated and in case of errors, or if there are any dependencies that need to be resolved, an appropriate message will be displayed.
To create a rule that assigns an image profile to a host, execute the following steps:
Connect-VIServer <vCenter IP or FQDN>
Add-EsxSoftwareDepot <depot URL>
New-DeployRule -Name <Rule name> -Item <Profile name> -Pattern "ipv4=192.168.1.10-192.168.1.20" Add-DeployRule <Rule name>
Optionally, the existing host profile can be assigned to hosts. To accomplish this, execute the following steps:
Connect-VIServer <vCenter IP or FQDN>
New-DeployRule -Name <Rule name> -Item <Profile name> -Pattern "ipv4=192.168.1.10-192.168.1.20" Add-DeployRule <Rule name>
To make sure a host is placed in a certain folder or cluster once it boots, do the following:
Connect-VIServer <vCenter IP or FQDN>
New-DeployRule -Name <Rule name> -Item <Folder name> -Pattern "ipv4=192.168.1.10-192.168.1.20" Add-DeployRule <Rule name>
If a host is assigned to a cluster it inherits that cluster's host profile.
Auto Deploy utilizes the PXE boot to connect to the Auto Deploy server and get an image profile, vCenter location, and optionally, host profiles. The detailed process is as follows:
When a new host boots for the first time, vCenter creates a new object and stores it together with the host and image profiles in the database. For any subsequent reboots, the existing object is used to get the correct host profile and any changes that have been made.
More details can be found in the vSphere 5 documentation on the VMware website at https://www.vmware.com/support/pubs/.
In this article we learnt how new hosts can be deployed with scripted installation and auto deploy techniques.