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
   [-AutomaticMode]
   -DynamicOptimizationConfiguration <HostGroupDOSettings>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCDynamicOptimizationConfiguration
   -DynamicOptimizationConfiguration <HostGroupDOSettings>
   [-Aggressiveness <Byte>]
   [-FrequencyMinutes <UInt32>]
   [-EnablePowerOptimization <Boolean>]
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The Set-SCDynamicOptimizationConfiguration cmdlet configures 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.

Required Parameters

-AutomaticMode

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

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

Specifies a dynamic optimization configuration object.

Type:HostGroupDOSettings
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Inherit

Indicates whether settings are inherited from the parent host group.

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

Indicates that dynamic optimization will not run automatically.

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

Optional 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
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
Accept pipeline input:False
Accept wildcard characters:False
-EnablePowerOptimization

Enables power optimization when set to $True.

Type:Boolean
Position:Named
Default value:None
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
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
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
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
Accept pipeline input:False
Accept wildcard characters:False
-VMMServer

Specifies a VMM server object.

Type:ServerConnection
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
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
Accept pipeline input:False
Accept wildcard characters:False

Outputs

DynamicOptimizationConfiguration

This cmdlet returns a DynamicOptimizationConfiguration object.