Review the commands that are supported in ESX installation scripts.

Accepts the ESX license agreement.

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

Creates the default partitions on the disk. Not required if you include the part or partition command.

--disk= or --drive=

Specifies the disk to partition. For the accepted disk name formats, see Disk Device Names.

--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. 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.

--onvmfs=

Partitions only the service console VMDK and not the physical disk. The argument is the VMFS volume name where the VMDK should be placed. The service console must be installed on a VMFS datastore that is resident on a host's local disk or on a SAN disk that is masked and zoned to that particular host only. The datastore cannot be shared between hosts.

--extraspace=

Specifies the amount of extra space to add to the / (root) partition. The size is given in megabytes (MB). Must be greater than 0.

--vmdkpath=

Species the path for the VMDK file. Takes the same value format as the virtualdisk--path= option.

Sets up authentication for the system. Hesiod arguments are not supported.

If you omit this command, MD5-based and shadow passwords are enabled by default.

--disablemd5

Disables MD5-based passwords.

--disableshadow

Disables shadow passwords.

--enablemd5 (default)

Enables MD5-based passwords.

--enablenis

Enables NIS support. Requires nisdomain and nisserver.

--nisdomain=<domain>

Sets the NIS domain. Requires --enablenis.

--nisserver=<server>

Sets the NIS server (broadcasts by default). Requires --enablenis.

--useshadow or --enableshadow (default)

Enables shadow password file.

--enablekrb5

Enables Kerberos 5 to authenticate users.

--krb5realm=

Specifies the Kerberos 5 realm to which your system belongs.

--krb5kdc=

Specifies the KDCs that serve requests for the realm. Separate the names of multiple KDCs with commas.

--krb5adminserver=

Specifies the KDC in your realm that is also running the KADM5 administration server.

--enableldap

Enables LDAP.

--enableldapauth

Enables LDAP as an authentication method. Requires --enableldap.

--ldapserver=

Specifies the name of the LDAP server. Requires --enableldap.

--ldapbasedn=

Specifies the distinguished name in your LDAP directory tree under which user information is stored. Requires --enableldap.

--enableldaptls

Enables transport layer security lookups. Requires --enableldap.

--enablead

Enables active directory authentication. Requires --addomain and --addc.

--addomain

Active directory domain name. Requires --enablead.

--addc

Active directory domain controller. Requires --enablead.

Sets up the GRUB boot loader.

--append=

Specifies extra kernel parameters for when the system is booting.

--driveorder=

Specifies which drive is first in the BIOS boot order.

--location

=[mbr|partition|none]

Specifies where the boot loader is installed. The values are: mbr for the master boot record, partition for the first sector of the partition with the VMnix kernel, or none to not install the boot loader. If you omit the location option, the default location is the MBR.

--md5pass=

Sets the GRUB bootloader password with the md5 encrypted password.

--password=

Sets the GRUB boot loader password.

--upgrade

Upgrades the existing boot loader configuration and preserves existing entries.

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

Removes partitions from the system before creating new partitions.

--all

Removes all partitions from the system.

--drives=

Specifies which drives to clear partitions from. For the accepted drives, see Disk Device Names.

--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. 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.

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

Specifies an existing Linux partition to use as the /boot partition. The partition must be formatted with an ext2 or ext3 file system, be at least 1100MB, and be a primary partition.

--disk= or --drive=

Specifies the disk to search for an existing Linux partition that can be used as /boot. See Disk Device Names for the accepted disk name formats.

--firstdisk=

<disk-type1>,

[<disk-type2>, ...]

Uses the first disk that has a partition suitable to be the /boot partition. Supports the same argument format as the autopart command.

--uuid=<UUID>

Specifies a particular partition using the partition's ext2 UUID.

--clearcontents

Removes any files on the partition.

Compared to kickstart, the behavior of the ESX 4.0 firewall command is significantly different. Carefully edit the firewall command in your existing scripts.

Configures firewall options. All nonessential ports are blocked by default.

--allowIncoming

Opens all incoming ports on the system.

--allowOutgoing

Opens all outgoing ports on the system.

Specifies firewall ports to allow or disallow connections.

--open

Allows the specified port to pass through the firewall.

--close

Disallows the specified port to pass through the firewall.

--port=<port>

