VMware Cloud Community
divine1
Contributor
Contributor

disable VMware tools disable sync for multiple vms

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?

Reply
0 Kudos
7 Replies
LucD
Leadership
Leadership

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

Reply
0 Kudos
divine1
Contributor
Contributor

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?

Reply
0 Kudos
LucD
Leadership
Leadership

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

Reply
0 Kudos
divine1
Contributor
Contributor

Thank you LucD
I shall try that and let you know!

Reply
0 Kudos
luismendez85
VMware Employee
VMware Employee

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!

Reply
0 Kudos
alnigon
Contributor
Contributor

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

 

Reply
0 Kudos
LucD
Leadership
Leadership

Reply
0 Kudos