PowerCLI Reference



This cmdlet creates a requirement storage policy in an SPBM server.


New-SpbmStoragePolicy [-Name] <String> [-AnyOfRuleSets <SpbmRuleSet[]>] [-CommonRule <SpbmRule[]>] [-Description <String>] [-Server <VIServer>] [-Confirm] [-WhatIf] [<CommonParameters>]

Related Commands

Online Version

Detailed Description

This cmdlet creates a requirement storage policy in an SPBM server. A requirement policy contains requirements that are derived from tag-defined capabilities or from VMware VSAN capabilities. A policy is a collection of rule sets. A rule set references storage capabilities and defines requirements based on those capabilities. Rules from the VAIOFilter namespace are only accepted as value by the CommonRule parameter. These rules apply to all rule sets as common requirements.


NameTypeDescriptionRequired?Pipeline InputDefault Value
NameStringSpecifies the name of the capability-based policy to be created. The maximum length of the name is 80 characters.trueFalse
AnyOfRuleSetsSpbmRuleSet[]Specifies an array of rule sets that define the storage requirements. An SPBM rule with the VAIOFilter namespace cannot be added in any of these rule sets.falseTrue (ByValue)
CommonRuleSpbmRule[]Specifies the SPBM rules from the VAIOFilter namespace only. These rules are considered with all the SPBM rule sets as common requirements.falseFalse
ConfirmSwitchParameterIf 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.falseFalse
DescriptionStringSpecifies the text description associated with the policy.falseFalse
ServerVIServerSpecifies 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.falseTrue (ByValue)
WhatIfSwitchParameterIndicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falseFalse

Return Type

The newly created SpbmStoragePolicy object


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


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

New-SpbmStoragePolicy -Name "MyPolicy" -Description "MyPolicyDescription" -AnyOfRuleSets $ruleset1, $ruleset2, $ruleset3

Creates a new storage policy named "MyPolicy", with description "MyPolicyDescription" and with rule set objects $ruleset1, $ruleset2 and $ruleset3.

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

New-SpbmStoragePolicy -Name "MyPolicy" -AnyOfRuleSets (New-SpbmRuleSet -AllOfRules $rule1, $rule2, $rule3)

Creates a new storage policy named "MyPolicy" with a rule set containing rule objects $rule1, $rule2, and $rule3.

-------------------------- Example 3 --------------------------

$c = Get-SpbmCapability -Name IOFILTERS*
$cr = New-SpbmRule -Capability $c[0] -Value 10
$p = New-SpbmStoragePolicy -Name policy1 -AnyOfRuleSets (New-SpbmRuleSet -Name ruleset1 -AllOfRules @($rule1, $rule2)) -CommonRule ($cr)

Creates a storage policy with one rule set and one VAIOFilter common rule.

-------------------------- Example 4 --------------------------

Copyright © VMware, Inc. All rights reserved.