OpenVZ Forum


Home » Mailing lists » Users » How does the clock work in OpenVZ?
How does the clock work in OpenVZ? [message #10949] Fri, 09 March 2007 09:30 Go to next message
Wolfgang Schnerring is currently offline  Wolfgang Schnerring
Messages: 10
Registered: January 2007
Junior Member
Hello,

I'm trying to understand whether OpenVZ does anything special about
time, and thus whether I need to take care to somehow synchronize the
clocks of HN and VEs. For example, can gettimeofday(2) return
different things in the HN and in a VE?

Thanks for your help,
Wolfgang
Re: How does the clock work in OpenVZ? [message #10951 is a reply to message #10949] Fri, 09 March 2007 09:51 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

Wolfgang,

> I'm trying to understand whether OpenVZ does anything special about
> time, and thus whether I need to take care to somehow synchronize the
> clocks of HN and VEs.
no. system time is global for the whole node and its VEs.
By default, VE can not change system time (it requires CAP_SYS_TIME)

> For example, can gettimeofday(2) return
> different things in the HN and in a VE?
it can :) but only if different timezones are selected in VEs.
So you can setup ntpd on the host node and that's all.

Thanks,
Kirill
Re: How does the clock work in OpenVZ? [message #10952 is a reply to message #10951] Fri, 09 March 2007 10:27 Go to previous messageGo to next message
Wolfgang Schnerring is currently offline  Wolfgang Schnerring
Messages: 10
Registered: January 2007
Junior Member
Hello Kirill,

* Kirill Korotaev <dev@sw.ru> [2007-03-09 13:04]:
> > I'm trying to understand whether OpenVZ does anything special about
> > time, and thus whether I need to take care to somehow synchronize the
> > clocks of HN and VEs.
> no. system time is global for the whole node and its VEs.
> By default, VE can not change system time (it requires CAP_SYS_TIME)
>
> > For example, can gettimeofday(2) return
> > different things in the HN and in a VE?
> it can :) but only if different timezones are selected in VEs.
> So you can setup ntpd on the host node and that's all.

Thanks for your quick response! Now I don't need to fear asynchronity
anymore. 8-)

Wolfgang
Re: How does the clock work in OpenVZ? [message #10956 is a reply to message #10951] Fri, 09 March 2007 16:44 Go to previous message
Mike Holloway is currently offline  Mike Holloway
Messages: 8
Registered: February 2007
Junior Member
On Mar 9, 2007, at 4:04 AM, Kirill Korotaev wrote:

> Wolfgang,
>
>> I'm trying to understand whether OpenVZ does anything special about
>> time, and thus whether I need to take care to somehow synchronize the
>> clocks of HN and VEs.
> no. system time is global for the whole node and its VEs.
> By default, VE can not change system time (it requires CAP_SYS_TIME)
>
>> For example, can gettimeofday(2) return
>> different things in the HN and in a VE?
> it can :) but only if different timezones are selected in VEs.
> So you can setup ntpd on the host node and that's all.
>
> Thanks,
> Kirill


Or even better, set up ntpd inside a VE that has CAP_SYS_TIME.

vzctl set 101 --capability sys_time:on --save



-mike



>
>
Previous Topic: bash segfaulting on 2.6.18
Next Topic: syslog "kernel: BUG: unable to handle kernel NULL pointer dereference"
Goto Forum:
  


Current Time: Fri Nov 08 23:54:38 GMT 2024

Total time taken to generate the page: 0.03133 seconds