ESXi scripted installation

Scripted installations can be selected for deployments in small environments to simplify the repetitive process of the installation process. The installation scripts must be stored in a location accessible by the host via HTTP, HTTPS, FTP, NFS, CD-ROM, or USB. The ESXi installer can be PXE booted or from a CD/DVD or USB drive.
Introduction to the default installation script:
The default ks.cfg installation script is located in the initial memory disk of /etc/vmware/weasel/ks.cfg. If you want to modify the installation script, you can select an installed ESXi, export it and modify it. To modify the parameters, please refer to the official documentation. You can set the license, password, network and other related parameters, as follows:
#ks.cfg

# Sample scripted installation file
# Accept the VMware End User License Agreement
vmaccepteula
# Set the root password for the DCUI and Tech Support Mode
rootpw 1qaz!QAZ

# The install media is in the CD-ROM drive
install --firstdisk --overwritevmfs

# custom
vmserialnum  --esx=JA0Q0-4029Q-8ZWZ9-J28NK-1380Y
network --bootproto=static --device=vmnic0 --ip=192.168.233.150 --gateway=192.168.233.1 --nameserver=8.8.8.8 --netmask=255.255.255.0 --hostname=Test-ESXi01
# A sample post-install script
%post --interpreter=python --ignorefailure=true
import time
stampFile = open('/finished.stamp', mode='w')
stampFile.write( time.asctime() )

After modification, you need to specify the location of ks.cfg in the boot.cfg file in the ESXi installation image file.
Place the kickstart file on the TFP server Installation example:
1. Build an FTP server
ESXi scripted installation
2. Unzip the ESXi installation image in the Linux (centos) system and copy it to the NEWESXi directory Copy
the previously modified ks.cfg file to the corresponding FTP server Directory, modify the name to ks_cust.cfg, edit boot.cfg, and change the behavior where kernelopt is located kernelopt=ks=ftp://192.168.233.1/ks_cust.cfg, as shown in the following figure

After the modification is completed, rebuild the ISO image through the centos system
mkisofs -relaxed-filenames -J -R -o cust_esxi-ftp.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot -info-table /NEWESXi/

After rebuilding the image, export the new image for scripted installation without manual intervention.
Note: You can also put the ks.cfg script in CD-ROM, USB and other devices, and specify it in the boot.cfg file, for example, kernelopt=ks=cdrom:/ks.cfg.
ESXi scripted installation

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324586984&siteId=291194637