Syntax
New-SpbmRule [-Capability] <SpbmCapability> [-Value] <Object> [-Server <VIServer>] [-WhatIf] [-Confirm] [<CommonParameters>]Related Commands
Online versionDetailed Description
This cmdlet creates an SPBM rule in the client side.Parameters
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Capability | SpbmCapability | 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. | true | false | |
Value | Object | 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. | true | false | |
AnyOfTags | Tag[] | 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. | true | false | |
Confirm | SwitchParameter | If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. | false | false | |
Server | VIServer | Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. | false | false | |
WhatIf | SwitchParameter | Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified. | false | false |
Return Type
The newly created SpbmRule objectNotes
Works only with vCenter Server 5.5 or later. For more information, see the VMware Storage Policy API Reference: https://pubs.vmware.com/vsphere-60/index.jsp#com.vmware.vspsdk.apiref.doc/right-pane.htmlExamples
-------------- 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.