Set-SpbmEntityConfiguration

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.

Syntax

-Configuration  <SpbmEntityConfiguration[]>
[-AutoReplicationGroup]
[-ReplicationGroup  <SpbmReplicationGroup>]
[-Server  <VIServer[]>]
[-StoragePolicy  <SpbmStoragePolicy>]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
Configuration
SpbmEntityConfiguration[] named
  • wildcards
  • pipeline
  • 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.
    optional
    AutoReplicationGroup
    SwitchParameter named 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.
    optional
    ReplicationGroup
    SpbmReplicationGroup named Specifies the replication group in which you want to put the VirtualMachine and HardDisk objects.
    optional
    Server
    VIServer[] named
  • wildcards
  • Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of the Connect-VIServer cmdlet.
    optional
    StoragePolicy
    SpbmStoragePolicy named
  • wildcards
  • 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.

    Output

    VMware.VimAutomation.Storage.Types.V1.Spbm.SpbmEntityConfiguration

    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.

    Related Commands

    Feedback

    Was this page helpful?