Sometimes it is the small updates which improves an existing feature or enhances the current user experience that I most appreciate with a new vSphere release. One area that I recently came across while working with vSphere 6.5 is just how easy it is now to retrieve the ESXi installation date which can be useful for troubleshooting or auditing purposes. This previously required you to decode the ESXi UUID which was needed to construct the originally installation date as outlined in this VMware KB 2144905 article.
With ESXi 6.5, you can now quickly retrieve the ESXi installation date simply by using this new ESXCLI command:
esxcli system stats installtime get
Note: ESXCLI can be executed either locally within the ESXi Shell or remotely using vCLI or PowerCLI.
In case that was not enough, the Engineer who added this capability was also kind enough to add a native vSphere API to also retrieve the ESXi installation date from a programmatic approach. Under the existing ImageHostConfigManager there is now a new vSphere 6.5 API called installDate() which returns the installation date in UTC format.
To demonstrate this new vSphere API, I have created a small PowerCLI function called Get-ESXInstallDate which can be downloaded from here.
Here is an example of retrieving the installation date for a specific ESXi host:
Matt Mancini says
This is a great feature, can't tell you how many times I've needed this. Also, this command sounds like a great VCP question to me 🙂
Stan Jurena says
Hi Matt, I'm not sure what is giving you an impression that putting commands into the VCP or any certification is a great idea. Only option I would personally agree with would be "Provide a command to show time when the esxi server was installed" while providing a fully working esxi system in parallel.
Today there is no need to remember any commands, you have google or anything else all the time available - you just need to understand the logic of the system. Not 200 commands to do particular things.