< Back

Set-SpbmStoragePolicy

Sun Jan 19, 2020 7:20 pm

NAME Set-SpbmStoragePolicy



SYNOPSIS

This cmdlet overrides the current name, description, and rule sets of an existing storage policy in an SPBM server.





SYNTAX

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

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





DESCRIPTION

This cmdlet overrides the current name, description, and rule sets of an existing storage policy in an SPBM server.





PARAMETERS

-AnyOfRuleSets <SpbmRuleSet[]>

Specifies an array to overwrite the current rule sets in the policy. The SPBM rule sets should not contain

SPBM rules from the VAIOFilter namespace.



Required? false

Position? named

Default value None

Accept pipeline input? False

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 a new description for the storage policy.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Name <String>

Specifies a new name for the storage policy. The maximum length of the name is 80 characters.



Required? false

Position? named

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? False

Accept wildcard characters? true



-StoragePolicy <SpbmStoragePolicy[]>

Specifies the storage policy to modify.



Required? true

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



Set-SpbmStoragePolicy -StoragePolicy $policy -Name "NewName" -Description NewDescription



Modifies the name and description of the $policy policy object.

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



Set-SpbmStoragePolicy -StoragePolicy $policy -AnyOfRuleSets $ruleset1, $ruleset2



Updates the $policy policy object with the $ruleset1 and $ruleset2 rule set objects which overwrite the existing

rule sets in the policy.

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



$p2 = Set-SpbmStoragePolicy -StoragePolicy $p1 -CommonRule $cr



Modifies a storage policy to add a VAIOFilter rule.

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



$p2 = Set-SpbmStoragePolicy -StoragePolicy $p1 -CommonRule @()



Modifies a storage policy to remove all VAIOFilter rules.

-------------------------- Example 5 --------------------------



$p2 = Set-SpbmStoragePolicy -StoragePolicy $p1 -CommonRule @($cr1, $cr2)



Modifies a storage policy to add a VAIOFilter rule $cr2 to an existing VAIOFilter rule $cr1.



RELATED LINKS

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

Export-SpbmStoragePolicy

Get-SpbmStoragePolicy

Import-SpbmStoragePolicy

New-SpbmStoragePolicy

Remove-SpbmStoragePolicy