Set-VMResourceConfiguration

This cmdlet 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.

Syntax

-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.
    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.
    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:
    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

    Feedback

    Was this page helpful?