Skip to content

Analyze and Replay IO Workloads with VMware

One of the most commonly problem in VMware migration projects is that the storage is undersized. When you want to size a new platform it is important to know the IO requirements. Unfortunately storage is often only sized for capacity, which is a great mistake. VMware offers tools you need to analyze and record workloads and replay them in the new platform. This post explains how to capture workloads with vscsiStats trace mode and replay them with I/O Analyzer.

vmware-io-analyzer

Required Tools

vscsiStats is a tool for storage profiling that is available since ESX 3.5 and bundled since ESXi 4.1. It collects and reports counters on storage activity at the virtual SCSI device level.

VMware I/O Analyzer, published as a Fling, is an integrated framework designed to measure storage performance in a virtual environment. Supplied as an virtual appliance it can be deployed easily and is ready to run in a few minutes.

Record Workloads with vscsiStats

1. Connect to an ESXi host with SSH

2. Get a list of all available worlds (Virtual Machines) and handles (Disks within a VM). You can uses vscsiStats to analyse a single disk, a virtual machine or the entire host.

root@esx01:~ $ vscsiStats -l
Virtual Machine worldGroupID: 966699, Virtual Machine Display Name: io1, Virtual Machine Config File: /vmfs/volumes/datastore1/io1/io1.vmx, {
   Virtual SCSI Disk handleID: 8196 (scsi0:0)
   Virtual SCSI Disk handleID: 8197 (scsi0:1)
}

vscsistats-list

3. In this example I want to trace a virtual machine (worldGroupID: 966699):

root@esx01:~ $ vscsiStats -t -s -w 966699
vscsiStats: Starting Vscsi stats collection for worldGroup 966699, handleID 8196 (scsi0:0)
vscsiStats: Starting Vscsi cmd tracing for worldGroup 966699, handleID 8196 (scsi0:0)
vscsi_cmd_trace_966699_8196
Success.
vscsiStats: Starting Vscsi stats collection for worldGroup 966699, handleID 8197 (scsi0:1)
vscsiStats: Starting Vscsi cmd tracing for worldGroup 966699, handleID 8197 (scsi0:1)
vscsi_cmd_trace_966699_8197
Success.

vscsistats-trace

4. To write the trace to the disk you have to use the trace channel from the output above:

root@esx01:~ $ logchannellogger vscsi_cmd_trace_966699_8197 io.trc &

5. Run your workload inside the virtual machine

6. After you've run your workload, stop vscsiStats:

root@esx01:~ $ vscsiStats -x
vscsiStats: Stopping all Vscsi stats collection for worldGroup 966699, handleID 8196 (scsi0:0)
Success.
vscsiStats: Stopping all Vscsi stats collection for worldGroup 966699, handleID 8197 (scsi0:1)
Success.

7. Convert the binary trace file to a CSV file (Required for importing to I/O Analyzer)

root@esx01:~ $ vscsiStats -e io.trc > io.csv

Replay Workloads with I/O Analyzer

  1. Download and deploy the I/O Analyzer Appliance
  2. Power-on the Appliance
  3. Configure a static IP address if you do not have a DHCP Server (DNS is required!)
  4. Open the VM console and login with username root and password vmware
  5. Connect to the appliances IP address with a webbrowser (Chrome or Firefox recommended)
  6. Select "Upload vscsi trace"
    upload-vscsi-trace
  7. Choose a name for the trace an upload the CSV File
    vscsi-trace-upload-io-analyzer
  8. Click "Upload Local File"
  9. Navigate to the Worload Configurator
    vmware-io-analyzer-workload-configurator
  10. Add the ESXi host that runs the I/O Analyzer Appliance to the "Host List" section
  11. Select the I/O Analyzer Appliance in the "Add Workload Entry" section
  12. Select Test Type "Trace Replay"
  13. Select the previously uploaded Trace
  14. Click Add
    vmware-io-analyzer-add-workload
  15. Press "Run Now" in the "Workload Configuration" section
    vmware-io-analyzer-run-workload
  16. Wait a few minutes to get the workload finished. You can view the results in the "Test Results" section
    vmware-io-analyzer-results

3 thoughts on “Analyze and Replay IO Workloads with VMware”

      1. Yes, my concern is about prediction accuracy. If analyzer just measures i\o block size and rate from source host without taking into consideration volume i\o distriburtion than it would not allow to size auto tiered storage properly.

        P.S. sorry for poor english

Leave a Reply

Your email address will not be published. Required fields are marked *