Set-VMMemory

Configures the memory of a virtual machine.

Syntax

Set-VMMemory
   [-VMName] <String[]>
   [-Buffer <Int32>]
   [-ComputerName <String[]>]
   [-DynamicMemoryEnabled <Boolean>]
   [-MaximumAmountPerNumaNodeBytes <Int64>]
   [-MaximumBytes <Int64>]
   [-MinimumBytes <Int64>]
   [-Passthru]
   [-Priority <Int32>]
   [-ResourcePoolName <String>]
   [-StartupBytes <Int64>]
Set-VMMemory
   [-VM] <VirtualMachine[]>
   [-Buffer <Int32>]
   [-DynamicMemoryEnabled <Boolean>]
   [-MaximumAmountPerNumaNodeBytes <Int64>]
   [-MaximumBytes <Int64>]
   [-MinimumBytes <Int64>]
   [-Passthru]
   [-Priority <Int32>]
   [-ResourcePoolName <String>]
   [-StartupBytes <Int64>]
Set-VMMemory
   [-VMMemory] <VMMemory[]>
   [-Buffer <Int32>]
   [-DynamicMemoryEnabled <Boolean>]
   [-MaximumAmountPerNumaNodeBytes <Int64>]
   [-MaximumBytes <Int64>]
   [-MinimumBytes <Int64>]
   [-Passthru]
   [-Priority <Int32>]
   [-ResourcePoolName <String>]
   [-StartupBytes <Int64>]

Description

The Set-VMMemory cmdlet configures the memory of a virtual machine.

Examples

Example 1

PS C:\>Set-VMMemory TestVM -DynamicMemoryEnabled $true -MinimumBytes 64MB -StartupBytes 256MB -MaximumBytes 2GB -Priority 80 -Buffer 25

Enables dynamic memory on virtual machine TestVM, sets its minimum, startup, and maximum memory, its memory priority, and its buffer.

Parameters

-Buffer

Specifies the percentage of memory to reserve as a buffer in the virtual machine to be configured. Allowed values range from 5 to 2000.

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

-ComputerName

Specifies one or more Hyper-V hosts on which the memory of a virtual machine is to be configured. NetBIOS names, IP addresses, and fully-qualified domain names are allowable. The default is the local computer - use "localhost" or a dot (".") to specify the local computer explicitly.

Type:String[]
Position:Named
Default value:.
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DynamicMemoryEnabled

Specifies whether dynamic memory is to be enabled on the virtual machine to be configured.

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

-MaximumAmountPerNumaNodeBytes

Specifies the maximum amount of memory per NUMA node in the virtual machine to be configured.

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

-MaximumBytes

Specifies the maximum amount of memory to be used by a virtual machine which has dynamic memory enabled.

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

-MinimumBytes

Specifies the minimum amount of memory to be used by a virtual machine which has dynamic memory enabled.

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

-Passthru

Specifies that a Microsoft.Virtualization.Powershell.Memory object is to be passed through to the pipeline representing the virtual machine memory to be configured.

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

-Priority

Sets the priority for memory availability to this virtual machine relative to other virtual machines on the virtual machine host. Allowed values range from 0 to 100.

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

-ResourcePoolName

Specifies the name of the memory resource pool for this virtual machine.

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

-StartupBytes

Specifies the initial amount of memory to be assigned to a virtual machine with dynamic memory enabled, or the total amount of memory to be assigned to a virtual machine with dynamic memory disabled.

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

-VM

Specifies the virtual machine whose memory is to be configured.

Type:VirtualMachine[]
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-VMMemory

Specifies the virtual machine memory to be configured.

Type:VMMemory[]
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-VMName

Specifies the name of the virtual machine whose memory is to be configured.

Type:String[]
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:True

Outputs

None

Default

Microsoft.Virtualization.Powershell.Memory

If -PassThru is specified.