OpenVZ Forum


Home » General » Support » *SOLVED* Time difference between hwnode and vps
*SOLVED* Time difference between hwnode and vps [message #9031] Wed, 13 December 2006 23:27 Go to next message
randletr is currently offline  randletr
Messages: 3
Registered: December 2006
Junior Member
Hi All,

While I did see this question was asked. I didn't see a clear answer on this topic. I have a hwnode running RHEL4 and vps's all running CentOS 4. All I want is my vps's to have the same time as the HW node. In fact, I'm surprised this isn't the default. Is there a simple command to accomplish this? The manual suggests setting up a separate vps just to do NTP, which is ridiculous.

[Updated on: Fri, 15 December 2006 02:02] by Moderator

Report message to a moderator

Re: Time difference between hwnode and vps [message #9032 is a reply to message #9031] Wed, 13 December 2006 23:42 Go to previous messageGo to next message
randletr is currently offline  randletr
Messages: 3
Registered: December 2006
Junior Member
[root]# vzctl exec 1041 date 12131536
date: cannot set date: Operation not permitted
Wed Dec 13 15:36:00 MSK 2006
Re: Time difference between hwnode and vps [message #9036 is a reply to message #9031] Thu, 14 December 2006 07:31 Go to previous messageGo to next message
rickb is currently offline  rickb
Messages: 368
Registered: October 2006
Senior Member
Your timezone in the VPS is MSK; this likely differs from your HN.

Quote:

I'm surprised this isn't the default

During the redhat/centos installer, you choose the timezone for your HN. The VE template has its own preconfigured timezone. So, its very possible for the zones to differ.


To resolve the problem, You should configure your VE to have the same timezone as the HN. For example, if EST is your preferred timezone:

rm -rf /etc/localtime 2>/dev/null; unlink /etc/localtime 2>/dev/null
ln -s /usr/share/zoneinfo/EST /etc/localtime
vzctl exec 1041 rm -rf /etc/localtime 2>/dev/null
vzctl exec 1041 unlink /etc/localtime 2>/dev/null
vzctl exec 1041 ln -s /usr/share/zoneinfo/EST /etc/localtime


You can find many more exciting timezones with:

find /usr/share/zoneinfo/ | more


Hope this helps!
Rick


-------------
Common Terms I post with: http://wiki.openvz.org/Category:Definitions

UBC. Learn it, love it, live it: http://wiki.openvz.org/Proc/user_beancounters
Re: Time difference between hwnode and vps [message #9054 is a reply to message #9036] Thu, 14 December 2006 23:45 Go to previous messageGo to next message
randletr is currently offline  randletr
Messages: 3
Registered: December 2006
Junior Member
Rick,

This was *EXACTLY* what I needed. It worked perfectly. Thank you very much.
Re: Time difference between hwnode and vps [message #9082 is a reply to message #9036] Fri, 15 December 2006 20:17 Go to previous messageGo to next message
mh720 is currently offline  mh720
Messages: 7
Registered: August 2006
Junior Member
Good info, thanks! Here is a script that will do this for all your VE's on a given hardware node:

#! /bin/bash
#for f in 103 305 801 802 811 820 1037 2207 2209 2210
for f in `ls /vz/private`
do
vzctl exec $f rm -rf /etc/localtime 2>/dev/null
vzctl exec $f unlink /etc/localtime 2>/dev/null
vzctl exec $f ln -s /usr/share/zoneinfo/CST6CDT /etc/localtime
done


-mike
Re: Time difference between hwnode and vps [message #10363 is a reply to message #9082] Fri, 16 February 2007 01:10 Go to previous messageGo to next message
moby007 is currently offline  moby007
Messages: 3
Registered: February 2007
Junior Member
It would be really great if u guys would add this as a sidenote to the template creation howtos.
Re: Time difference between hwnode and vps [message #10367 is a reply to message #10363] Fri, 16 February 2007 06:49 Go to previous messageGo to next message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
Hello,

Please, if it is possible for you, add this information to wiki.
We'll appreciate it very much.

Thanks in advance,
Vasily
Re: Time difference between hwnode and vps [message #10386 is a reply to message #10367] Sat, 17 February 2007 00:22 Go to previous message
mh720 is currently offline  mh720
Messages: 7
Registered: August 2006
Junior Member

Done.

-mike
Previous Topic: *UPDATED* networking Problem venet / veth
Next Topic: *SOLVED* openvpn in VE / Debian - sarge
Goto Forum:
  


Current Time: Wed Jul 10 07:16:56 GMT 2024

Total time taken to generate the page: 0.02595 seconds