您好,登錄后才能下訂單哦!
系統安裝我們一般可采用以下方式:光盤、U盤、PXE網絡等,當我們大批量安裝系統時,網絡是非常有效率的選擇。VMware ESXI是基于Linux開發的,所以它也和所有的Linux系統一樣,除了支持光盤引導安裝外,還支持基于PXE的網絡引導與安裝。PXE只是網絡安裝的引導方式,自動化的核心依賴于kickstart/autoyast/autounattend等生成的自動應答文件。
tftpd32+esxi6.0u2+kickstart+hfs+syslinux4.05
1.1 在windows服務器上,創建一個文件夾,作為TFTP服務器的工作目錄,本測試環境是windows10, 目錄是D:\esxi6。 從syslinux程序中復制pxelinux.0文件到這個目錄。
1.2 將ESXI6.0U2鏡像中的所有文件復制到D:\esxi6目錄中,復制syslinux中的MENU.C32替換D:\esxi6中的同名文件。
1.3 在D:\esxi6目錄中創建pxelinux.cfg目錄,復制esxi6.0u2鏡像中的文件 ISOLINUX.CFG到pxelinux.cfg文件夾中。
備注
如果你要為所有的服務器安裝esxi6,請將ISOLINUX.CFG更名為default。如果你要為指定的服務器安裝,請記下服務器的MAC地址(服務器上可能有多個網卡,需要記下通過網卡引導的網卡的MAC地址),并復制ISOLINUX.CFG文件,重命名為“序號+MAC地址”,其中序號用01、02、03代替,表示第1臺、第2臺服務器的順序,在序號與MAC地址之間,用短橫線代替,例如,第1臺服務器的MAC地址是F48E38873878,則文件名為01-F4-8E-38-87-38-78
注意
如果你是手動填寫相關信息,請忽略步驟1.5。 默認是kernelopt=runweasel
如果選擇自動應答,還需要修改D:\esxi6目錄中boot.cfg配置文件,修改為kernelopt=ks=http://192.168.40.1/ks.cfg
1.4 設置TFTP,打開tftpd,設置D:\esxi6為根目錄。設置IP地址的起始地址(地址應該與服務器的地址在同一網段,并且在服務器的地址之后),設置如下,紅色部分是要填寫的。
1.5 設置hfs服務。將自動應答文件ks.cfg設置可以訪問到(直接拖動文件到左邊的框中即可。其實你也可以自己架設一個http服務,如果你想手動填寫相關信息,可以忽略此步驟)
內容如下:
# # Sample scripted installation file # # Accept the VMware End User License Agreement vmaccepteula # Set the root password for the DCUI and Tech Support Mode rootpw mypassword # Install on the first local disk available on machine install --firstdisk --overwritevmfs # Set the network to DHCP on the first network adapter network --bootproto=dhcp --device=vmnic0 # A sample post-install script %post --interpreter=python --ignorefailure=true import time stampFile = open('/finished.stamp', mode='w') stampFile.write( time.asctime() )
1.6 設置防火墻允許TFTP通過防火墻或者直接關閉防火墻。
1.7 開啟網絡安裝,新建虛擬機類型選擇ESXI,設置完成后從網卡啟動,進入安裝
其實和上面的步驟一樣,做了同樣的事情。
2.1 安裝dhcp、tftp-server、syslinux、xinetd
yum install dhcp tftp-server syslinux xinetd
2.2 掛載ESXi ISO到/mnt
mount /dev/cdrom /mnt
2.3 修改vim /etc/dhcp/dhcpd.conf
ddns-update-style interim; allow booting; allow bootp; class "pxeclients" { match if substring(option vendor-class-identifier, 0, 9) = "PXEClient"; next-server 192.168.10.78; filename = "pxelinux.0"; } subnet 192.168.10.0 netmask 255.255.255.0 { range 192.168.10.100 192.168.10.110; }
2.4 啟用tftp,修改/etc/xinetd.d/tftp中的disable = yes為disable = no
service tftp { socket_type = dgram protocol = udp wait = yes user = root server = /usr/sbin/in.tftpd server_args = -s /var/lib/tftpboot disable = no per_source = 11 cps = 100 2 flags = IPv4 }
2.5 復制pxelinux.0到tftp根目錄
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
2.6 新建目錄/var/lib/tftpboot/pxelinux.cfg
mkdir /var/lib/tftpboot/pxelinux.cfg
2.7 復制ESXi ISO文件中的isolinux.cfg到/var/lib/tftpboot/pxelinux.cfg/下并改名default
cp /mnt/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default
2.8 復制ESXi ISO中的全部文件到/var/lib/tftpboot/下
cp -a /mnt/* /var/lib/tftpboot/
2.9 復制syslinux自帶的menu.c32到tftp根目錄替換掉ESXI ISO里的menu.c32。
cp /usr/share/syslinux/menu.c32 /var/lib/tftpboot/
2.10 重啟dhcp、xinetd服務
systemctl restart dhcpd
systemctl restart xinetd
2.11 自定義安裝腳本,安裝httpd,此文件可以放在任何可以通過url訪問到的地方。 編輯腳本ks.cfg
vim /var/www/html/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 mypassword # Install on the first local disk available on machine install --firstdisk --overwritevmfs # Set the network to DHCP on the first network adapter network --bootproto=dhcp --device=vmnic0 # A sample post-install script %post --interpreter=python --ignorefailure=true import time stampFile = open('/finished.stamp', mode='w') stampFile.write( time.asctime() )
2.12 編輯ESXi ISO復制過來的boot.cfg文件,添加kernelopt=ks=http://192.168.40.1/ks.cfg
bootstate=0 title=Loading ESXi installer timeout=5 kernel=/tboot.b00 kernelopt=ks=http://192.168.40.1/ks.cfg modules=/b.b00 --- /jumpstrt.gz --- /useropts.gz --- /k.b00 --- /chardevs.b00 --- /a.b00 --- /user.b00 --- /uc_intel.b00 --- /uc_amd.b00 --- /sb.v00 --- /s.v00 --- /lsi_mr3.v00 --- /lsi_msgp.v00 --- /bnxtnet.v00 --- /net_tg3.v00 --- /elxnet.v00 --- /ima_be2i.v00 --- /lpfc.v00 --- /scsi_be2.v00 --- /net_i40e.v00 --- /net_igb.v00 --- /net_ixgb.v00 --- /nmlx4_co.v00 --- /nmlx4_en.v00 --- /nmlx4_rd.v00 --- /nmlx5_co.v00 --- /qedentv.v00 --- /ima_qla4.v00 --- /misc_cni.v00 --- /net_bnx2.v00 --- /net_bnx2.v01 --- /net_cnic.v00 --- /net_qlcn.v00 --- /net_qlge.v00 --- /qlnative.v00 --- /scsi_bnx.v00 --- /scsi_bnx.v01 --- /scsi_qla.v00 --- /mtip32xx.v00 --- /scsi_meg.v00 --- /ata_pata.v00 --- /ata_pata.v01 --- /ata_pata.v02 --- /ata_pata.v03 --- /ata_pata.v04 --- /ata_pata.v05 --- /ata_pata.v06 --- /ata_pata.v07 --- /block_cc.v00 --- /ehci_ehc.v00 --- /emulex_e.v00 --- /weaselin.t00 --- /esx_dvfi.v00 --- /esx_ui.v00 --- /ipmi_ipm.v00 --- /ipmi_ipm.v01 --- /ipmi_ipm.v02 --- /lsu_hp_h.v00 --- /lsu_lsi_.v00 --- /lsu_lsi_.v01 --- /lsu_lsi_.v02 --- /lsu_lsi_.v03 --- /lsu_lsi_.v04 --- /misc_dri.v00 --- /net_e100.v00 --- /net_e100.v01 --- /net_enic.v00 --- /net_forc.v00 --- /net_mlx4.v00 --- /net_mlx4.v01 --- /net_nx_n.v00 --- /net_vmxn.v00 --- /nvme.v00 --- /ohci_usb.v00 --- /rste.v00 --- /sata_ahc.v00 --- /sata_ata.v00 --- /sata_sat.v00 --- /sata_sat.v01 --- /sata_sat.v02 --- /sata_sat.v03 --- /sata_sat.v04 --- /scsi_aac.v00 --- /scsi_adp.v00 --- /scsi_aic.v00 --- /scsi_fni.v00 --- /scsi_hps.v00 --- /scsi_ips.v00 --- /scsi_meg.v01 --- /scsi_meg.v02 --- /scsi_mpt.v00 --- /scsi_mpt.v01 --- /scsi_mpt.v02 --- /uhci_usb.v00 --- /vsan.v00 --- /vsanheal.v00 --- /vsanmgmt.v00 --- /xhci_xhc.v00 --- /tools.t00 --- /dell_con.v00 --- /xorg.v00 --- /imgdb.tgz --- /imgpayld.tgz build= updated=0
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。