VMware vSphere 5.1 Cookbook
上QQ阅读APP看书,第一时间看更新

Activating a deploy rule

The Auto Deploy rules that you create will become part of a rule set.

There are two types of rule sets:

  • Active rule set
  • Working rule set

For a newly created deploy rule to be used, it must be added to the active rule set.

How to do it…

To add the deploy rule to an active rule set, issue the following command:

Add-DeployRule -DeployRule "RuleIP-21-25"
Add-DeployRule –DeployRule "New01"

How it works…

Only rules in the active rule set are referenced by the Auto Deploy server when it receives an HTTP Boot Request. The Add-DeployRule command, by default, adds the deploy rule to both the working and active rule sets. When a machine boots for the first time, the Auto Deploy servers select the Image Profile based on a deploy rule in the active rule set. Once the Image Profile has been identified, it will be cached at the Auto Deploy server and reused during the future reboots.

There's more…

A common problem with Auto Deployed servers is that the servers sometimes boot from a wrong image or an image that doesn't contain the latest update. This happens when an Image Profile/deploy rule corresponding to an Auto Deployed server has been changed, but since the server is booting from the Auto Deploy cache, it remains unaware of the changes. We can resolve this issue by verifying the Auto Deploy cache against the active deploy rule to make sure that the cache is up-to-date and remediate it if necessary.

To verify the Auto Deploy cache against the deploy rule, use the cmdlet Test-DeployRuleSetCompliance. To remediate a host or a set of hosts with the updated Image Profile, use the cmdlet Repair-DeployRuleSetCompliance.

Read the recipe Applying an Image Profile to the Host recipe in Chapter 4, ESXi Image Builder, to learn how to use these commands.