vSphere PowerCLI Reference

Add-DeployRule

Synopsis

Adds one or more rules to the rule set.

Syntax

Add-DeployRule [-DeployRule] <DeployRule[]> [[-At] <UInt32>] [-NoActivate] [<CommonParameters>]

Related Commands

Get-DeployRule
New-DeployRule
Remove-DeployRule

Detailed Description

Adds one or more rules to the working rule set and then activates the working rule set. The rule can be added at a specific index with the "-At" option, otherwise it is added to the end. If you plan on making several changes to the rule set, you can pass the "-NoActivate" option to avoid activing the rule set after every change.

A rule set is an ordered list of rules that determines what items, such as a host profile, should be associated with a host. For each type of item, AutoDeploy will find a matching rule and select the item specified in that rule. If more than one rule matches a host and the rules contain the same type of item, the item from the rule that comes first in the rule set will be used. This behaviour makes it possible to write a single generic rule that matches many hosts and then write more specific rules to override settings for specialized hosts.

The working rule set can be used to test out changes to the rule set against hosts in vCenter Server. Once you are satisfied with the rules, you can activate the working rule set to control how any new hosts that are unknown to vCenter Server will be deployed.

You must have the "AutoDeploy.RuleSet.Edit" privilege on the root folder of vCenter Server to use this cmdlet.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
DeployRuleDeployRule[]Rule(s) to add to the rule set. You can pass a DeployRule object here or the name of the rule.truetrue (ByValue)
AtUInt32Index in the rule set where you want to add the rule. The placement of the rule in the set determines its priority. Lower indexes have a higher priority.falsefalse
NoActivateSwitchParameterSpecify this parameter to add the rule to the working rule set but not to the active rule set. By default, the working rule set is activated after the change.falsefalse

Return Type

VMware.DeployAutomation.Types.DeployRuleSet

Notes

Examples

-------------- Example 1 --------------

C:\PS> Get-DeployRule "testrule" | Add-DeployRule

Get a rule named "testrule" and add it to the end of the rule set.

-------------- Example 2 --------------

C:\PS> Add-DeployRule testrule -At 0

Add a rule named "testrule" to the beginning of the rule set.


Copyright © 1998 - 2011 VMware, Inc. All rights reserved.