- VMware vSphere 5.5 Cookbook
- Abhilash GB
- 359字
- 2021-07-23 20:22:01
Applying an image profile to the host
The whole purpose of creating an image profile is to assign it to a host and apply it. This is particularly useful when performing upgrades or driver updates on auto-deployed ESX servers.
Getting ready
Read the recipes Downloading an ESXi offline bundle, Creating an image profile by cloning a predefined image profile, and Adding a VIB (software package) to an image profile as a preparation before you start learning how to apply an image profile to an ESXi host.
How to do it...
The following procedure will guide you through the steps required to assign and apply an image profile to an ESX server:
- Use the cmdlet
Connect-VIServer
to add the vCenter server to the PowerCLI session:Connect-VIServer -Server vcenterhost001 -User Administrator -Password pass123
- Use the
Get-VMHost
cmdlet to fetch a list of ESX servers inMaintenance
mode:Get-VMHost –State Maintenance
- Save the output of the
Get-VMHost
command to a user-defined variable:$esxhost = Get-VMHost -State Maintenance
- Use the
Apply-EsxImageProfile
cmdlet to apply the image profile to the ESX servers:Apply-ESXImageProfile -ImageProfile "Profile001" -Entities $esxhost
- Check whether the auto deployed ESX server is compliant with the created profile:
Test-DeployRuleSetCompliance -VMHost $esxhost
- If there are servers that are non-compliant, assign the compliance test output to a user-defined variable and then use that to do the repair (remediate) operation:
$compliance_result = Test-DeployRuleSetCompliance -VMHost $esxhost
- Once done, use the cmdlet
Repair-DeployRuleSetCompliance
to remediate the ESXi server:Repair-DeployRuleSetCompliance $compliance_result[0]
- Once you are done with working on the vCenter server, it is important to make sure that you disconnect the session as a best practice and to clear idle sessions:
Disconnect-VIServer –Server vcenterhost001
How it works...
Applying an image profile to an ESXi host is a way to update software changes, such as a driver update. The ESXi hosts need to be in maintenance mode for this to be done. Although the host is checked for compliance and remediated, the software change (for example, the inclusion of a newer device driver version) is not immediately seen by the ESXi host. The ESXi host will load the updated image into memory only during its next reboot.
- DB2 V9權(quán)威指南
- TypeScript入門(mén)與實(shí)戰(zhàn)
- Android應(yīng)用程序開(kāi)發(fā)與典型案例
- 兩周自制腳本語(yǔ)言
- 跟“龍哥”學(xué)C語(yǔ)言編程
- Data Analysis with Stata
- Hands-On Reinforcement Learning with Python
- SQL Server與JSP動(dòng)態(tài)網(wǎng)站開(kāi)發(fā)
- Python算法指南:程序員經(jīng)典算法分析與實(shí)現(xiàn)
- Beginning C++ Game Programming
- Go語(yǔ)言從入門(mén)到精通
- Training Systems Using Python Statistical Modeling
- C語(yǔ)言程序設(shè)計(jì)
- Google Adsense優(yōu)化實(shí)戰(zhàn)
- Managing Windows Servers with Chef