标签:ESXi脚本式安装
对于小型环境的部署可以选择脚本安装,简化安装过程的重复过程,安装脚本必须存储在主机可以通过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 的位置。
将kickstart文件放置到TFP服务器安装示例:
1、搭建FTP服务器
2、在Linux(centos)系统中将 ESXi安装镜像解压并复制到NEWESXi目录下
将之前修改好的ks.cfg文件复制到FTP服务器相应的目录,修改名称为ks_cust.cfg,编辑boot.cfg,更改kernelopt所在的行为 kernelopt=ks=ftp://192.168.233.1/ks_cust.cfg,如下图所示
修改完成后通过centos系统重建ISO镜像
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/
重建镜像完成后将新镜像导出即可进行脚本式安装,整个过程无需人工干预。
备注:也可将ks.cfg脚本放到CD-ROM、USB等设备中,并在boot.cfg文件中指定,例如kernelopt=ks=cdrom:/ks.cfg。
标签:ESXi脚本式安装
原文地址:http://blog.51cto.com/wangxiaokang/2105555