< Back

New-SpbmStoragePolicy

Sun Jan 19, 2020 7:18 pm

NAME New-SpbmStoragePolicy



SYNOPSIS

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





SYNTAX

New-SpbmStoragePolicy [-Name] <String> [-AnyOfRuleSets <SpbmRuleSet[]>] [-CommonRule <SpbmRule[]>] [-Description

<String>] [-Server <VIServer>] [-Confirm] [-WhatIf] [<CommonParameters>]





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.





PARAMETERS

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



Required? false

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-CommonRule <SpbmRule[]>

Specifies the SPBM rules from the VAIOFilter namespace only. These rules are considered with all the SPBM rule

sets as common requirements.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Description <String>

Specifies the text description associated with the policy.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Name <String>

Specifies the name of the capability-based policy to be created. The maximum length of the name is 80

characters.



Required? true

Position? 1

Default value None

Accept pipeline input? False

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



Required? false

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? true



-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



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











RELATED LINKS

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

Export-SpbmStoragePolicy

Get-SpbmStoragePolicy

Import-SpbmStoragePolicy

Remove-SpbmStoragePolicy

Set-SpbmStoragePolicy