自動分發esxi 主機系統及加載配置
Auto Deploy esxi Host
首先安裝VMwarevCenter Server服務器,同時在服務器上安裝VMware vSphere PowerCLI 和Tftpd(tftp服務器)---安裝就不詳說了
Vcenter服務器端配置
vSphere Client登陸Vcenter服務器,在插件裏啟用autoDeploy功能
進入主頁,選擇Auto Deploy
Download TFTP boot Zip,把下載的文件解壓,存放在Vcenter服務器的tftp服務的主目錄下
為Auto Deploy準備ESXi映像軟件庫.
(1) 從 VMware 網站下載包含映像配置文件的ESXi 5.0 Offline Bundle zip文件:
VMware-ESXi-5.0.0-469512-depot.zip,將其存放在
(2)打開vSphere PowerCLI命令行窗口,依次運行如下cmdlet:
設置執行策略為不限制類型 Set-ExecutionPolicy unrestricted 將映像配置文件分配給主機
連接到vCenter Server:
Connect-VIServer -Server vcenter02.nccn.int -User nccn\windy.ma -Passwordxxxxxx
添加ESXi 5.0 Blundle zip 文件:
Add-EsxSoftwareDepotD:\VMware-ESXi-5.5.0-1331820-depot.zip
然後使用Get-EsxImageProfile 檢查庫的內容.如下圖15所示ZIP文件已經被添加到庫中:
使用Auto Deploy置備主機.
(1)繼續在vSphere PowerShell 命令行下運行以下 cmdlet,使用映像配置文件ESXi-5.5.0-1331820-standard創建規則:
New-DeployRule -Name "NEO_Rule"-Item "ESXi-5.5.0-1331820-standard" –AllHosts
(2)將新規則添加到活動規則集,以使該規則可用於 Auto Deploy 服務器:
Add-DeployRule -DeployRule"NEO_Rule"
DHCP服務器端配置
在dhcp配置裏把用exsi01主機的MAC地址綁定IP為:192.168.38.150,在項選:66、67、60配置如下圖(其中66項IP為: tftp服務器也就是vcenter服務器的IP)
esxi主機配置
exsi01主機開始啟動,將會先從DHPC獲取IP,再從tftp服務器下載VMware-ESXi-5.5.0-1331820-depot再加載到內存中啟動,啟動成功後會自動加入vcenter服務器
至此,在vsphere client配置esxi01 主機,如:存儲器、網絡、DNS、加域等等
然後進入主頁,主機配置文件
創建一個配置文件--選擇從現有主機中創建配置文件,保存名為esxi01-conf
在配置文件上右擊,選擇附加主機/群集,附加給esxi01
返回vcenter服務器
連接到vCenter Server:
Connect-VIServer -Server vcenter02.nccn.int-User nccn\windy.ma -Password xxxxxx
將主機配置文件分配給主機 Get-VMhostProfile
在 PowerCLI 提示符處,定義一個規則,將具有某些屬性(例如 IP 地址範圍)的主機分配給主機配置文件。
New-DeployRule -Name"Esxi01-Conf_Rule" -Item Esxi01-Conf -Pattern"ipv4=192.168.38.150"
將規則添加到規則集。Get-deployrule Get-deployruleset Set-DeployRuleset Remove-DeployRule-delete
Add-DeployRule Esxi01-Conf_Rule
將主機分配給文件夾或群集 也可以在使用Get-Folder、Get-Cluster 或 Get-Datacenter
New-DeployRule -Name "NEOCluster"-Item "HA-DRS" -Pattern "ipv4=192.168.38.1-192.168.38.253"
此示例按名稱在文件夾中傳遞。也可以在使用 Get-Folder、Get-Cluster 或 Get-Datacenter cmdlet 檢索的文件夾、群集或數據中心對象中傳遞。
將規則添加到規則集。
Add-DeployRule NEOCluster
在esxi01主機上操作如下命令:
1. Configure each ESXi Host to use anetwork coredump collector
esxcli system coredump network set--interface-name vmk0 --server-ipv4 192.168.38.26 --server-port 6500
esxcli system coredump network set --enabletrue
esxcli system coredump network check
esxcli system coredump network get
2. Disable and delete the currentlyconfigured coredump file
esxcli system coredump file set --enable false
esxcli system coredump file remove --force
3. Disable VMkernel.Boot.autoCreateDumpFile
This is an Advanced Setting on the ESXiHost (Configuration > Software > Advanced Settings )
VMKernel---VMkernel.Boot.autoCreateDumpFile
4.
esxcli system syslog config set--loghost=tcp://192.168.38.26:514
esxcli system syslog reload
因為此配置文檔是事後補的,可能否其中有遺失的過程,如有問題請留言
本文出自 “water-ice” 博客,請務必保留此出處http://windyma.blog.51cto.com/661702/1968314
自動分發esxi 主機系統及加載配置