<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="+1"><tt>Hi CLUEbies,<br>
<br>
I want to run our office PBX/phone application server in a virtual
machine.&nbsp; The hardware machine running the PBX right now is big, noisy,
ugly and a power hog, and we hate it even though it works fine.&nbsp; I
cloned the PBX (which is based on CentOS 4.3) into a virtual machine
and fired it up.<br>
<br>
Unfortunately I forgot to stabilize the system clock, and by the end of
the day the phones were unusuable because the VM system clock/time was
wandering around and even ntpd in the VM refused to work, insisting
that it did not know what time it was.<br>
<br>
Does anyone in CLUE-land have experience with asterisk PBX running in a
virtual machine?&nbsp; What are the do's and don'ts for this?&nbsp; Do I really
need a hardware clock or a Zaptel board?&nbsp; I've read some papers like
<a class="moz-txt-link-freetext" href="http://www.usenix.org/publications/login/2007-02/pdfs/chak.pdf">http://www.usenix.org/publications/login/2007-02/pdfs/chak.pdf</a> which
states "In&nbsp;
Asterisk, conferencing requires a reliable clock to mix
audio. Such a timing&nbsp;
source is usually featured in the Digium hardware
PCI cards, or one can
<br>
choose to use the ztdummy driver. In Linux 2.6, ztdummy defaults to
using the kernel&#8217;s real-time clock ..." <br>
<br>
We have no Digium/Zaptel hardware in the server running the
virtualization software (VMWare, in this case).&nbsp; Even if I did, I
wouldn't want to give the VM access to it, because having
hardware-specific dependencies in a virtual machine kind of defeats one
of the purposes of virtualization.<br>
<br>
I've stabilized the system time in the VM by adding "clock=pit" to the
kernel's boot command line and running ntpd in the VM.&nbsp; The VM system
time appears to not diverge from the host time in my unscientific
observations (running "date" once in a while).&nbsp; The ztdummy module is
loaded.&nbsp; Ntpd gets happy (stratum 3) within a couple of minutes after
the VM boots up and stays that way indefinitely, note "stratum=3" below:<br>
<br>
[root@pbx ~]# ntpq -c rv<br>
assID=0 status=06a4 leap_none, sync_ntp, 10 events,
event_peer/strat_chg,<br>
version="ntpd <a class="moz-txt-link-abbreviated" href="mailto:4.2.0a@1.1190-r">4.2.0a@1.1190-r</a> Mon Feb 21 17:54:52 GMT 2005 (1)"?,<br>
processor="i686", system="Linux/2.6.9-34.ELsmp", leap=00, stratum=3,<br>
precision=-19, rootdelay=124.990, rootdispersion=78.539, peer=2814,<br>
refid=64.6.144.6,<br>
reftime=d1d870bf.b879a283&nbsp; Mon, Jul 25 2011 16:46:23.720, poll=10,<br>
clock=0xd1d87161.073cb3e5, state=4, offset=0.569, frequency=-16.721,<br>
noise=4.704, jitter=2.104, stability=12.984<br>
<br>
[root@pbx ~]# ntpq -np<br>
&nbsp;&nbsp;&nbsp;&nbsp; remote&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; refid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; st t when poll reach&nbsp;&nbsp; delay&nbsp;&nbsp; offset&nbsp;
jitter<br>
==============================================================================<br>
&nbsp;50.28.8.223&nbsp;&nbsp;&nbsp;&nbsp; .STEP.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 16 u&nbsp;&nbsp;&nbsp; - 1024&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp; 0.000&nbsp;&nbsp;&nbsp; 0.000
4000.00<br>
&nbsp;50.28.8.224&nbsp;&nbsp;&nbsp;&nbsp; .STEP.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 16 u&nbsp;&nbsp;&nbsp; - 1024&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp; 0.000&nbsp;&nbsp;&nbsp; 0.000
4000.00<br>
*64.6.144.6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 128.252.19.1&nbsp;&nbsp;&nbsp;&nbsp; 2 u&nbsp; 317 1024&nbsp; 377&nbsp;&nbsp; 98.730&nbsp;&nbsp;&nbsp;
0.569&nbsp;&nbsp; 2.104<br>
<br>
That offset is nice and small, a half second, which is close enough I
think.<br>
<br>
Since it's a business phone system, they don't want another disruption
while the phones go off into the weeds for an afternoon to the point
where we can no longer make &amp; receive phone calls, and then have to
revert back to the hardware PBX server anyway.<br>
<br>
Is this [virtualizing Asterisk] even possible without /dev/zap or a
hardware real time clock or timer hardware?&nbsp; What do I need to do to
ensure that this will work properly this time?&nbsp; Any suggestions?<br>
<br>
Thanks,<br>
Jim<br>
</tt></font>
<pre class="moz-signature" cols="72">-- 
Jim Ockers, P.Eng. (<a class="moz-txt-link-abbreviated" href="mailto:ockers@ockers.net">ockers@ockers.net</a>)
Contact info: <a class="moz-txt-link-freetext" href="http://www.ockers.net/msi.html">http://www.ockers.net/msi.html</a>

</pre>
</body>
</html>