Score:0

Hardware Clock Drift in AWS CentOS 6.8 instance

ng flag

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.

  1. It is an AWS Virtual Instance, so what is the role of hardware clock at hypervisor level?
  2. If it is at all needed to sync hardware clock, if yes, why and how frequently?
  3. Even after syncing the hardware clock with 'ntpdate' command every 15 seconds, from where does this hardware clock drift comes from?
  4. 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?
  5. 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.

cn flag
If your instance has been up for 1232 days, how are you patching the kernel? Also, Centos 6 was completely out of support/EOL in November 2020... Lastly, why use `s3cmd` over the official AWS CLI?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.