ks.cfg、ks-first.cfg和ks-first-safe.cfg 3個文件爲ESX/ESXI腳本安裝文件
官方《ESXi Installable 和 vCenter Server 安裝指南》文檔中(中文手冊) 33-64頁提到的內容但是官方的文檔沒有給出默認這3個文件的內容以及如何找到3個文件。
ks-first-safe.cfg 在第一個檢測到的磁盤上安裝 ESX並將 VMFS 數據存儲保留在該磁盤上。
ks-first.cfg 在第一個檢測到的磁盤上安裝 ESX。
ks.cfg 在第一個檢測到的磁盤上安裝 ESXi。
使用 ks-first-safe.cfg 或 ks-first.cfg 安裝 ESX 時默認根密碼爲 mypassword。
ks.cfg、ks-first.cfg和ks-first-safe.cfg文件是不可見的被壓縮在 ESX/ESXI安裝鏡像中的 initrd.img 文件中initrd.img 文件位於ESX安裝鏡像中的isolinux目錄中。
提取步驟
1.提取ESX安裝鏡像中的isolinux目錄中initrd.img文件。
2.將initrd.img文件拷貝到一臺linux系統的機器中。
3.一次執行下面的命令
mv initrd.img initrd.img.gz
gunzip initrd.img.gz
cpio -i < initrd.img
默認ks-first.cfg和ks-first-safe.cfg文件位置爲usr/lib/vmware/weasel/examples/
cd usr/lib/vmware/weasel/examples/
官方文檔中說 ks.cfg 腳本默認位於 /etc/vmware/weasel/ks.cfg。
但是小提取的時候是在usr/lib/vmware/weasel/ks.cfg
要運行默認腳本請在引導菜單上按 Tab然後鍵入 ks=file:path to file。
官方文檔中的默認腳本包含以下命令
#root Password
rootpw --iscrypted $1$MpéRëÈíÌ$n9sgFQJweS1PeSBpqRRu..
# Authconfig
authconfig --enableshadow --enablemd5
# BootLoader (Use grub by default.)
bootloader --location=mbr
# Timezone
timezone America/Los_Angeles --utc
#Install
install cdrom
#Network install type
network --device=MAC_address --bootproto=dhcp
#Keyboard
keyboard us
#Reboot after install?
reboot
# Clear partitions
clearpart --firstdisk
# Partitioning
part /boot --fstype=ext3 --size= --onfirstdisk
part storage1 --fstype=vmfs3 --size=10000 --grow --onfirstdisk
part None --fstype=vmkcore --size=100 --onfirstdisk
# Create the vmdk on the cos vmfs partition.
virtualdisk cos --size=5000 --onvmfs=storage1
# Partition the virtual disk.
part / --fstype=ext3 --size=0 --grow --onvirtualdisk=cos
part swap --fstype=swap --size=256 --onvirtualdisk=cos
#VMware Specific Commands
accepteula
serialnum --esx=XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
# Accept the VMware End User License Agreement
vmaccepteula
# Set the root password for the DCUI and Tech Support Mode
rootpw mypassword
# Choose the first discovered disk to install onto
autopart --firstdisk --overwritevmfs
# The installation media is in the CD-ROM drive
install cdrom
# Set the network to DHCP on the first network adapater
network --bootproto=dhcp --device=vmnic0
# A sample post-install script
%post --unsupported --interpreter=python --ignorefailure=true
import time
stampFile = file('/finished.stamp', mode='w'
stampFile.write( time.asctime() )
提取ESX/ESXI4.0腳本安裝文件ks.cfg、ks-first.cfg和ks-first-safe.cfg
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
Elasticsearch 評分排序
王清培
2019-02-24 10:58:01
python腳本簡化jar操作命令
神牛003
2019-02-23 17:41:06
Linux 開機自動啓動腳本方法
zhoukenny
2019-02-23 13:52:17
腳本,sudo文件添加項
慕小潮
2019-02-23 13:05:42
Flask 教程 第十九章:Docker容器上的部署
天降攻城獅
2019-02-23 10:17:16
shell腳本練習001
466716241
2019-02-23 00:42:42
複習shell腳本
13011150876
2019-02-23 00:41:11
利用shell腳本監控網站狀態
star1980
2019-02-23 00:37:53
php 獲取今日、昨日、上週、本月的起始時間戳和結束時間戳的方法
wxkxsa
2019-02-23 00:37:28
24小時熱門文章
-
再談23種設計模式(3):行爲型模式(學習筆記)
-
Power Automate Desktop 安裝完,登錄後老是提示one driver 錯誤
-
微前端學習筆記(4):從微前端到微模塊之EMP與hel-micro方案探索
-
微前端學習筆記(1):微前端總體架構概述,從微服務發微
-
985 碩士程序員,空窗 4 個月沒有 Offer!
-
一文搞懂 Spring 循環依賴
-
賽博鬥地主——使用大語言模型扮演Agent智能體玩牌類遊戲。
-
VScode右鍵打開(添加到右鍵)
-
記一次 .NET某工控視覺自動化系統 卡死分析
-
WindowsServer--SQL Server搭建主從同步實現讀寫分離 - 事務性分發