NetRock6
asked on
Time Sync Best Practice
Hi ...
I would like to know in the KVM Virtual environment (Hypervisor1), Is it possible to set one of VMs as the time source for all other VMs and Host servers.
Thank You For your time. ;)
I would like to know in the KVM Virtual environment (Hypervisor1), Is it possible to set one of VMs as the time source for all other VMs and Host servers.
Thank You For your time. ;)
Yes, if you configure the VM as a NTP Time Server, or use an NTP Appliance, we use an NTP appliance at many sites, which connects to the internet (ntp.pool.org), and connects to 12 random NTP servers, and then provides a time source for all internal services inside the private LAN
ASKER
Thanks Andrew.
This is what I did. Setting a VM as a NTP server and then pointing the host servers to the ntp server (the VM).
But, time started drifting on the host servers and other VMs.
Using an external time source, let's say another PC on a different netwrok (VLan) and pointing the host servers and Vms to the PC (Time source), time does not drift at all. What I do not undersand is why that is the case.
Thank You for your help. ;)
This is what I did. Setting a VM as a NTP server and then pointing the host servers to the ntp server (the VM).
But, time started drifting on the host servers and other VMs.
Using an external time source, let's say another PC on a different netwrok (VLan) and pointing the host servers and Vms to the PC (Time source), time does not drift at all. What I do not undersand is why that is the case.
Thank You for your help. ;)
We've never experienced that.
BUT our VM uses an external time source to obtain it's time from random NTP servers from ntp.pool.org.
The issue you are probably experiencing is a VM clock tick obtained from the CPU on a scheduler varies, e.g. it has no hardware clock.
Were you just using a standard VM setting the time, and then using that as a NTP server ?
e.g. what was the time reference for your VM itself or external source?
That is not going to work, because VMs do not have a hardware clock.
BUT our VM uses an external time source to obtain it's time from random NTP servers from ntp.pool.org.
The issue you are probably experiencing is a VM clock tick obtained from the CPU on a scheduler varies, e.g. it has no hardware clock.
Were you just using a standard VM setting the time, and then using that as a NTP server ?
e.g. what was the time reference for your VM itself or external source?
That is not going to work, because VMs do not have a hardware clock.
ASKER
What I did is that forexample; took a VM named it as "VMNTPSRV". Then, Configured all the host Servers and VMs to sync time with VMNTPSRV and then configure VMNTPSRV to get the time from an external time source (on the another vlan). This setup leads to a time drift.
But If I set the host servers to sync time to the same external time source Not VMNTPSRV and VMs to the VMNTPSRV, there is not time drift...
Any idea what is the cause?
Thank You for your help.
But If I set the host servers to sync time to the same external time source Not VMNTPSRV and VMs to the VMNTPSRV, there is not time drift...
Any idea what is the cause?
Thank You for your help.
how much time is the VM drifting by, and over what duration, a lot ?
Maybe it's the distro, configuration.
It does not happen with our NTP appliance.
But in the above example screenshots above, you can see the jitter, against 11 different external time sources....
e.g. time is not constant against 11 time sources...
have you checked your NTP server using this software, which can show the quality of source
https://www.meinbergglobal.com/english/sw/ntp-server-monitor.htm
and compare your server against the external time source....(at the same time)
Maybe it's the distro, configuration.
It does not happen with our NTP appliance.
But in the above example screenshots above, you can see the jitter, against 11 different external time sources....
e.g. time is not constant against 11 time sources...
have you checked your NTP server using this software, which can show the quality of source
https://www.meinbergglobal.com/english/sw/ntp-server-monitor.htm
and compare your server against the external time source....(at the same time)
ASKER
Within 24 hours of monitoring, drifting around 25 min. and this creates a big issue for the in-house running software.
I am looking to find out if there is a formula for such setup as above. As, you have mentioned there is hwclock factor as well.
How would you set the hardware clock and the current system time.
On the Host, would you set the hardware clock to the current system time or set the system time from the hardware clock.
Would you set to UTC or Local Time. What is recommended. There is also time zone and DST switching.
Trying to find out what is recommended approach for example would it better to set the hardware clock in UTC.etc.
Thank you for your feedback.
I am looking to find out if there is a formula for such setup as above. As, you have mentioned there is hwclock factor as well.
How would you set the hardware clock and the current system time.
On the Host, would you set the hardware clock to the current system time or set the system time from the hardware clock.
Would you set to UTC or Local Time. What is recommended. There is also time zone and DST switching.
Trying to find out what is recommended approach for example would it better to set the hardware clock in UTC.etc.
Thank you for your feedback.
25 minutes is a lot of drift.
Have you tried different software ? the link I posted also offers a time server.
and checked th quality of your time server
We set the host to UTC.
and then use Time Zones in the VMs, if required.
Have you tried different software ? the link I posted also offers a time server.
and checked th quality of your time server
We set the host to UTC.
and then use Time Zones in the VMs, if required.
ASKER
Hi Andrew,
In the previous comment, you have mentioned setting the host to UTC.
What happens if the host is set to Local time, and how would you set the time zone in this case.
Thank you for your help.
In the previous comment, you have mentioned setting the host to UTC.
What happens if the host is set to Local time, and how would you set the time zone in this case.
Thank you for your help.
how would you set the time zones, in the VMs ?
ASKER
One of the VMs is set as NTP server, And Time zone is set as per regional settings in the VMs.
Then, What happens if the host is set to Local time, and how would you set the time zone in host servers in this case...
Thanks
Then, What happens if the host is set to Local time, and how would you set the time zone in host servers in this case...
Thanks
Keep all Host Servers in UTC.
In VMs, use Time Zone to correct time.
In VMs, use Time Zone to correct time.
ASKER
Hi Andrew,
The currently settings already are per your last commnet. I undersand this is the recommanded settings.
I was wondering, if you may know what is the result if the Host is set to the Local Not UTC.
Thank you again for sharing and your time.
The currently settings already are per your last commnet. I undersand this is the recommanded settings.
I was wondering, if you may know what is the result if the Host is set to the Local Not UTC.
Thank you again for sharing and your time.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.