To generate additional virtual machine statistics:
- Shut down the virtual machine.
- Select the virtual machine in the Inventory.
- In the Summary tab for that virtual machine, click Edit Settings.
- In the Virtual Machine Properties dialog box, click the Options tab.
- Under Advanced, click General.
- Select the Record Statistics option.
- Click OK to save the change.
- Power on the virtual machine.
Note: The statistics are logged over the runtime of the virtual machine and the end result is a summary of all values from boot to shutdown. Use this method only if your workload is consistent and can run long enough to average out the boot time. For example, the statistics collected with a one minute boot time and a 30 second test run may not provide a good representation of the actual workload.
Alternatively, you can use the CLI tool
/bin/vmx-buildtype to collect the virtual machine statistics. This tool enables you to change the build type while the virtual machine is running. Note that the recommended method for ESXi 5.1 and later is to use Fast Suspend Resume (FSR). This FSR is usually executed immediately and does not cause any noticeable downtime. Some very large and active workloads might notice a small performance impact similar to a vMotion. You can use the tool from the ESXi Shell directly on the host where the virtual machine is running. For more information on enabling shell access, see
Using ESXi Shell in ESXi 5.0 and 5.1 (2004746).
You can also use
vmx-buildtype from another system to connect to vCenter Server and any ESXi 5.0 (or later) host. For more information, run this help command:
/bin/vmx-buildtype –help
To generate additional virtual machine statistics using the
vmx-buildtype tool:
-
Run this command and verify that the virtual machine is running on the host:
vim-cmd vmsvc/getallvms
-
Start the workload on the virtual machine from which the statistics must be gathered.
-
Run this command:
/bin/vmx-buildtype --vmname=<vm-displayname> --server localhost --buildType stats --fsr
-
Run this command and verify that the virtual machine is now running with the stats VMX/VMM:
head –n1 /vmfs/volumes/<pathtovm>/vmware.log
The option should be STATS.
-
After the test completes, run this command to stop the log collection:
/bin/vmx-buildtype --vmname=<vm-displayname> --server localhost --buildType release --fsr
-
Run this command and verify that the virtual machine is now running with the release VMX/VMM:
head –n1 /vmfs/volumes/<pathtovm>/vmware.log
The option should now be set to Release.
Note: ESXi 5.0 only supports the --ssr switch causing a Slow Suspend Resume which will stun the virtual machine while the virtual machine memory is written to disk. This may result in substantial downtime. The stun time in this case is dependent on the memory size of the virtual machine and the storage performance. ESXi 5.1 and later also support the --ssr switch should a FSR not be possible.
For information on collecting the generated logs, see
Collecting diagnostic information for VMware ESX/ESXi using the vSphere Client (653).