|
对于小型环境的部署可以选择脚本安装,简化安装过程的重复过程,安装脚本必须存储在主机可以通过HTTP、HTTPS、FTP、NFS、CD-ROM 或 USB 访问的位置中。可以以 PXE方式引导 ESXi 安装程序或从 CD/DVD 或 USB 驱动器中引导。
# 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() )
修改后需要在ESXi安装镜像文件中的boot.cfg文件中指定ks.cfg 的位置。
修改完成后通过centos系统重建ISO镜像
重建镜像完成后将新镜像导出即可进行脚本式安装,整个过程无需人工干预。 (责任编辑:IT) |


