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.
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 vcenter51 -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 ESX Server is compliant with the created profile.
Test-DeployRuleSetCompliance -VMHost $esxhost
Assign...