Ask Your Question

How to sync up my centos vms to same time/clock??

asked 2015-02-20 12:04:57 -0500

nutshi gravatar image

updated 2015-02-20 12:05:11 -0500

I have a vm (vm1) on which i installed everything i needed and am running a cronjob every 5 hours lets say.

Now using the snapshot of this vm i create many more vms.

Now how do i ensure that my prescheduled "every 5 hours cron job" runs on all vms at the same time ?I want them to start at the same time but i am not sure how to synchronize the clock/time on all vms any pointers? My vms are running centos 7

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2015-02-20 13:47:23 -0500

smaffulli gravatar image

Independently from OpenStack, you should use an NTP service on all VMs.

edit flag offensive delete link more


from my vm i can not ping ntp servers. I am trying to see if i can copy the ntp.gunzip to one vm and then other vms use that as ntp server .

nutshi gravatar imagenutshi ( 2015-02-20 14:07:18 -0500 )edit

answered 2015-02-20 17:38:59 -0500

Sortof. If you can't get to any external ntp servers, you can setup one VM as an ntp server. Install the ntp server RPM, and add the following to your /etc/ntp.conf:

fudge stratum 10
restrict <your-local-network> mask nomodify notrap

...where <your-local-network> is whatever network your VMs are on. Then restart the ntpd service and point your other VMs at your new NTP server. :)

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2015-02-20 12:04:57 -0500

Seen: 799 times

Last updated: Feb 20 '15