New-SpbmStoragePolicy
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.
Syntax
Parameters
Required | Parameter Name | Type | Position | Features | Description |
---|---|---|---|---|---|
required
|
Name | String | named |
|
Specifies the name of the capability-based policy to be created. The maximum length of the name is 80 characters. |
optional | AnyOfRuleSets | SpbmRuleSet[] | named |
|
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. |
optional | CommonRule | SpbmRule[] | named |
|
Specifies the SPBM rules from the VAIOFilter namespace only. These rules are considered with all the SPBM rule sets as common requirements. |
optional | Description | String | named |
|
Specifies the text description associated with the policy. |
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 Connect-VIServer. |
Output
VMware.VimAutomation.Storage.Types.V1.Spbm.SpbmStoragePolicyExamples
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.
Related Commands
SpbmStoragePolicy
This cmdlet exports the specified storage policy to a file.
This cmdlet returns all available requirement policies and resource policies.
This cmdlet imports a storage policy from a file.
This cmdlet creates a requirement storage policy in an SPBM server.
This cmdlet deletes storage policies.
This cmdlet overrides the current name, description, and rule sets of an existing storage policy in an SPBM server.