Windows VM Time Issues

We've been battling with VM Time issues mainly on Win 2012R2 Server where time of a VM thats been powered off and restarted is set to GMT time even though TZ etc are correct on hardware, VM and hypervisor machine.

When I logged a support case for this I got refered to the KB article.

Is the problem going to be resolved as a permant fix in any up coming releases?

Can someone explain to me what the actual technical problem is and why VM can't get the correct time from the underlyind hypervisor?

Thanks,

Stephen..

icon

Best answer by Chandru11 August 2017, 20:33

Hi Adam,
The default timezone is UTC when a user vm is created. We cannot set the time zone to the AHV hosts time zone because the linux VM's will expect the time provided by AHV to be in UTC. If we set the hwclock to your local time zone as default for all the vm's, then linux vm's will come up with a wrong time same as Windows does with UTC. There is an enhancement work in progress to identify the OS type and feed the correct timezone accordingly but for now setting hwclock_timezone or editing the registry is the option for Windows vm's.

12 replies

Hi Stephen,
I believe the hypervisor is AHV here. If I'm right, when a windows vm boots up in AHV we provide the time in the UTC time zone but windows due to the registry settings thinks the time is given in its local timezone like PDT,EDT etc.... whatever is configured in the system. To work around the problem you can try the following command from one of the CVM's

acli vm.update hwclock_timezone=America/New_York

Please replace with correct vm name.

This will feed the time in local time zone configured on the Nutanix cluster so, if you are in EDT time zone then Windows VM will get EDT time instead of UTC time when it boots up.

Im interested in this as well. From what I can see this means that each windows vm on creation would need to be altered for the timezone workaround (either the vm itself or the guest os) . I would have thought that if the correct timezone was set on host/AHV that when a vm is created it would be set to the same timezone by default. Hence negating manual intervention.
Would like to know if Im thinking right and if there is any technical reason why it cant be that way.

Hi Adam,
The default timezone is UTC when a user vm is created. We cannot set the time zone to the AHV hosts time zone because the linux VM's will expect the time provided by AHV to be in UTC. If we set the hwclock to your local time zone as default for all the vm's, then linux vm's will come up with a wrong time same as Windows does with UTC. There is an enhancement work in progress to identify the OS type and feed the correct timezone accordingly but for now setting hwclock_timezone or editing the registry is the option for Windows vm's.

a. Open regedit.
b. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation
c. Create a new 32-bit DWORD. Right-click the white area and select New --> DWORD (32-bit Value)
d. Give the key the name RealTimeIsUniversal.
e. Double-click the key and set the value to 1.

Or on the command prompt with administrative privileges, run the following command:

Cookie policy

Cookie settings

We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.