Running a script is an efficient way to deploy multiple ESXi hosts with an unattended installation.

The installation script contains the host configuration settings. You can use the script to configure multiple hosts with the same settings. See Installing or Upgrading Hosts by Using a Script.

The installation script must be stored in a location that the host can access by HTTP, HTTPS, FTP, NFS, CDROM, or USB. You can PXE boot the ESXi installer or boot it from a CD/DVD or USB drive.

Figure 1. Scripted Installation
Flow of scripted installation: you create an installation script, which is accessed when the installer boots.

Approaches for Scripted Installation

You can install ESXi on multiple machines using a single script for all of them or a separate script for each machine.

For example, because disk names vary from machine to machine, one of the settings that you might want to configure in a script is the selection for the disk to install ESXi on.
Table 1. Scripted Installation Choices
Option Action
Always install on the first disk on multiple machines. Create one script.
Install ESXi on a different disk for each machine. Create multiple scripts.

For information about the commands required to specify the disk to install on, see Installation and Upgrade Script Commands.

Enter Boot Options to Run an Installation or Upgrade Script

You can start an installation or upgrade script by typing boot options at the ESXi installer boot command line.

At boot time you might need to specify options to access the kickstart file. You can enter boot options by pressing Shift+O in the boot loader. For a PXE boot installation, you can pass options through the kernelopts line of the boot.cfg file. See About the boot.cfg File and Network Booting the ESXi Installer.

To specify the location of the installation script, set the ks=filepath option, where filepath indicates the location of your kickstart file. Otherwise, a scripted installation or upgrade cannot start. If ks=filepath is omitted, the text installer is run.

Supported boot options are listed in Boot Options.

Procedure

  1. Start the host.
  2. When the ESXi installer window appears, press Shift+O to edit boot options.
    ESXi Installer screen
  3. At the runweasel command prompt, type ks=location of installation script plus boot command-line options.

Example: Boot Option

You type the following boot options:
ks=http://00.00.00.00/kickstart/ks-osdc-pdp101.cfg nameserver=00.00.0.0 ip=00.00.00.000 netmask=255.255.255.0 gateway=00.00.00.000

Boot Options

When you perform a scripted installation, you might need to specify options at boot time to access the kickstart file.

Supported Boot Options

Table 2. Boot Options for ESXi Installation
Boot Option Description
BOOTIF=hwtype-MAC address

Similar to the netdevice option, except in the PXELINUX format as described in the IPAPPEND option under SYSLINUX at the syslinux.org site.

gateway=ip address Sets this network gateway as the default gateway to be used for downloading the installation script and installation media.
ip=ip address Sets up a static IP address to be used for downloading the installation script and the installation media. Note: the PXELINUX format for this option is also supported. See the IPAPPEND option under SYSLINUX at the syslinux.org site.
ks=cdrom:/path Performs a scripted installation with the script at path, which resides on the CD in the CD-ROM drive. Each CDROM is mounted and checked until the file that matches the path is found.
Important: If you have created an installer ISO image with a custom installation or upgrade script, you must use uppercase characters to provide the path of the script, for example, ks=cdrom:/KS_CUST.CFG.
ks=file://path Performs a scripted installation with the script at path.
ks=protocol://serverpath Performs a scripted installation with a script located on the network at the given URL. protocol can be http, https, ftp, or nfs. An example using NFS protocol is ks=nfs://host/porturl-path. The format of an NFS URL is specified in RFC 2224.
ks=usb

Performs a scripted installation, accessing the script from an attached USB drive. Searches for a file named ks.cfg. The file must be located in the root directory of the drive. If multiple USB flash drives are attached, they are searched until the ks.cfg file is found. Only FAT16 and FAT32 file systems are supported.

ks=usb:/path Performs a scripted installation with the script file at the specified path, which resides on USB.
ksdevice=device Tries to use a network adapter device when looking for an installation script and installation media. Specify as a MAC address, for example, 00:50:56:C0:00:01. This location can also be a vmnicNN name. If not specified and files need to be retrieved over the network, the installer defaults to the first discovered network adapter that is plugged in.
nameserver=ip address Specifies a domain name server to be used for downloading the installation script and installation media.
netdevice=device Tries to use a network adapter device when looking for an installation script and installation media. Specify as a MAC address, for example, 00:50:56:C0:00:01. This location can also be a vmnicNN name. If not specified and files need to be retrieved over the network, the installer defaults to the first discovered network adapter that is plugged in.
netmask=subnet mask Specifies subnet mask for the network interface that downloads the installation script and the installation media.
vlanid=vlanid Configure the network card to be on the specified VLAN.
systemMediaSize=small
Limits the size of system storage partitions on the boot media. The selected value must fit the purpose of your system. You can select from the following values:
  • min (32 GB, for single disk or embedded servers)
  • small (64 GB, for servers with at least 512 GB RAM)
  • default (128 GB)
  • max (consume all available space, for multi-terabyte servers)

For more information on ESXi booting options post installation, see VMware knowledge base article 77009.