Home > Blogs > VMware vSphere Blog

Auto Deploy Host Booting From Wrong Image Profile

A common Auto Deploy issue I come across is:  “I just added a new image profile and updated the rules on the Auto Deploy server, but when I reboot my vSphere hosts they still boot from the old image”.

This situation occurs when you update the active ruleset without updating the corresponding host entries in the auto deploy cache.  The first time a host boots the Auto Deploy server parses the host attributes against the active ruleset to determine (1) the image profile to install on the host, (2) the host profile to configure the host, and (3) the where in the vCenter inventory to add the host.  This information then gets saved in the auto deploy cache and reused on all future reboots.  The strategy behind saving this information is to reduce the load on the auto deploy server by eliminating the need to parse each hosts against the rules engine on every reboot.  With this approach each host only gets parsed against the active ruleset once (on the initial boot) after which the results  get saved and reused on all subsequent reboots.

A challenge with this approach comes anytime you make a change to the active ruleset that results in a host using a different image profile or host profile, or being assigned to a different vCenter location.  When you make changes not only do you need to update the rules in the active ruleset but you also need to update the host entries saved in the cache for the affected hosts.  This is done using the Test-DeployRuleSetCompliance cmdlet together with the Repair-DeployRuleSetCompliance cmdlet.

Use the “Test-DeployRuleSetCompliance” cmdlet to check if the host information saved on the auto deploy server is up-to-date.  This cmdlet parses the host attributes against the active ruleset and compares the results with the information saved in the cache.  If the saved information is incorrect (i.e. out of compliance) the cmdlet will return a status of “Non-Compliant” and show what needs to be updated.  If the information in the cache is correct then the command will simply return an empty string.

To update the auto deploy cache run the “Repair-DeployRuleSetCompliance” cmdlet.  To run this cmdlet you need to first run the “Test-DeployRuleSetCompliance” and then pipe the results into the “Repair-DeployRuleSetCompliance”.  The “Repair-DeployRuleSetCompliance” cmdlet updates the saved host entry in the cache and brings the host back into compliance with the active ruleset.  Note that the “Repair-DeployRuleSetCompliance” does not generate any output.  After you run the repair verify the host entry has been updated by re-running the “Test-DeployRuleSetCompliance” cmdlet.

For environments with a lot of vSphere hosts you can use a simple PowerCLI “foreach” loop to avoid having to update each host one at a time:

PowerCLI C:\> foreach ($esx in Get-VMHost) {$esx | test-deployrulesetcompliance | Repair-DeployRuleSetCompliance}

Follow me on Twitter @VMwareESXi

14 thoughts on “Auto Deploy Host Booting From Wrong Image Profile

  1. getgoldira.net

    Only do not offer your possessions in this way. The custodian could then spend that money in this kind of way
    that the earnings are as high as possible. I started to search for strategies to improve my silver amount in less amount of time.

    my page getgoldira.net

  2. diamonds

    The cut of the diamond can also be vital that you the stone’s
    value. The old chapel is the picture of the roof-raising gospel support on the Sunday of the festival.
    But in 2013 you gave her diamonds and diamonds!

  3. Affinion

    Pilots navigate their planes from one destination to further.
    They also have to kerp a track of their progress after the
    surgery. But before you even think about it, are up for doing this?

    My website; Affinion


Leave a Reply

Your email address will not be published. Required fields are marked *