To modify the default installation or upgrade script or to create your own script, use supported commands. Use supported commands in the installation script, which you specify with a boot command when you boot the installer.

To determine which disk to install or upgrade ESXi on, the installation script requires one of the following commands: install, upgrade, or installorupgrade. The install command creates the default partitions, including a VMFS datastore that occupies all available space after the other partitions are created.

accepteula or vmaccepteula (Required)

Accepts the ESXi license agreement.

clearpart (Optional)

Clears any existing partitions on the disk. Requires the install command to be specified. Carefully edit the clearpart command in your existing scripts.

--drives=
Remove partitions on the specified drives.
--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
Allows overwriting of VMFS partitions on the specified drives. By default, overwriting VMFS partitions is not allowed.
--firstdisk=
disk-type1
[disk-type2,...]
Partitions the first eligible disk found. By default, the eligible disks are set to the following order:
  1. Locally attached storage (local)
  2. Network storage (remote)
  3. USB disks (usb)

You can change the order of the disks by using a comma-separated list appended to the argument. If you provide a filter list, the default settings are overridden. You can combine filters to specify a particular disk, including esx for the first disk with ESXi installed on it, model and vendor information, or the name of the VMkernel device driver. For example, to prefer a disk with the model name ST3120814A and any disk that uses the mptsas driver rather than a normal local disk, the argument is --firstdisk=ST3120814A,mptsas,local. You can use localesx for local storage that contains ESXi image or remoteesx for remote storage that contains ESXi image.

dryrun (Optional)

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

install

Specifies that this is a fresh installation. Either the install, upgrade, or installorupgrade command is required to determine which disk to install or upgrade ESXi on.

--disk= or --drive=
Specifies the disk to partition. In the command --disk=diskname, the diskname can be a disk name or a full disk filesystem path in ESXi, for example:
  • Disk name: --disk=naa.6d09466044143600247aee55ca2a6405 or
  • Device path: --disk=/vmfs/devices/disks/mpx.vmhba1:C0:T0:L0

For accepted disk name formats, see Disk Device Names.

--firstdisk=
disk-type1,
[ disk-type2,...]
Partitions the first eligible disk found. By default, the eligible disks are set to the following order:
  1. Locally attached storage (local)
  2. Network storage (remote)
  3. USB disks (usb)

You can change the order of the disks by using a comma-separated list appended to the argument. If you provide a filter list, the default settings are overridden. You can combine filters to specify a particular disk, including esx for the first disk with ESX installed on it, model and vendor information, or the name of the VMkernel device driver. For example, to prefer a disk with the model name ST3120814A and any disk that uses the mptsas driver rather than a normal local disk, the argument is --firstdisk=ST3120814A,mptsas,local. You can use localesx for local storage that contains ESXi image or remoteesx for remote storage that contains ESXi image.

--ignoressd
Excludes solid-state disks from eligibility for partitioning. This option can be used with the install command and the --firstdisk option. This option takes precedence over the --firstdisk option. This option is invalid with the --drive or --disk options and with the upgrade and installorupgrade commands. See the vSphere Storage documentation for more information about preventing SSD formatting during auto-partitioning.
--overwritevsan
You must use the --overwritevsan option when you install ESXi on a disk, either SSD or HDD (magnetic), that is in a vSAN disk group. If you use this option and no vSAN partition is on the selected disk, the installation fails. When you install ESXi on a disk that is in vSAN disk group, the result depends on the disk that you select:
  • If you select an SSD, the SSD and all underlying HDDs in the same disk group is wiped.
  • If you select an HDD, and the disk group size is greater than two, only the selected HDD is wiped.
  • If you select an HDD disk, and the disk group size is two or less, the SSD and the selected HDD is wiped.

For more information about managing vSAN disk groups, see the vSphere Storage documentation.

--overwritevmfs
Required to overwrite an existing VMFS datastore on the disk before installation.
--preservevmfs
Preserves an existing VMFS datastore on the disk during installation.
--novmfsondisk
Prevents a VMFS partition from being created on this disk. Must be used with --overwritevmfs if a VMFS partition exists on the disk.

