Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to solve the problem of time non-synchronization in Windows instance

Shulou Source: shulou.com Published: 2022-06-01 00:43:47 09月30日 Update

Today, I will talk to you about how to solve the problem of Windows instance time synchronization. Many people may not know much about it. In order to let everyone know more, Xiaobian summarized the following contents for everyone. I hope everyone can gain something according to this article.

problem description

Windows instance sometimes finds that the operating system time is always 8 hours slow, and even if you manually adjust the time and time zone, it will be 8 hours behind the next instance restart.

reason

KVM handles Linux and Windows virtual machines differently in system time, and Windows requires some additional settings.

Solution 1

Add os_type attribute to Windows image.

glance image-update --property os_type="windows"

Specify explicitly that this is a windows mirror. When deploying instances through this mirror, KVM sets the appropriate parameters in its XML description file to ensure time synchronization.

Solution 2

For previously deployed Windows instance, the first method has no effect, only a little unconventional means: Hack Database!

Assuming the name of the instance to hack is win-test, use the following MySQL command:

$ use nova;

$ update instances set os_type='windows' where hostname='win-test';

$ select hostname,os_type from instances where hostname='win-test';

| hostname | os_type |

| win-test | windows |

Win-test needs to be restarted, KVM will get the modified database information, update the XML configuration, and ensure time synchronization.

After reading the above, do you have any further understanding of how to solve the Windows instance time synchronization problem? If you still want to know more knowledge or related content, please pay attention to the industry information channel, thank you for your support.

Tags: Time synchronization problem content mirror method hour system guarantee different operating system information reason parameter name command that is attribute manual means Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Shulou Tech Info Linux Redmi Shulou Technology