The stun time for example is when you vmotion a virtual machine from one host to another. This is the time when memory is completely copied over to the new host where there is a slight delay, most of the time it is in milliseconds. In this blog I will focus on where to find the stun time of a virtual machine.

The migration id is the task number that is assigned to a virtual machine when it is vMotioned this is found after you migrate the virtual machine to another esxi host. It is in the Virtual Machine home directory called vmware.log. This migration id can then be used on the source and destination esxi to obtain the stun time from the hostd.log file. The key text to look for in the hostd.log file is vmDowntime referencing the migration id and adding the total from the source and destination.

vMotion the virtual machine from the source to the destination

In this example I am live vmotioning vcenter-vsan virtual machine from esxi-nuc-01.vmware.local to esxi-nuc02.vmware.local.

Download the vmware.log file from the virtual machine

Open the datastore that the virtual machine is located and download the vmware.log file

Get the migration id

I am using powershell and going to the path of the downloaded vmware.log file
For Linux type
cat vmware.log |grep "migration id"
If you have a windows box you can use the following command
Select-String “migration id” vmware.log

So the migration id 3110109356060329214

Get stun time by downloading the hostd.log from destination and source esxi hosts

Path is
/var/log/hostd.log
I used winscp to download the hostd.log file from the two esxi hosts
Then I opened the hostd.log files in notepad ++ and search for Downtime and matched it with migration id.
Note Downtime text is case sensitive when searching


Destination host below with migration id and vmDowntime is 229713 which is 229ms

Source host below with migration id and vmDowntime is 11039 which is 11ms

So 229 + 11 = Total stun time of 240ms

By Kader