installorupgrade

Either the install, upgrade, or installorupgrade command is required to determine which disk to install or upgrade ESXi on.

--disk= or --drive=
Specifies the disk to partition. In the command --disk=diskname, the diskname can be a disk name or a full disk filesystem path in ESXi, for example:
  • Disk name: --disk=naa.6d09466044143600247aee55ca2a6405 or
  • Device path: --disk=/vmfs/devices/disks/mpx.vmhba1:C0:T0:L0

For accepted disk name formats, see Disk Device Names.

--firstdisk=
disk-type1,
[ disk-type2,...]
Partitions the first eligible disk found. By default, the eligible disks are set to the following order:
  1. Locally attached storage (local)
  2. Network storage (remote)
  3. USB disks (usb)

You can change the order of the disks by using a comma-separated list appended to the argument. If you provide a filter list, the default settings are overridden. You can combine filters to specify a particular disk, including esx for the first disk with ESX installed on it, model and vendor information, or the name of the VMkernel device driver. For example, to prefer a disk with the model name ST3120814A and any disk that uses the mptsas driver rather than a normal local disk, the argument is --firstdisk=ST3120814A,mptsas,local. You can use localesx for local storage that contains ESXi image or remoteesx for remote storage that contains ESXi image.

--overwritevsan
You must use the --overwritevsan option when you install ESXi on a disk, either SSD or HDD (magnetic), that is in a vSAN disk group. If you use this option and no vSAN partition is on the selected disk, the installation fails. When you install ESXi on a disk that is in a vSAN disk group, the result depends on the disk that you select:
  • If you select an SSD, the SSD and all underlying HDDs in the same disk group is wiped.
  • If you select an HDD, and the disk group size is greater than two, only the selected HDD is wiped.
  • If you select an HDD disk, and the disk group size is two or less, the SSD and the selected HDD is wiped.

For more information about managing vSAN disk groups, see the vSphere Storage documentation.

--overwritevmfs

Install ESXi if a VMFS partition exists on the disk, but no ESX or ESXi installation exists. Unless this option is present, the installer fails if a VMFS partition exists on the disk, but an ESX or ESXi installation is missing.

keyboard (Optional)

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.
  • Belgian
  • Brazilian
  • Croatian
  • Czechoslovakian
  • Danish
  • Estonian
  • Finnish
  • French
  • German
  • Greek
  • Icelandic
  • Italian
  • Japanese
  • Latin American
  • Norwegian
  • Polish
  • Portuguese
  • Russian
  • Slovenian
  • Spanish
  • Swedish
  • Swiss French
  • Swiss German
  • Turkish
  • Ukrainian
  • United Kingdom
  • US Default
  • US Dvorak

serialnum or vmserialnum (Optional)

Deprecated in ESXi 5.0.x. Supported in ESXi 5.1 and later. 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).

network (Optional)

Specifies a network address for the system.

--bootproto=[dhcp|static]

Specifies whether to obtain the network settings from DHCP or set them manually.

--device=
Specifies either the MAC address of the network card or the device name, in the form vmnicNN, as in vmnic0. This option refers to the uplink device for the virtual switch.
--ip=
Sets an IP address for the machine to be installed, in the form xxx.xxx.xxx.xxx. Required with the --bootproto=static option and ignored otherwise.
--gateway=
Designates the default gateway as an IP address, in the form xxx.xxx.xxx.xxx. Used 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, in the form 255.xxx.xxx.xxx. Used with the --bootproto=static option.
--hostname=
Specifies the host name for the installed system.
--vlanid= vlanid
Specifies which VLAN the system is on. Used with either the --bootproto=dhcp or --bootproto=static option. Set to an integer from 1 to 4096.
--addvmportgroup=(0|1)
Specifies whether to add the VM Network port group, which is used by virtual machines. The default value is 1.

paranoid (Optional)

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

part or partition (Optional)