Specifies ports allowed or disallowed through the firewall.

--proto=[tcp|udp]

Specifies transmission protocols allowed or disallowed through the firewall.

--dir=[in|out]

Specifies the direction of traffic to be allowed or disallowed through the firewall.

--name=<name>

Assigns a descriptive name to the firewall rule. The name must be specified for inbound ports.

--enableService=<service>

Allows services specified in services.xml to pass through the firewall.

--disableService=<service>

Disables services specified in services.xml from passing through the firewall.

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

<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/ESX/40

url downloads across the network. For example:

install url http://example.com

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.

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

--esx=<license-key>

Specifies the vSphere license key to use. The format is 5 five-character tuples (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. This option refers to the uplink device for the virtual switch created for the service console. If you omit this option, the installer uses the network adapter specified with the IPAPPEND PXE configuration option or the netdevice bootstrap command. If you omit this option, the IPAPPEND option, and the netdevice bootstrap command, the installer uses the first plugged in network adapter. See IPAPPEND and Bootstrap Commands.

--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 just logged.

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

Create service console partitions (except /boot) on the virtual disk and not on the physical disk.

Creates a partition on the system. Not required if you include the autopart command.

<mntpoint>

Specifies where to mount the partition.

--asprimary

Specifies that the partition must be created as a primary partition and not a logical partition in the extended partition table.

--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. For the accepted disk formats, see Disk Device Names. Cannot be used with the --onvirtualdisk option.

--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.

--onvirtualdisk=

Specifies the virtual disk on which partitions are created. Cannot be used with the --ondisk option.

--fstype=

Sets the file system type for the partition. Usually of type vmfs3, ext3, swap, or vmkcore.

Reboots the system after scripted installation is finished.

--noeject

Does not eject the DVD after installation.

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.

Sets the time zone for the system.

--utc (required)

Indicates that the BIOS clock is set to UTC (Greenwich Mean) time. Do not omit this option.

<timezone> (optional)

Specifies the timezone value. See the Olson database for supported values.

Note

The service console must be installed on a VMFS datastore that is resident on a host's local disk or on a SAN disk that is masked and zoned to that particular host only. The datastore cannot be shared between hosts.

Creates a new virtual disk.

<name>-<system-uuid>/default-<name>.vmdk

Specifies the name of the virtual disk. If you omit the --path= option, the name of the VMDK is <name>/default-<name>.vmdk.

--size=

Specifies the size of the virtual disk in megabytes.

--path=

Specifies the location where the virtual disk is created. The path must include a directory and a filename ending in .vmdk. For example: cos/default-cos.vmdk.

--onvmfs=

Specifies the name of the VMFS volume where the VMDK file is created.

--onfirstvmfs=

(<disk-type1>,

[<disk-type2>,...])

Uses the first VMFS volume on a disk that matches the given description and has more free space than the requested size. Uses the same argument format as autopart.

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

Adds or removes a package from the installation ISO image.

packages.xmlrequirement="recommended"

%packages
-<package_name> # The package will not be installed.

The requirement="optional" tag means that the package is not installed by default. To override the default setting in the script, include:

%packages
<package_name> # The package will be installed.

--resolvedeps

Installs the listed packages and automatically resolves package dependencies.

--ignoredeps

Ignores the unresolved dependencies and installs the listed packages without the dependencies.

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
cat > /tmp/part.cfg <<EOF
part /boot --fstype=ext3 --size= --onfirstdisk
part storage1 --fstype=vmfs3 --size=10000 --grow --onfirstdisk
part None --fstype=vmkcore --size=100 --onfirstdisk
EOF

--interpreter

=[python|bash]

Specifies an interpreter to use. The default is bash.

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
MY_MAC=`esxcfg-nics -l | tail -1 | awk '{print $7}'` CONF_URL="http://example.com/$MY_MAC"
esxcfg-firewall --allowOutgoing
--interpreter python -c "import urllib; urllib.urlretrieve('$CONF_URL', '/tmp/myconfig.sh')"
esxcfg-firewall --blockOutgoing
sh /tmp/myconfig.sh

--interpreter

=[perl|python|bash]

Specifies an interpreter to use. The default is bash.

--nochroot

Indicates whether the script is executed after you chroot into the service console file system.

--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 %pre script terminated with an error.