Syntax
New-SpbmStoragePolicy [-Name] <String> [-Description <String>] [-AnyOfRuleSets <SpbmRuleSet[]>] [-CommonRule <SpbmRule[]>] [-Server <VIServer>] [-WhatIf] [-Confirm] [<CommonParameters>]Related Commands
Online versionDetailed 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.Parameters
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Name | String | Specifies the name of the capability-based policy to be created. The maximum length of the name is 80 characters. | true | false | |
AnyOfRuleSets | SpbmRuleSet[] | 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. | false | true (ByValue) | |
CommonRule | SpbmRule[] | Specifies the SPBM rules from the VAIOFilter namespace only. These rules are considered with all the SPBM rule sets as common requirements. | false | 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 | |
Description | String | Specifies the text description associated with the policy. | 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 | true (ByValue) | |
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 SpbmStoragePolicy 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-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.