Creates an extra VMFS datastore on the system. Only one datastore per disk can be created. Cannot be used on the same disk as the install command. Only one partition can be specified per disk and it can only be a VMFS partition.

datastore name
Specifies where the partition is to be mounted.
--ondisk= or --ondrive=
Specifies the disk or drive where the partition is created.
--firstdisk=
disk-type1,
[ disk-type2,...]
Partitions the first eligible disk found. By default, the eligible disks are set to the following order:
  1. Locally attached storage (local)
  2. Network storage (remote)
  3. USB disks (usb)

You can change the order of the disks by using a comma-separated list appended to the argument. If you provide a filter list, the default settings are overridden. You can combine filters to specify a particular disk, including esx for the first disk with ESX installed on it, model and vendor information, or the name of the VMkernel device driver. For example, to prefer a disk with the model name ST3120814A and any disk that uses the mptsas driver rather than a normal local disk, the argument is --firstdisk=ST3120814A,mptsas,local. You can use localesx for local storage that contains ESXi image or remoteesx for remote storage that contains ESXi image.

reboot (Optional)

Reboots the machine after the scripted installation is complete.

<--noeject>
The CD is not ejected after the installation.

rootpw (Required)

Sets the root password for the system.

--iscrypted
Specifies that the password is encrypted.
password
Specifies the password value.

upgrade

Either the install, upgrade, or installorupgrade command is required to determine which disk to install or upgrade ESXi on.

--disk= or --drive=
Specifies the disk to partition. In the command --disk=diskname, the diskname can be a disk name or a full disk filesystem path in ESXi, for example:
  • Disk name: --disk=naa.6d09466044143600247aee55ca2a6405 or
  • Device path: --disk=/vmfs/devices/disks/mpx.vmhba1:C0:T0:L0

For accepted disk name formats, see Disk Device Names.

--firstdisk=
disk-type1,
[ disk-type2,...]
Partitions the first eligible disk found. By default, the eligible disks are set to the following order:
  1. Locally attached storage (local)
  2. Network storage (remote)
  3. USB disks (usb)

You can change the order of the disks by using a comma-separated list appended to the argument. If you provide a filter list, the default settings are overridden. You can combine filters to specify a particular disk, including esx for the first disk with ESX installed on it, model and vendor information, or the name of the VMkernel device driver. For example, to prefer a disk with the model name ST3120814A and any disk that uses the mptsas driver rather than a normal local disk, the argument is --firstdisk=ST3120814A,mptsas,local. You can use localesx for local storage that contains ESXi image or remoteesx for remote storage that contains ESXi image.

%include or include (Optional)

Specifies another installation script to parse. This command is treated similarly to a multiline command, but takes only one argument.

filename
For example: %include part.cfg

%pre (Optional)

Specifies a script to run before the kickstart configuration is evaluated. For example, you can use it to generate files for the kickstart file to include.

--interpreter
=[python|busybox]
Specifies an interpreter to use. The default is busybox.

%post (Optional)

Runs the specified script after package installation is complete. If you specify multiple %post sections, they run in the order that they appear in the installation script.

--interpreter
=[python|busybox]
Specifies an interpreter to use. The default is busybox.
--timeout=secs
Specifies a timeout for running the script. If the script is not finished when the timeout expires, the script is forcefully stopped.
--ignorefailure
=[true|false]
If true, the installation is considered a success even if the %post script stops with an error.

%firstboot

Creates an init script that runs only during the first boot. The script has no effect on subsequent boots. If multiple %firstboot sections are specified, they run in the order that they appear in the kickstart file.

Note: You cannot check the semantics of %firstboot scripts until the system is booting for the first time. A %firstboot script might contain potentially catastrophic errors that are not exposed until after the installation is complete.
Important: The %firstboot script does not run, if secure boot is enabled on the ESXi host.
--interpreter
=[python|busybox]
Specifies an interpreter to use. The default is busybox.
Note: You cannot check the semantics of the %firstboot script until the system boots for the first time. If the script contains errors, they are not exposed until after the installation is complete.