After upgrading our ESXi hosts to 7.0.1 all of our vm's now have the time sync setting checked for VMtools (Synchronize at startup and resume). We use Windows time from our Active Directory domain controllers for our vm's. How can I disable this feature or uncheck the time sync using a power CLI command versus touching several thousand vm's and manually unchecking these?
You mean like this?
@divine1 wrote:
After upgrading our ESXi hosts to 7.0.1 all of our vm's now have the time sync setting checked for VMtools (Synchronize at startup and resume). We use Windows time from our Active Directory domain controllers for our vm's. How can I disable this feature or uncheck the time sync using a power CLI command versus touching several thousand vm's and manually unchecking these?
$spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$spec.tools = New-Object VMware.Vim.ToolsConfigInfo
$spec.tools.syncTimeWithHost = $false
Get-VM |
ForEach-Object -Process {
$_.ExtensionData.ReconfigVM($spec)
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi LucD,
Thank you for the script.
So running this script would it disable the time sync with host for all the 2000 vm's?
The Get-VM returns all VMs, if there are 2000, then yes, it will change the setting for all 2000
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank you LucD
I shall try that and let you know!
Hi Guys
Anyone has luck using this script? I was trying with it but it perfectly works for ESXi older than 6.7 but I dont have luck with vSphere 7.0 U1 and later, it looks like with the change in vmtools option the settings has been changed as well.
Does anyone have a new script for vsphere 7.0 and later
Thanks & Regards!
With all respect to LucD, I think it must be
$spec.tools.syncTimeWithHostAllowed = $false
Because
$spec.tools.syncTimeWithHost = $false
will only disable child "Synchronize time periodically" setting, not the main one.
Regards
Correct, see also my reply in Solved: Re: setting syncTimeWithHost does no longer work i... - VMware Technology Network VMTN
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference