PowerCLI Reference

Set-SpbmEntityConfiguration

Synopsis

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

Syntax

Set-SpbmEntityConfiguration [-Configuration] <SpbmEntityConfiguration[]> [-SpbmEnabled <Boolean>] [-StoragePolicy <SpbmStoragePolicy>] [-AutoReplicationGroup] [-ReplicationGroup <SpbmReplicationGroup>] [-Server <VIServer>] [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Online version
Get-SpbmEntityConfiguration

Detailed Description

This cmdlet sets SPBM-related configuration data for VirtualMachine, HardDisk and Cluster objects. The configuration data includes storage policy association for VirtualMachine and HardDisk objects and SPBM enablement for Cluster objects.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
ConfigurationSpbmEntityConfiguration[]Specifies the configuration to modify. The supported types are SpbmClusterConfiguration, SpbmVMConfiguration, and SpbmHardDiskConfiguration.
This parameter supports OBN based on the names of the associated Cluster and VirtualMachine objects. This parameter also directly accepts objects of type Cluster, VirtualMachine, and HardDisk by silently converting them to the corresponding configuration object through a ArgumentTransformationAttribute object.
truetrue (ByValue)
AutoReplicationGroupSwitchParameterSpecify this if you do not want to explicitly provide a replication group and instead 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.falsefalse
ConfirmSwitchParameterIf 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.falsefalse
ReplicationGroupSpbmReplicationGroupSpecifies the replication group in which to put VirtualMachine and HardDisk objects.falsefalse
ServerVIServerSpecifies 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.falsefalse
SpbmEnabledBooleanIndicates whether to enable or disable SPBM on a cluster.
Only applicable to SpbmClusterConfiguration objects. Attempts to apply to other configuration objects are ignored.
falsefalse
StoragePolicySpbmStoragePolicySpecifies the storage policy to be applied to all VirtualMachine and HardDisk objects defined in the Configuration objects. If the value is $null, removes the current policy association.
Only applicable to VirtualMachine and HardDisk configuration objects. Attempts to apply to Cluster configuration objects are ignored.
falsefalse
WhatIfSwitchParameterIndicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falsefalse

Return Type

A list of modified objects derived from SpbmEntityConfiguration. Types include SpbmVMConfiguration, SpbmHardDiskConfiguration, SpbmClusterConfiguration. 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/index.jsp#com.vmware.vspsdk.apiref.doc/right-pane.html

Examples

-------------- Example 1 --------------

Set-SpbmEntityConfiguration -Configuration (Get-SpbmEntityConfiguration $cluster1) -SpbmEnabled $true

Enables SPBM for the $cluster1 cluster.

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

Set-SpbmEntityConfiguration -Configuration (Get-SpbmEntityConfiguration $cluster1) -SpbmEnabled $false

Disables SPBM for the $cluster1 cluster.

-------------- 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 "MyCluster" -SpbmEnabled $true

Enables SPBM for the "MyCluster" cluster.

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


Copyright © VMware, Inc. All rights reserved.