Syntax
Set-VMResourceConfiguration [-Configuration] <VMResourceConfiguration[]> [-HtCoreSharing <HTCoreSharing>] [-CpuAffinity <CpuAffinity>] [-CpuReservationMhz <Int64>] [-CpuLimitMhz <Int64>] [-CpuSharesLevel <SharesLevel>] [-NumCpuShares <Int32>] [-MemReservationMB <Int64>] [-MemLimitMB <Int64>] [-MemSharesLevel <SharesLevel>] [-NumMemShares <Int32>] [-Disk <HardDisk[]>] [-NumDiskShares <Int32>] [-DiskSharesLevel <SharesLevel>] [-DiskLimitIOPerSecond <Int64>] [-WhatIf] [-Confirm] [<CommonParameters>]Related Commands
Online versionDetailed Description
Configures resource allocation between the virtual machines. To retain the current value of a setting, omit the corresponding parameter. To disable a setting (only applicable to the nullable limit settings), pass $null.Parameters
| Name | Type | Description | Required? | Pipeline Input | Default Value |
|---|---|---|---|---|---|
| Configuration | VMResourceConfiguration[] | Specify the configuration object you want to modify. | true | true (ByValue) | |
| Confirm | SwitchParameter | If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. | false | false | $true |
| CpuAffinity | CpuAffinity | Specify how virtual machine CPUs are distributed across the host physical cores (and hyperthreads if hyperthreading is enabled). This option is not allowed when the virtual machine resides on a DRS cluster, and its values are cleared when a virtual machine is migrated to a new host, because the only value of the option is in tuning the performance of a precise set of virtual machines on the same host. If you specify affinities, you must provide at least as many processor affinities as the number of virtual CPUs in the virtual machine. The valid values are NoAffinity, Cpu1, ..., Cpu63. | false | false | |
| CpuLimitMhz | Int64 | Specify the limit on CPU usage in MHz. Utilization will not exceed this limit even if there are available resources. | false | false | |
| CpuReservationMhz | Int64 | Specify the number of CPU MHz that are guaranteed available. | false | false | |
| CpuSharesLevel | SharesLevel | Specify the CPU allocation level. Used in relative allocation between virtual machines. The valid values are Custom, High, Low, and Normal. | false | false | |
| Disk | HardDisk[] | Specify the virtual hard disk you want to configure. | false | false | |
| DiskLimitIOPerSecond | Int64 | Specifies the disk limit IO per second. The valid values are in the range between 16 and 2147483647. -1 means unlimited. | false | false | |
| DiskSharesLevel | SharesLevel | Specify 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. | false | false | |
| HtCoreSharing | HTCoreSharing | Indicate 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. | false | false | |
| MemLimitMB | Int64 | Specify the limit on memory usage in MB. Utilization will not exceed this limit even if there are available resources. | false | false | |
| MemReservationMB | Int64 | Specify the number of memory MB that are guaranteed available. | false | false | |
| MemSharesLevel | SharesLevel | Specify the memory allocation level for this pool. Used in relative allocation between resource consumers. The valid values are Custom, High, Low, and Normal. | false | false | |
| NumCpuShares | Int32 | Specify the CPU allocation level for this pool. Used in relative allocation between resource consumers. This parameter is ignored unless CpuSharesLevel is set to Custom. | false | false | |
| NumDiskShares | Int32 | Specify the number of shares allocated. Used to determine resource allocation in case of resource contention. | false | false | |
| NumMemShares | Int32 | Specify the number of memory shares allocated. Used to determine resource allocation in case of resource contention. | false | false | |
| WhatIf | SwitchParameter | Indicate that the cmdlet is run only to display the changes that would be made and actually no objects are modified. | false | false |
Return Type
VMResourceConfigurationNotes
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.