Product Announcements

Troubleshooting Auto Deploy Rules

by Kyle Gleed, Sr. Technical Marketing Manager, VMware

A common problem I come across when helping customers implement Auto Deploy is they PXE boot their hosts and instead of seeing the Auto Deploy server install ESXi  they get an error complaining that the server was unable to find a valid image profile:

image 

However, despite this error a quick check of the rules, using the PowerCLI “Get-DeployRule” cmdlet, shows that all the required  rules have been created? 

image 

From experience I find that there are typically two reasons customers run into this error: (1) either the rules have not been added to the active rule set, or (2) the rules were changed and Auto Deploy server’s cache has become stale and needs to be updated.

1.  The rules have not been added to the active rule set

You create Auto Deploy rules using the “New-DeployRule” cmdlet.  However, just because a  rule has been created doesn’t mean it will be used.  Rules are not used until you “activate” them by adding them to the active rule set using the “Add-DeployRule” cmdlet.  So remember adding rules is a 2 step procedure:  step 1 is to create a new rule and step 2 is to activate the rule by adding it to the active rule set.

In the screen shot below we can see from the “Get-DeployRule” cmdlet that three rules have been added:  AssignImage, AssignHostProfile, and AssignCluster.    However, the “Get-DeployRuleSet” cmdlet shows that none of these rules have been added to the active rule set.  (Notice that the first cmdlet looks at all the rules on the host while the second cmdlet only looks at the rules in the active rule set).

image

To activate these rules we simply need to “add” them to the active rule set, use the “Add-DeployRule” cmdlet as shown below.

image

2.  The rules have been modified but the cached entries on the Auto Deploy server have not been updated to reflect the changes.

The second issue that you may run across is that you’ve updated your rules, but you haven’t updated the Auto Deploy cache.  The first time a host boots the Auto Deploy server saves the information it used to deploy the host in it’s local cache.  This information includes the name of the  Image Profile, Host Profile and the vCenter folder/cluster.  The information is cached so that during subsequent reboots the Auto Deploy server doesn’t have to keep consulting the rules engine.  However, what this means is if you ever make a change to the active rule set , to use a different image profile, host profile, or file/cluster for example, you will need also to update the cached information on the Auto Deploy server.  Like adding rules, updating the Auto Deploy cache is a two step operation: 

Step 1, check if the host is compliant with the active rule set using the “Test-DeployRuleSetCompliance” cmdlet. 

image

In the example above I first ran the “Test-DeployRuleSetCompliance” cmdlet to see if the host was compliant with the active rule set.  The ItemList column showed the host was non-compliant, but the output was truncated, so I ran the command a second time selecting just the ItemList column to see the full output.  We see from my example that the Image Profile being used to deploy the host does not match Image profile specified by the “UpdatedEsxImageProfile” rule in the active rule set.

Step 2, to remedy the non-compliance issue I use the “Repair-DeployRuleSetCompliance” cmdlet.

image

The example above shows how I was able to correct the cached entry for the host by simply re-runing the “Test-DeployRuleSetCompliance” cmdlet and piping the output  directly into the “Repair-DeployRuleSetCompliance”.  After repairing the host I again ran the “Test-DeployRuleSetCompliance” cmdlet to verify the host is now compliant (an empty ItemList reflects a host that is compliant with the active RuleSet).

Summary

When working with Auto Deploy remember that rules must first be created using the “New-DeployRule” cmdlet and then activated using the “Add-DeployRule” cmdlet.  If you find that you have created rules, but the Auto Deploy server doesn’t seem to be using them, verify they are properly listed in the active rule set by using the “Get-DeployRuleSet” cmdlet.

Also, remember the Auto Deploy server saves the information used to deploy the hosts.  This includes the name of the  Image Profile, Host Profile and vCenter cluster.  If you ever change your rules be sure to test each host against the modified active rule set by using the “Test-DeployRuleSetCompliance” cmdlet.  If you discover that your hosts have become non-compliant, use the “Repair-DeployRuleSetCompliance” cmdlet to update the information saved on Auto Deploy server.