< Back

Set-SpbmEntityConfiguration

Sun Jan 19, 2020 7:20 pm

NAME Set-SpbmEntityConfiguration



SYNOPSIS

This cmdlet sets SPBM-related configuration data for VirtualMachine, HardDisk, and Datastore objects.





SYNTAX

Set-SpbmEntityConfiguration [-Configuration] <SpbmEntityConfiguration[]> [-AutoReplicationGroup]

[-ReplicationGroup <SpbmReplicationGroup>] [-Server <VIServer>] [-StoragePolicy <SpbmStoragePolicy>] [-Confirm]

[-WhatIf] [<CommonParameters>]





DESCRIPTION

This cmdlet sets SPBM-related configuration data for VirtualMachine, HardDisk, and Datastore objects. The

configuration data includes storage policy association for VirtualMachine and HardDisk objects and SPBM enablement

for Datastore objects.





PARAMETERS

-AutoReplicationGroup [<SwitchParameter>]

Specify this if you do not want to explicitly provide a replication group and instead you want to place the

entity in the default replication group decided by the VASA provider. If ReplicationGroup and

AutoReplicationGroup are both specified, an error is thrown. If none of them are specified, the entity is not

placed in any replication group.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Configuration <SpbmEntityConfiguration[]>

Specifies the configuration to modify. The supported types are SpbmDatastoreConfiguration,

SpbmVMConfiguration, and SpbmHardDiskConfiguration. This parameter supports OBN based on the names of the

associated Datastore and VirtualMachine objects. This parameter also directly accepts objects of type

Datastore, VirtualMachine, and HardDisk by silently converting them to the corresponding configuration object

through an ArgumentTransformationAttribute object.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? true



-ReplicationGroup <SpbmReplicationGroup>

Specifies the replication group in which you want to put the VirtualMachine and HardDisk objects.



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 the Connect-VIServer cmdlet.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? true



-StoragePolicy <SpbmStoragePolicy>

Specifies the storage policy that you want to apply to all Datastore, VirtualMachine, and HardDisk objects

defined in the Configuration objects. If the value is $null, removes the current policy association for the

VirtualMachine and HardDisk objects.



Required? false

Position? named

Default value None

Accept pipeline input? False

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

A list of modified objects derived from SpbmEntityConfiguration. Types include SpbmVMConfiguration,

SpbmHardDiskConfiguration, and SpbmDatastoreConfiguration. Returns one output object for each input object. For

example, if a virtual machine does not have a storage policy, the cmdlet returns a result for it with the policy

property set to $null.







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-SpbmEntityConfiguration -Configuration (Get-SpbmEntityConfiguration $datastore1) -StoragePolicy $policy



Assigns the $policy storage policy as default storage policy to the $datastore1 datastore.

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



Set-SpbmEntityConfiguration -Configuration $datastore1 -StoragePolicy $policy



Assigns the $policy storage policy as default storage policy to the $datastore1 datastore.

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



Set-SpbmEntityConfiguration -Configuration (Get-SpbmEntityConfiguration $vm1, $vm2) -StoragePolicy $policy



Associates the $policy storage policy to the $vm1 and $vm2 virtual machines.

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



Set-SpbmEntityConfiguration -Configuration (Get-SpbmEntityConfiguration $hd1) -StoragePolicy $policy



Associates the $policy storage policy to the $hd1 hard disk.

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



Set-SpbmEntityConfiguration -Configuration (Get-SpbmEntityConfiguration $vm1) -StoragePolicy $null



Removes the association of the $vm1 virtual machine from the storage policy it is associated with, if any.

-------------------------- Example 6 --------------------------



Set-SpbmEntityConfiguration -Configuration (Get-SpbmEntityConfiguration $hd1) -StoragePolicy $null



Removes the association of the $hd1 hard disk from the storage policy it is associated with, if any.

-------------------------- Example 7 --------------------------



Set-SpbmEntityConfiguration -Configuration "MyVM" -StoragePolicy $null



Removes the association of the "MyVM" virtual machine from the storage policy it is associated with, if any.

-------------------------- Example 8 --------------------------



Set-SpbmEntityConfiguration -Configuration "MyDatastore" -StoragePolicy $policy



Assigns the $policy storage policy as default storage policy to "MyDatastore" datastore.

-------------------------- Example 9 --------------------------



Set-SpbmEntityConfiguration -Configuration $vm, $hd -StoragePolicy $replicationPolicy -ReplicationGroup $sourceRg



Associates the $replicationPolicy storage policy to the $vm virtual machine and $hd hard disk, and puts them in

the $sourceRg replication group.



RELATED LINKS

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

Get-SpbmEntityConfiguration