Is steal time accounting supported on VMware guests?

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux (all versions)
  • VMware Virtual Machine on ESXi Hypervisor

Issue

  • The steal time is reported as 0 in the /proc/stat file or top command output
  • mpstat always reports 0.00 for %steal on an overcommitted VMware hypervisor, eg:
HH:MM:SS AM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle
HH:MM:SS AM    0    2.62    0.84    2.49    0.03    0.00    0.07    0.00    0.00   93.94

Resolution

CPU steal time is reported in RHEL 8.2.z and later with package kernel-4.18.0-193.9.el8 provided on Errata RHSA-2020:4431.

The VM also must meet the following configuration requirements within the VMware management software:

  • VMware hardware revision 13 or later
  • stealclock.enable = "TRUE" option set

How to check the VM hardware revision

On the VMWare console, select the target VM. On the "Summary" tab, there should be a "Compatibility" key with a value describing the ESXi version and VM hardware version. ie:

Compatibility:	ESXi 6.5 and later (VM version 13)

How to set the configuration option

The "stealclock" option is not graphically represented in the VMWare web console. It must be added via the following method when the VM is powered off:

  1. Select the target VM
  2. Select the "Summary" tab
  3. Ensure the VM is powered OFF
  4. Under the VM summary is a "VM Hardware" card. Click on "Edit Settings..." at the bottom of this card.
  5. On the "Edit Settings" dialog, click the "VM Options" tab
  6. Expand the "Advanced" row
  7. Click "EDIT CONFIGURATION..." in the "Configuration Parameters" section
  8. Search the list of parameters for the "stealclock.enable" option.
    a. If the option is there, make sure the "Value" is set to "TRUE"
    b. If the option is not there, click "ADD CONFIGURATION PARAMS" and enter the name "stealclock.enable" and value "TRUE" and then click "OK" down the bottom to save.
    ** Use the option stealclock.enable and not "stealclock.enable". The latter may corrupt the VM's configuration.
  9. Start the VM

Root Cause

Whilst the KVM and Xen hypervisors have historically provided steal CPU stats for a long time, VMware only added this support to Linux with upstream kernel v5.7:

This was backported to RHEL under Red Hat Private Bug 1807448 - [ESXi][RHEL8]x86/vmware: Steal time accounting support and provided in RHEL 8.2 package kernel-4.18.0-193.9.el8 and later.

This support is not present in RHEL7 or earlier.

Diagnostic Steps

To confirm support, the kernel ring buffer can be checked with the dmesg command for the following line:

[    0.000000] vmware: vmware-stealtime: cpu 0, pa 1f22c000

The following command might be used in order to check whether the steal time has been accounted:

$ awk '/^cpu / { print($9) }' /proc/stat
0

If the ouptut is still 0 after a long time since boot, steal time accounting might not be supported.

Confirm the VM has the necessary configuration within the VMware management software.

SBR
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.