If we would like to quickly see which virtual machines have the option to sync time using vmware tools enabled we can use this one liner:
[sourcecode language=”powershell”]
get-view -viewtype virtualmachine -Filter @{‘Config.Tools.SyncTimeWithHost’=’True’} | select name
[/sourcecode]
After this you will receive a list with VM name that have their vm tools time sync enabled.
One more thing that is worth reading while thinking about virtual machine tools time synchronization is this:
Disabling Time Synchronization (1189)
And some more information about troubleshooting esx/esxi host system regarding ntp.
Troubleshooting NTP on ESX and ESXi (1005092)
If you would like to change policy for vm tools time sync you can see how i was changing the vmware tools upgrade policy http://wp.me/pAXaY-73 and just change 1 line in the code:
from:$spec.tools.toolsUpgradePolicy = “upgradeAtPowerCycle”
to:$spec.tools.syncTimeWithHost = $true // or $false
And this will do the trick.
1 comment
Hi The powershell that is written there to check which VMs have time sync enabled, I managed to run this script, is there a powershell so I can batch disable all VMs time sync to disabled?
Thanks
Ranj