Installation guide
C H A P T E R 1 2 VMware ESX Server Resource Management
399
/proc/vmware/sched/cpu
Reading from this file reports the status information for all virtual machines in the
entire system. Each virtual CPU is displayed on its own line, with information including
uptime, time used, and resource management parameters.
/proc/vmware/config/CpuSharesPerVcpuLow
This option specifies the a numerical value for the low value. By default, this number is
500. Since this value is expressed in shares per virtual CPU, the allocation for a
uniprocessor virtual machine is 500 shares, or 1000 shares for a dual-virtual CPU
(SMP) virtual machine.
/proc/vmware/config/CpuSharesPerVcpuNormal
This option specifies the a numerical value for the normal value. By default, this
number is 1000. For a uniprocessor virtual machine, the default allocation is 1000
shares, or 2000 shares for a dual-virtual CPU (SMP) virtual machine.
/proc/vmware/config/CpuSharesPerVcpuHigh
This option specifies the a numerical value for the high value. By default, this number
is 2000. For a uniprocessor virtual machine, the default allocation is 2000 shares, or
4000 shares for a dual-virtual CPU (SMP) virtual machine.
Examples
Suppose that we are interested in the CPU allocation for the virtual machine with ID
103. To query the number of shares allocated to virtual machine 103, simply read the
file.
cat /proc/vmware/vm/103/cpu/shares
The number of shares is displayed.
1000
This indicates that virtual machine 103 is currently allocated 1,000 shares. To change
the number of shares allocated to virtual machine 103, simply write to the file. Note
that you need root privileges in order to change share allocations.
echo 2000 > /proc/vmware/vm/103/cpu/shares
You can also write to the file by specifying low, normal, or high. ESX Server writes the
numerical value for these special values.
echo high > /proc/vmware/vm/103/cpu/shares
The change can be confirmed by reading the file again.
cat /proc/vmware/vm/103/cpu/shares
The number of shares is displayed.