PowerCLI Reference

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

Related Commands

Online Version
Get-SpbmEntityConfiguration

Detailed 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

NameTypeDescriptionRequired?Pipeline InputDefault Value
ConfigurationSpbmEntityConfiguration[]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.trueTrue (ByValue)
AutoReplicationGroupSwitchParameterSpecify 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.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 you want to put the 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 the Connect-VIServer cmdlet.falseFalse
StoragePolicySpbmStoragePolicySpecifies 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.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, 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/index.jsp#com.vmware.vspsdk.apiref.doc/right-pane.html

Examples

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


Copyright © VMware, Inc. All rights reserved.