Friday, May 27, 2016

How to find esxi host install date

Last year I asked the same question on VMTN but could find a proper answer or way to find the original install date of an ESXi host until now. Earlier I was able to find the last upgrade/patching date by using the following commands but not the esxi install date,

#esxcli software vib list | grep -i base

or #esxcli software profile get

or using PowerCLI command,

Get-VMHostPatch *| Select ID, InstallDate, VMHostID
Note: Above commands can serve the purpose only if one didn’t install any patches or upgrade, otherwise you will get the last patch/upgrade installation date.

Today I came across a newly posted KB article #2144905 and here I found exactly what I was looking for so thought of making a note of it for future reference.

To determine the installation date of the ESXi host what you need to do is, first connect to the intended host over ssh using Putty and run the following command,

#echo -n "ESXi install date: " ; date -d @$(printf "%d" 0x$(esxcli system uuid get | cut -d \- -f1 ))
As you can see here we got the ESXi host installation date.

As one can’t remember this command all the time ;) so alternatively you can do this... get the system uid by using this command, esxcli system uuid get, here the first part of the system uid is the UNIX time in hexadecimal at the time the UUID was created (or esxi was installed), now convert this hexadecimal value to decimal (using any online converter) and now convert the decimal vale to a readable date format using any UNIX online timestams converter, .

That’s it... :)


No comments:

Post a Comment