I have a CentOS 6.8 EC2 instance on AWS that is up and running since 1232 days. On 11th October 2021, I found that the command 's3cmd' failed due to hardware clock drift. I debugged it and found hardware clock drift. I, then, synced the hardware clock with the system clock using 'hwclock' command in CentOS. In cron, I have, since installation, scheduled a cron job to sync system datetime using 'ntpdate' command every 15 minutes. But hardware clock synchronization was set to 'no' in ntpdate configuration. So, I enabled that too, as follows:
vi /etc/sysconfig/ntpdate
SYNC_HWCLOCK=yes
So, it looked all fine since then.
Today, while checking the machine, I found that the hardware clock was drifted by about 3 minutes, while the system time was shown correctly.
- It is an AWS Virtual Instance, so what is the role of hardware clock at hypervisor level?
- If it is at all needed to sync hardware clock, if yes, why and how frequently?
- Even after syncing the hardware clock with 'ntpdate' command every 15 seconds, from where does this hardware clock drift comes from?
- What should be done in case of Virtual machine installations done at Azure, GC, AWS etc. to ensure that hardware clock gets always synchronized correctly?
- If OS system time is correct, but hardware clock of a Virtual Machine is skewed, why 's3cmd' gives following error, since it must check on OS system time?
ERROR: S3 error: 403 (RequestTimeTooSkewed): The difference between the request time and the current time is too large.