Set-VMResourceConfiguration Command | Vmware PowerCLI Reference

Set-VMResourceConfiguration

This cmdlet configures resource allocation between the virtual machines. To retain the current value of a setting, omit the corresponding parameter. To activate a setting (only applicable to the nullable limit settings), pass $null.

Syntax

Set-VMResourceConfiguration
-Configuration < VMResourceConfiguration[] >
[-CpuAffinity < CpuAffinity > ]
[-CpuAffinityList < Int32[] > ]
[-CpuLimitMhz < Int64 > ]
[-CpuReservationMhz < Int64 > ]
[-CpuSharesLevel < SharesLevel > ]
[-Disk < HardDisk[] > ]
[-DiskLimitIOPerSecond < Int64 > ]
[-DiskSharesLevel < SharesLevel > ]
[-HtCoreSharing < HTCoreSharing > ]
[-MemLimitGB < Decimal > ]
[-MemLimitMB < Int64 > ]
[-MemReservationGB < Decimal > ]
[-MemReservationMB < Int64 > ]
[-MemSharesLevel < SharesLevel > ]
[-NumCpuShares < Int32 > ]
[-NumDiskShares < Int32 > ]
[-NumMemShares < Int32 > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
Configuration VMResourceConfiguration[] named
  • pipeline
Specifies the configuration object you want to modify.
optional CpuAffinity CpuAffinity named
The use of this parameter is deprecated. Use CpuAffinityList instead. Specifies the distribution of virtual machine CPUs across the physical cores or hyperthreads of the host. You must pass exactly as many arguments as the number of CPUs of the virtual machine. Each argument specifies the physical core or hyperthread that the virtual machine will use. Valid arguments are NoAffinity, Cpu1, ..., Cpu63. When the virtual machine resides in a DRS cluster, you cannot use CpuAffinity.
optional CpuAffinityList Int32[] named
Specifies the distribution of virtual machine CPUs across the physical cores or hyperthreads of the host. You must pass exactly as many arguments as the number of CPUs of the virtual machine. Each argument specifies the physical core or hyperthread that the virtual machine will use. Valid arguments are positive integers. To clear formerly specified arguments, pass an empty array. When the virtual machine resides in a DRS cluster, you cannot use CpuAffinityList.
optional CpuLimitMhz Int64 named
Specifies the limit on CPU usage in MHz. Utilization will not exceed this limit even if there are available resources.
optional CpuReservationMhz Int64 named
Specifies the number of CPU MHz that are guaranteed to be available.
optional CpuSharesLevel SharesLevel named
Specifies the CPU allocation level. Used in relative allocation between virtual machines. The valid values are Custom, High, Low, and Normal.
optional Disk HardDisk[] named
Specifies the virtual hard disk you want to configure.
optional DiskLimitIOPerSecond Int64 named
Specifies the disk limit IO per second. The valid values are in the range between 16 and 2147483647. -1 means unlimited.
optional DiskSharesLevel SharesLevel named
Specifies the allocation level. The level is a simplified view of shares. Levels map to a pre-determined set of numeric values for shares. If the shares value does not map to a predefined size, then the level is set as custom.
optional HtCoreSharing HTCoreSharing named
Specifies whether a virtual machine is scheduled to share a physical processor core (assuming hyperthreading is enabled on the host at all). The following values are valid: Any - (default) the virtual CPUs of this virtual machine can freely share cores with other virtual CPUs of this or other virtual machines. None - the virtual CPUs of this virtual machine have exclusive use of a processor core whenever they are scheduled to it. The other hyperthread of the core is "halted" while this virtual machine is using the core. Internal - on a virtual machine with exactly two virtual processors, the two virtual processors are allowed to share one physical core (at the discretion of the ESX scheduler), but this virtual machine never shares a core with any other virtual machine. If this virtual machine has any other number of processors than two, this setting is the same as the None setting.
optional MemLimitGB Decimal named
Specifies a memory usage limit in gigabytes (GB). If this parameter is set, utilization will not exceed the specified limit even if there are available resources.
optional MemLimitMB Int64 named
This parameter is obsolete. Use MemLimitGB instead. Specifies a memory usage limit in megabytes (MB). If this parameter is set, utilization will not exceed the specified limit even if there are available resources.
optional MemReservationGB Decimal named
Specifies the guaranteed available memory in gigabytes (GB).
optional MemReservationMB Int64 named
This parameter is obsolete. Use MemReservationGB instead. Specifies the guaranteed available memory in megabytes (MB).
optional MemSharesLevel SharesLevel named
Specifies the memory allocation level for this pool. Used in relative allocation between resource consumers. The valid values are Custom, High, Low, and Normal.
optional NumCpuShares Int32 named
Specifies the CPU allocation level for this pool. Used in relative allocation between resource consumers. This parameter is ignored unless CpuSharesLevel is set to Custom.
optional NumDiskShares Int32 named
Specifies the number of shares allocated. Used to determine resource allocation in case of resource contention.
optional NumMemShares Int32 named
Specifies the number of memory shares allocated. Used to determine resource allocation in case of resource contention.

Output

VMware.VimAutomation.ViCore.Types.V1.VM.VMResourceConfiguration

Examples

Example 1

Set-VMResourceConfiguration -Configuration $conf -CpuAffinity ([CpuAffinity]::Cpu1 -bor [CpuAffinity]::Cpu2)

Specifies two affinities for the virtual machine resource configuration in the $conf variable. Bit Or is used.

Related Commands

VM

This cmdlet retrieves the virtual machines on a vCenter Server system.

This cmdlet moves virtual machines to another location.

This cmdlet creates a new virtual machine.

This cmdlet removes the specified virtual machines from the vCenter Server system.

This cmdlet restarts the specified virtual machines.

This cmdlet modifies the configuration of the virtual machine.

This cmdlet powers on virtual machines.

This cmdlet powers off virtual machines.

This cmdlet suspends virtual machines.

This cmdlet unlocks the specified virtual machine.

VMConsoleWindow

This cmdlet opens a window to the virtual machine's console.

VMGuest

This cmdlet retrieves the guest operating systems of the specified virtual machines.

This cmdlet restarts the virtual machine guest operating systems.

This cmdlet shuts down the specified virtual machine guest OS.

This cmdlet suspends the specified guest operating systems.

VMGuestDisk

This cmdlet retrieves storage volumes as seen by the virtual machines' guest operating systems.

VMGuestFile

This cmdlet copies files and folders from and to the guest OS of the specified virtual machines using VMware Tools.

VMQuestion

This cmdlet retrieves the pending questions for the specified virtual machines.

This cmdlet answers the specified virtual machine question.

VMResourceConfiguration

This cmdlet retrieves information about the resource allocation between the selected virtual machines.

This cmdlet configures resource allocation between the virtual machines.

VMScript

This cmdlet runs a script in the guest OS of each of the specified virtual machines.

VMStartPolicy

This cmdlet retrieves the start policy of the virtual machines on a vCenter Server system.

This cmdlet modifies the virtual machine start policy.