Set-SCDynamicOptimizationConfiguration

Configures dynamic optimization for a host group.

Syntax

Set-SCDynamicOptimizationConfiguration
   -Inherit <Boolean>
   -DynamicOptimizationConfiguration <HostGroupDOSettings>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCDynamicOptimizationConfiguration
   -ManualMode
   -DynamicOptimizationConfiguration <HostGroupDOSettings>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCDynamicOptimizationConfiguration
   -ManualModeForDisk
   -DynamicOptimizationConfiguration <HostGroupDOSettings>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCDynamicOptimizationConfiguration
   -AutomaticMode
   -DynamicOptimizationConfiguration <HostGroupDOSettings>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCDynamicOptimizationConfiguration
   -AutomaticModeForDisk
   -DynamicOptimizationConfiguration <HostGroupDOSettings>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCDynamicOptimizationConfiguration
   -DynamicOptimizationConfiguration <HostGroupDOSettings>
   [-Aggressiveness <Byte>]
   [-DiskAggressiveness <Byte>]
   [-FrequencyMinutes <UInt32>]
   [-EnablePowerOptimization <Boolean>]
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The Set-SCDynamicOptimizationConfiguration cmdlet configures compute and storage dynamic optimization for a host group.

Examples

Example 1: Enable automatic mode for a dynamic optimization configuration

PS C:\> $HostGroup = Get-SCVMHostGroup "HostGroup01"
PS C:\> $DOConfig = Get-SCDynamicOptimizationConfiguration -VMHostGroup $HostGroup
PS C:\> Set-SCDynamicOptimizationConfiguration -DynamicOptimizationConfiguration $DOConfig -AutomaticMode

The first command gets the host group object named HostGroup01 and stores the object in the $HostGroup variable.

The second command gets the dynamic optimization configuration object for the host group stored in $HostGroup and stores the object in the $DOConfig variable.

The last command enables automatic mode for the dynamic optimization configuration stored in $DOConfig.

Example 2: Enable power optimization for a host group

PS C:\> $HostGroup = Get-SCVMHostGroup "HostGroup01"
PS C:\> $DOConfig = Get-SCDynamicOptimizationConfiguration -VMHostGroup $HostGroup
PS C:\> Set-SCDynamicOptimizationConfiguration -DynamicOptimizationConfiguration $DOConfig -EnablePowerOptimization $True

The first command gets the host group object named HostGroup01 and stores the object in the $HostGroup variable.

The second command gets the dynamic optimization configuration object for the host group stored in $HostGroup and stores the object in the $DOConfig variable.

The last command enables power optimization for the dynamic optimization configuration stored in $DOConfig.

Example 3: Enable automatic mode for a storage dynamic optimization configuration

PS C:\> $HostGroup = Get-SCVMHostGroup "HostGroup01"
PS C:\> $DOConfig = Get-SCDynamicOptimizationConfiguration -VMHostGroup $HostGroup
PS C:\> Set-SCDynamicOptimizationConfiguration -DynamicOptimizationConfiguration $DOConfig -AutomaticModeForDisk

The first command gets the host group object named HostGroup01 and stores the object in the $HostGroup variable.

The second command gets the dynamic optimization configuration object for the host group stored in $HostGroup and stores the object in the $DOConfig variable.

The last command enables automatic mode for the storage dynamic optimization configuration stored in $DOConfig.

Parameters

-Aggressiveness

Specifies the level of improvement required before migrating a virtual machine from one host to another in order to load balance virtual machines.

The higher the aggressiveness, the more resulting live migrations; the lower the aggressiveness, the fewer resulting live migrations. Valid values are: 1 through 5. The default value is 3 (Medium).

Type:Byte
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AutomaticMode

Indicates that compute dynamic optimization automatically migrates virtual machines in order to load balance.

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-AutomaticModeForDisk

Indicates that storage dynamic optimization automatically migrates virtual hard disks in order to load balance storage.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DiskAggressiveness

Specifies the level of improvement required before migrating a virtual hard disk (vhd) from one shared storage (CSV or file share) to another in order to load balance VHDs.

The higher the aggressiveness, the more VHD migrations; the lower the aggressiveness, the fewer resulting migrations. Valid values are: 1 through 5. The default value is 3 (Medium).

Type:Byte
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DynamicOptimizationConfiguration

Specifies a dynamic optimization configuration object.

Type:HostGroupDOSettings
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-EnablePowerOptimization

Enables power optimization when set to $True.

Type:Boolean
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-FrequencyMinutes

Specifies the frequency, in minutes, at which dynamic optimization will run when set to automatic mode.

Type:UInt32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Inherit

Indicates whether settings are inherited from the parent host group.

Type:Boolean
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-JobVariable

Specifies that job progress is tracked and stored in the variable named by this parameter.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ManualMode

Indicates that dynamic optimization will not run automatically.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ManualModeForDisk

Indicates that storage dynamic optimization will not run automatically.

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-PROTipID

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

Type:Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-VMMServer

Specifies a VMM server object.

Type:ServerConnection
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Outputs

DynamicOptimizationConfiguration

This cmdlet returns a DynamicOptimizationConfiguration object.