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.

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) }

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.

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