
Understanding other ESXi deployment methods
VMware ESXi can be installed and deployed using different methods. One of the most common methods is the interactive installation that can be performed by mounting the installation DVD, or its image, to the server chosen for hosting ESXi. The installation was covered in the previous section but there are two other deployment methods:
- The scripted-unattended installation
- vSphere Auto Deploy
Note
Since the use of vSphere Auto Deploy is dependent on vCenter and other features such as Host Profiles, we will be covering this topic in a later chapter.
Scripted-unattended ESXi installation
A scripted-unattended installation will require the use of an install script that is accessible to the server either via direct access (CD or USB) or via network access (HTTP, HTTPS, FTP, or NFS). The install script is referred to as a kickstart file. Kickstart is a Linux method to perform an unattended installation, hence the name. VMware supports the use of kickstart's syntax to perform an unattended ESXi installation.
Here is the default ks.cfg
script located at /etc/vmware/weasel
:
# # Sample scripted installation file # # Accept the VMware End User License Agreement vmaccepteula # Set the root password for the DCUI and Tech Support Mode rootpw mypassword # Install on the first local disk available on machine install --firstdisk -overwritevmfs # Set the network to DHCP on the first network adapter network --bootproto=dhcp --device=vmnic0 # A sample post-install script %post --interpreter=python --ignorefailure=true import time stampFile = open('/finished.stamp', mode='w') stampFile.write( time.asctime() )
Although it is the default script, the ESXi installer does not use it unless it is explicitly specified in the boot options using the ks=
syntax:
ks=file://etc/vmware/weasel/ks.cfg
When you install using the default ks.cfg
script, the default password will be set to mypassword
.
There are many more commands than you see in the default script, and those commands can be used to create scripts to install ESXi hosts as per your requirements. Starting with ESXi 5.0, you can use the script to perform upgrades on the server. The following is a list of commands that can be included in scripts. The list may not cover every command available, but should cover the most common ones:
vmaccepteula
clearpart
dryrun
install
installorupgrade
keyboard
network
paranoid
part
orpartition
reboot
rootpw
upgrade
%include
%pre
%post
%firstboot
The commands prefixed with a percent (%
) symbol are multi-line commands. Also, all the commands in the kickstart script should be in lower-case.
A single script can be used to install ESXi on multiple machines. Some modifications might be needed if you choose to install ESXi on a different hard drive, because by default it would install on the first local hard drive.
A scripted install has two procedural stages:
- In the first stage, we create a custom script with the required commands, or edit the script if it needs to be unique for a specific host, and place it in a location accessible to the ESXi host
- In the second stage we edit the boot options to redirect the installer to use the custom script file using the
ks=
option
If we do not specify the ks=
boot option, then the standard-text installation will proceed.
The ks=
boot option supports the following syntaxes:
ks=cdrom:/path
ks=usb:/path
ks=file://path
ks=protocol://serverpath
On successfully locating the configuration (.cfg
) file, the installer will go through the following phases to finish the unattended installation:
- Preliminary checks
- Writing binary to the boot partition
- Partitioning the disk for ESXi
- Writing binary to the boot partition
- Writing GUIDs to the bootbanks
- Caching network settings
- Writing the first-boot scripts
Here is a sample procedure to perform an unattended installation of ESXi using the kickstart script. In this example, the kickstart script is located at an FTP location:
- Boot the server with the ESXi installation CD in the CD/DVD ROM drive and at the ESXi installation standard boot menu select the ESXi installer and hit Enter to continue.
- At the Loading ESXi Installer screen, press Shift + O. You have exactly 5 seconds to interrupt the loading screen:
- Pressing Shift + O, will reveal the default command, the
runweasel
. This will run weasel which is nothing but the ESXi installer: - At the
runweasel
prompt, specify the location of the install script. Local CD ROM, USB driver, HTTP/HTTPS, or NFS are other supported script locations: - The installer will then locate and load the specified configuration file and proceed with the installation.
- Once the installation is complete, it will prompt for a reboot. Press Enter to reboot.