To modify the default installation script or create your own script, use supported commands. Use the following commands in the installation script (kickstart file), which you specify with a boot command when you boot the installer.

Accepts the ESXi license agreement.

Compared to kickstart, the behavior of the ESXi 4.1 autopart command is significantly different. Carefully edit the autopart command in your existing scripts.

Specifies the disk onto which ESXi is installed. Clears the specified disk and creates the default partitions, including a VMFS datastore that occupies all available space after the other partitions are created.

--disk= or --drive=

Specifies the disk to partition.

--firstdisk=

<disk-type1>,

[<disk-type2>,...]

Partitions the first non-USB disk found. This is the same disk as found by the clearpart --firstdisk command.

You can add an optional string argument to the --firstdisk flag to select the disk types. You can use the following strings :

local

remote

Device driver name in the vmkernel

You can combine multiple values in a comma-separated list to concatenate other matches onto the list of matches. For example, --firstdisk=local,remote selects the first detected local disk or, if none are available, the first remote disk. This is the default behavior. To prefer a disk with the device driver named mptspi over any other local disks, use --firstdisk=mptspi,local.

--overwritevmfs

Required if a VMFS partition exists on the disk before installation.

Compared to kickstart, the behavior of the ESXi 4.1 clearpart command is significantly different. Carefully edit the clearpart command in your existing scripts.

Removes partitions from the system before creating new partitions.

--drives=

Specifies which drives to clear partitions from.

--alldrives

Ignores the --drives= requirement and allows clearing of partitions on every drive.

--ignoredrives=

Removes partitions on all drives except those specified. Required unless the --drives= or --alldrives flag is specified.

--overwritevmfs

Overwrites VMFS partitions on the specified drives. Required if the disk contains a VMFS partition.

--initlabel

Initializes the disk label to the default for your architecture.

--firstdisk=

<disk-type1>,

[<disk-type2>,...]

Clears partitions on the first non-USB disk found. This is the same disk as found by autopart --firstdisk command.

You can add an optional string argument to the --firstdisk flag to select the disk types. You can use the following strings:

local

remote

Device driver name in the vmkernel

You can combine multiple values in a comma-separated list to concatenate other matches onto the list of matches. For example, --firstdisk=local,remote selects the first detected local disk or, if none are available, the first remote disk. This is the default behavior. To prefer a disk with the device driver named mptspi over any other local disks, use --firstdisk=mptspi,local.

Parses and checks the installation script. Does not perform the installation.

Specifies that this is a fresh installation. (All scripted installations are fresh installations.)

<cdrom|nfs|url><cdrom|usb|nfs|url>

Specifies the type of installation. The values are:

cdrom installs from the DVD-ROM drive. For example:

install cdrom

nfs.

Installs from the specified NFS server. For example:

install nfs --server=example.com --dir=/nfs3/VMware/ESXi/41

usb

Installs from the first USB media found to contain the installation image. For example:

install usb

--server=

Specifies which NFS server to connect to. Use with nfs.

--dir=

Specifies which directory on the NFS server to mount. Use with nfs.

<url>

Defines the location of the runtime environment. Use with url (http/https/ftp/nfs).

Sets the keyboard type for the system.

<keyboardType>

Specifies the keyboard map for the selected keyboard type. keyboardType must be one of the following types.

Default

French

German

Japanese

Russian

Configures licensing. If not included, ESXi installs in evaluation mode.

--esx=<license-key>

Specifies the vSphere license key to use. The format is 5 five-character groups (XXXXX-XXXXX-XXXXX-XXXXX-XXXXX).

Configures network information for the system.

--bootproto=[dhcp|static]

Specifies network settings.

--device=

Specifies either the MAC address of the network card or the device name, as in vmnic0.

--ip=

Sets an IP address for the machine to be installed. Required with the --bootproto=static option.

--gateway=

Designates the default gateway as an IP address. Required with the --bootproto=static option.

--nameserver=

Designates the primary name server as an IP address. Used with the --bootproto=static option. Omit this option if you do not intend to use DNS.

The --nameserver option can accept two IP addresses. For example: --nameserver="10.126.87.104,10.126.87.120"

--netmask=

