< Back

New-SpbmRule

Sun Jan 19, 2020 7:18 pm

NAME New-SpbmRule



SYNOPSIS

This cmdlet creates an SPBM rule in the client side.





SYNTAX

New-SpbmRule -AnyOfTags <Tag[]> [-Server <VIServer>] [-Confirm] [-WhatIf] [-SpbmOperatorType <SpbmOperatorType>]

[<CommonParameters>]



New-SpbmRule [-Capability] <SpbmCapability> [-Value] <Object> [-Server <VIServer>] [-Confirm] [-WhatIf]

[<CommonParameters>]





DESCRIPTION

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.





PARAMETERS

-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.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? true



-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.



Required? true

Position? 1

Default value None

Accept pipeline input? False

Accept wildcard characters? true



-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 the Connect-VIServer cmdlet.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? true



-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.



Required? true

Position? 2

Default value None

Accept pipeline input? False

Accept wildcard characters? 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.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are

modified.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-SpbmOperatorType <SpbmOperatorType>

Specifies the logical operator for the values. Currently only NOT is supported.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

The newly created SpbmRule object







NOTES





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/inde ... -pane.html



-------------------------- 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 LINKS

Online Version: https://code.vmware.com/doc/preview?id= ... mRule.html