OpenVZ Forum


Home » General » Discussions » VE lo cal time
VE lo cal time [message #4876] Tue, 01 August 2006 09:56 Go to next message
devotional is currently offline  devotional
Messages: 2
Registered: July 2006
Location: Stockholm, Sweden
Junior Member
Must be getting old, cause I was sure I posted a message on this last night, but can't seem to find it. Sorry if it turns out to be a double post after all.

I am evaluating OpenVZ as a base for running multiple test environments in one server. However, the tests involves sequences where passed time has to be simulated by changing the system time. I was hoping to find a solution where time could be changed per VE, but I'm afraid I'm out of luck...? It seems system time cannot be changed at all within a VE and changing it in VE0 will naturally affect all VE's running on that HN.

I had kind of imagined a solution where each VE could keep its own offset to the system time...wouldn't that be kind of a useful feature?
Re: VE lo cal time [message #4878 is a reply to message #4876] Tue, 01 August 2006 10:50 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

Well, in theory this (virtualized time) could be done. In practice this is required very seldom so nobody cared to implement it...

The only thing you can do is to give a VE a capability to set system time (it is described somewhere in OpenVZ User's Guide). Still, it will set per-system time, for all VEs and the host system, which is probably not what you want.

If you do have some kernel programming experience, you can try to find a patch that virtualizes system time (I remember it was posted by Eric Biederman) and apply it to OpenVZ...


Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: VE lo cal time [message #5128 is a reply to message #4878] Mon, 14 August 2006 12:29 Go to previous message
devotional is currently offline  devotional
Messages: 2
Registered: July 2006
Location: Stockholm, Sweden
Junior Member
Thanks for the pointer...I managed to locate a patch made by Jeff Dike at http://lwn.net/Articles/179825/

The patch was not completely compatible with 2.6.16-026test015.2 but no big issues. However, the solution was not complete as it only worked for the gettimeofday syscall and not for time or clock_gettime. I have added code to handle those cases and are in the middle of testing this solution.

If anyone is interested in these patches, drop me a PM and I'll make it available. If our own tests works out, we will probably keep the patches up-to-date for our own system.

I have to argue that this should be a very useful feature in a virtualization environment that aims at providing multiple isolated test environments. The solution doesn't seem to be that complicated compared to the benefits - although it could be a hairy thing to try and solve things like "what should happen when the base system clock is changed?" and how to handle timers etc. But having a solution where a VE could be given an offet at start time and then not modifiable after that would be useful enough for most test scenarios.
Previous Topic: Ability to use VE as firewall? Recommended security pattern?
Next Topic: Modprobe Qemu accelerator module?
Goto Forum:
  


Current Time: Wed May 08 00:29:03 GMT 2024

Total time taken to generate the page: 0.01449 seconds