6.7

Table Of Contents
4 Define a rule in which hosts with certain attributes, for example a range of IP addresses, are assigned
to the script bundle.
New-DeployRule -Name "testrule4" -Item "MyScriptBundle" -Pattern "vendor=Acme,Zven", "ipv4=192.XXX.
1.10-192.XXX.1.20"
Double quotes are required if a name contains spaces, optional otherwise. Specify -AllHosts
instead of a pattern to apply the item to all hosts.
You create a rule named testrule4. The rule assigns the script bundle named My Script Bundle to all
hosts with a vendor of Acme or Zven that also have an IP address in the specified range. You can use
the name identifier of the script bundle or the object returned by the Get-ScriptBundle cmdlet to
identify the script bundle you want to associate with the rule.
5 Add the rule to the rule set.
Add-DeployRule testrule4
By default, the rule is added to both the working rule set and the active rule set. If you use the
NoActivate parameter, the working rule set does not become the active rule set.
What to do next
n
For hosts already provisioned with vSphere Auto Deploy, perform the compliance testing and repair
operations to provision them with the new scripts. See Test and Repair Rule Compliance.
n
Turn on unprovisioned hosts to provision them with the new scripts.
Test and Repair Rule Compliance
When you add a rule to the vSphere Auto Deploy rule set or make changes to one or more rules, hosts
are not updated automatically. vSphere Auto Deploy applies the new rules only when you test their rule
compliance and perform remediation.
Prerequisites
n
Prepare Your System for vSphere Auto Deploy
n
Verify that your infrastructure includes one or more ESXi hosts provisioned with vSphere Auto Deploy,
and that the host on which you installed PowerCLI can access those ESXi hosts.
Procedure
1 In a PowerCLI session, run the Connect-VIServer cmdlet to connect to the vCenter Server system
that vSphere Auto Deploy is registered with.
Connect-VIServer ipv4_or_ipv6_address
The cmdlet might return a server certificate warning. In a production environment, make sure no
server certificate warnings result. In a development environment, you can ignore the warning.
VMware ESXi Installation and Setup
VMware, Inc. 122