Specifies the subnet mask for the installed system. Used with the --bootproto=static option. If you omit this option, the default is the standard netmask for the given IP address.

--hostname=

Specifies the host name for the installed system. Only works with --bootproto=static.

--vlanid=<vlanid>

Specifies a VLAN to use for networking. Set to an integer between 0 and 4095.

--addvmportgroup=(0|1)

Specifies whether to add the VM Network port group, which is used by virtual machines. The default value is 1.

Causes any warning messages to interrupt the installation. If you omit this command, warning messages are logged.

Compared to kickstart, the behavior of the ESXi 4.1 part or partition command is significantly different. Carefully edit the part or partition command in your existing scripts.

Creates an additional VMFS datastore on the system. Only one datastore per disk can be created. Cannot be used on the same disk as autopart, because autopart automatically creates a datastore on its disk.

<datastore name>

Specifies the name for the datastore.

--size=

Defines the minimum partition size in megabytes.

--grow

Allows the partition to grow to fill any available space or up to the maximum size setting.

--maxsize=

Specifies the maximum size in megabytes for a partition to grow.

--ondisk= or --ondrive=

Specifies the disk on which partitions are created.

--onfirstdisk=

<disk-type1>,

[<disk-type2>,...]

Partitions the first non-USB disk found. This is the same disk as found by the autopart –-firstdisk command.

You can add an optional string argument to the --firstdisk flag to select the disk types. The strings that you can use are as follows:

local

remote

Device driver name in the vmkernel

You can combine multiple values in a comma-separated list to concatenate other matches onto the list of matches. For example, --firstdisk=local,remote selects the first detected local disk or, if none are available, the first remote disk. This is the default behavior. To prefer a disk with the device driver named mptspi over any other local disks, use --firstdisk=mptspi,local.

--fstype=

Sets the file system type for the partition. Only for VMFS3.

Sets the root password for the system. Can be between 6 and 64 characters.

--iscrypted

Specifies that the password is encrypted.

<password>

Specifies the password value.

Specifies an additional installation script to parse. You can add several include commands to your script. When you use the %include command, put the <filename> argument on the same line as the command.

<filename>

For example: %include part.cfg

Specifies a script to be executed before the kickstart configuration is evaluated. For example, a %pre script can generate include files, as shown here:

 # Partitioning
%include part.cfg
...
%pre --unsupported
cat > /tmp/part.cfg <<EOF
part datastore2 --fstype=vmfs3 --size=20000 --onfirstdisk="remote"
part datastore3 --fstype=vmfs3 --size=10000 --grow --ondisk="mpx.vmhba1:C0:T0:L0"
EOF

--interpreter

=[python|busybox]

Specifies an interpreter to use. The default is busybox.

--unsupported(required)

Required argument that acknowledges the command is unsupported.

Executes the specified script after package installation has been completed. If you specify multiple %post sections, they are executed in the order they appear in the installation script. For example:

 %post --unsupported
MY_MAC=`esxcfg-nics -l | tail -1 | awk '{print $7}'` CONF_URL="http://example.com/$MY_MAC"
python -c "import urllib; urllib.urlretrieve('$CONF_URL', '/tmp/myconfig.sh')"
sh /tmp/myconfig.sh

--interpreter

=[python|busybox]

Specifies an interpreter to use. The default is busybox.

--timeout=secs

Specifies a timeout for executing the script. If the script has not finished when the timeout expires, the script is forcefully terminated.

--ignorefailure

=[true|false]

If true, the installation is considered a success even if the %post script terminated with an error.

--unsupported(required)

Required argument that acknowledges the command is unsupported.

Creates an init script which executes during the first boot only. If you specify multiple %firstboot sections, assign the order of execution by setting the --level argument.

--interpreter

=[python|busybox]

Specifies an interpreter to use. The default is busybox.

--level=level

Determines the order that the init script will be executed in. Set the level high enough so that other init scripts, such as loading drivers, can run first. The default is 999.

--unsupported(required)

Required argument that acknowledges the command is unsupported.

Note

There is no way to check the semantics of %firstboot script until the system boots for the first time. If the script contains errors, they will not be exposed unti lafter the installation is complete.