New-SpbmRule
This cmdlet creates an SPBM rule in the client side.There are two types of rules - capability-based rules and tag-based rules.To create a capability-based rule, perform the following steps: 1. Select an available schema namespace. To get all available schema namespaces, run Get-SpbmCapability | select Namespace -unique. 2. Choose a capability ID within the selected schema namespace by using the Get-SpbmCapability cmdlet. 3. Provide a value for the selected Capability. It can be either a scalar value or a range of values.To create a tag-based rule set, you must select at least one tag. If you select multiple tags, all specified tags should be of the same tag category. To see all available tags, run the Get-Tag cmdlet. You can use the Get-TagCategory and Get-Tag cmdlets to find a specific tag object.
Syntax
Parameters
Required | Parameter Name | Type | Position | Features | Description |
---|---|---|---|---|---|
required
|
Value | Object | 1 |
|
Specifies a capability property value. A property value is a single value or a collection of values. A single property value is expressed as a scalar value (Object), while a collection of values is expressed as a range of values (VMware.VimAutomation.VICore.Types.V1.Range), or an array (Object[]) of values. The type of each value can be Long, Int, String, Boolean, Double, DateTime, or TimeSpan. |
required
|
Capability | SpbmCapability | named |
|
Specifies an SPBM capability object. You must select one of the available capability objects for the given namespace. OBN for this object uses full name of the object, including the namespace name. You can find all available Capability objects and their data types under a namespace by using the Get-SpbmCapability cmdlet. |
optional | ProgressAction | ActionPreference | named |
|
|
optional | Server | VIServer[] | named |
|
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of the Connect-VIServer cmdlet. |
Parameters
Required | Parameter Name | Type | Position | Features | Description |
---|---|---|---|---|---|
required
|
AnyOfTags | Tag[] | named |
|
Specifies tag objects for the new rule. All specified tags should be of the same tag category. You can find all available tags by running the Get-Tag cmdlet. You can use the Get-TagCategory and Get-Tag cmdlets to find a specific tag. |
optional | ProgressAction | ActionPreference | named |
|
|
optional | Server | VIServer[] | named |
|
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of the Connect-VIServer cmdlet. |
optional | SpbmOperatorType | SpbmOperatorType | named |
|
Specifies the logical operator for the values. Currently only NOT is supported. |
Output
VMware.VimAutomation.Storage.Types.V1.Spbm.SpbmRuleExamples
Example 1
New-SpbmRule -Capability (Get-SpbmCapability -Name "VSAN.forceProvisioning") -Value $true
Creates a new SPBM rule with capability named "VSAN.forceProvisioning" and Boolean value set to true.
Example 2
New-SpbmRule -Capability (Get-SpbmCapability -Name VSAN.stripeWidth) -Value 2
Creates a new SPBM rule with capability named "VSAN.stripewidth" and integer value set to 2.
Example 3
New-SpbmRule -AnyOfTags (Get-Tag -Category "category1")
Creates a new SPBM rule with all the tags from the "category1" category.
Example 4
New-SpbmRule -AnyOfTags $tag1, $tag2
Creates a new SPBM rule with tag objects $tag1 and $tag2.
Related Commands
SpbmRule
This cmdlet creates an SPBM rule in the client side.
SpbmRuleSet
This cmdlet creates an SPBM rule set.