Our development team has just recently started using virtual machines to develop on and one issue we are having is keeping the clocks sync'd. I remember in the past there was an issue with ntpd not working on virtual machines. I also recall it not being a good idea to put ntpdate in as a cron. So my question is, is there another solution to this? Or am i stuck putting in ntpdate into the crontab?
Time is a little more complicated in virtual environments. I would suggest reading the vmware whitepaper on timekeeping.
They have thought this issue through quite thoroughly, including recommended options for ntp and using the vmware tools time support.
Install VMWare tools and set
tools.syncTime = "TRUE"
in your *.vmx file, this lives in your vm install dir
Vmware-Tools and time synchronization
NTP won't work in virtual machines. Period. The virtual machine clock is, well... virtual. It does not behave like the clock of a real machine, and NTP depends on that to work properly.
But the guest drivers you should install in the VM should take care of clock synchronization. At least it is with VirtualBox, and IIRC, VMWare works in the same way. Did you install the guest machine drivers?
We have had very good results with VMware's best practices for timekeeping in Linux Guests on RHEL 4.6
Basically there are a few recommendations:
Install VMware Tools
Per your distribution, modify some kernel parameters
Enable and use NTP
There is also a list of Timekeeping knowledgebase entries.
Related
I couldn´t find any information on the documentation of VMware about this topic. Any advise on where to find information on this is very appreciated.
VMware workstation, fusion and player are desktop productions that run on top of other operating systems like windows, linux and mac os. VMware ESX, ESXi run on bare metal directly. Since VMware Infrastructure 3 is built upon ESX and ESXi 3.X, it is ok for you to run workstation on top of VI3. But it should be pointed out that workstation running on VI3 won't support hardware virtualization even if your physical cpu ships with hardware virtualization solution. However, latest ESXi and even workstation support so called "nested virtualization" in non-production environment. Actually, I have a virtual ESXi 5 server that runs within my fusion 5.
Assuming that you mean that you want to run a virtualization solution (VMware Workstation) on top of another virtualization solution (VMware Infrastructure), although I'm not sure why you would want to do that instead of simply using a single virtualization solution (either Infrastructure or Workstation, depending on what your needs/goals are), I don't believe that it's blocked. To VMware Infrastructure, the guest OS that you're running Workstation on should just look like any other guest OS, albeit one that's probably using a lot of resources.
You might find someone else who is trying to accomplish the same thing in the Workstation community.
We have 3 identical HP DL380 G5 server here, one of them is running vmware-server with one VM running on it.
I've begun the process to migrate these systems to be running ESXi (the $0, "embedded" system); two of the physical machines will have %99.99 of the time exactly 1 VM, the other will have 2.
For this, the major advantage I get Disaster Recovery ability. Our tape backup system doesn't have a "bare metal" ability. I can manually copy VM images to a different server, however. Even if they are months old, they provide pretty-close-to-instant up, further recovery they would be from tape.
Being the free version, I don't get the VMWare "consolidated backup" or VMotion. And I need to do per-physical machine management. But the ESXi takes 32MB of disk, and it specifically supports the server.
With that in mind, is there any reason not to always use ESXi, if the hardware supports it? Even if you only are planning on running 1 VM on that hardware?
Well, in your case ESXi is the better choice. There are cases where you want to use VMware Server but not really for this case. This is what ESXi is for. For instance, I use VMware Server on top of my development OS so I could do testing and use different distro's etc. I wouldn't do VMware Server for a production server like you are describing, but ESXi would be the best choice.
Is it an excellent idea to virtualize the whole OS to get the ability to make backups? NO! its not... Damn hype to virtualize without the real need for it.
There are free alternatives to make backups of pretty much any OS, image or archive of your choice.
To be more precise, XSIBackup will allow you to hot backup any ESXi edition from version 5.1 and up, it backs up the guest OS while it is running, and can even transfer it to a secondary ESXi box via IP and leave it ready to be switched on:
https://33hops.com/xsibackup-vmware-esxi-backup.html
I have noticed that our VMWare VMs often have the incorrect time on them. No matter how many times I reset the time they keep on desyncing.
Has anyone else noticed this? What do other people do to keep their VM time in sync?
Edit: These are CLI linux VMs btw..
If your host time is correct, you can set the following .vmx configuration file option to enable periodic synchronization:
tools.syncTime = true
By default, this synchronizes the time every minute. To change the periodic rate, set the following option to the desired synch time in seconds:
tools.syncTime.period = 60
For this to work you need to have VMWare tools installed in your guest OS.
See http://www.vmware.com/pdf/vmware_timekeeping.pdf for more information
according to VMware's knowledge base, the actual solution depends on the Linux distro and release, in RHEL 5.3 I usually edit /etc/grub.conf and append this parameters to the kernel entry: divider=10 clocksource=acpi_pm
Then enable NTP, disable VMware time synchronization from vmware-toolbox and finally reboot the VM
A complete table with guidelines for each Linux distro can be found here:
TIMEKEEPING BEST PRACTICES FOR LINUX GUESTS
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1006427
I'll answer for Windows guests. If you have VMware Tools installed, then the taskbar's notification area (near the clock) has an icon for VMware Tools. Double-click that and set your options.
If you don't have VMware Tools installed, you can still set the clock's option for internet time to sync with some NTP server. If your physical machine serves the NTP protocol to your guest machines then you can get that done with host-only networking. Otherwise you'll have to let your guests sync with a genuine NTP server out on the internet, for example time.windows.com.
Something to note here. We had the same issue with Windows VM's running on an ESXi host. The time sync was turned on in VMWare Tools on the guest, but the guest clocks were consistently off (by about 30 seconds) from the host clock. The ESXi host was configured to get time updates from an internal time server.
It turns out we had the Internet Time setting turned on in the Windows VM's (Control Panel > Date and Time > Internet Time tab) so the guest was getting time updates from two places and the internet time was winning. We turned that off and now the guest clocks are good, getting their time exclusively from the ESXi host.
In my case we are running VMWare Server 2.02 on Windows Server 2003 R2 Standard. The Host is also Windows Server 2003 R2 Standard. I had the VMware Tools installed and set to sync the time. I did everything imaginable that I found on various internet sites. We still had horrendous drift, although it had shrunk from 15 minutes or more down to the 3 or 4 minute range.
Finally in the vmware.log I found this entry (resides in the folder as the .vmx file):
"Your host system does not guarantee synchronized TSCs across different CPUs, so please set the /usepmtimer option in your Windows Boot.ini file to ensure that timekeeping is reliable. See Microsoft KB http://support.microsoft.com/kb... for details and Microsoft KB http://support.microsoft.com/kb... for additional information."
Cause: This problem occurs when the computer has the AMD Cool'n'Quiet technology (AMD dual cores) enabled in the BIOS or some Intel multi core processors. Multi core or multiprocessor systems may encounter Time Stamp Counter (TSC) drift when the time between different cores is not synchronized. The operating systems which use TSC as a timekeeping resource may experience the issue. Newer operating systems typically do not use the TSC by default if other timers are available in the system which can be used as a timekeeping source. Other available timers include the PM_Timer and the High Precision Event Timer (HPET).
Resolution: To resolve this problem check with the hardware vendor to see if a new driver/firmware update is available to fix the issue.
Note The driver installation may add the /usepmtimer switch in the Boot.ini file.
Once this (/usepmtimer switch) was done the clock was dead on time.
This documentation solved this problem for me.
The CPU speed varies due to power saving. I originally noticed this because VMware gave me a helpful tip on my laptop, but this page mentions the same thing:
Quote from : VMWare tips and tricks
Power saving (SpeedStep, C-states, P-States,...)
Your power saving settings may interfere significantly with vmware's performance. There are several levels of power saving.
CPU frequency
This should not lead to performance degradation, outside of having the obvious lower performance when running the CPU at a lower frequency (either manually of via governors like "ondemand" or "conservative"). The only problem with varying the CPU speed while vmware is running is that the Windows clock will gain of lose time. To prevent this, specify your full CPU speed in kHz in /etc/vmware/config
host.cpukHz = 2167000
VMware experiences a lot of clock drift. This Google search for 'vmware clock drift' links to several articles.
The first hit may be the most useful for you: http://www.fjc.net/linux/linux-and-vmware-related-issues/linux-2-6-kernels-and-vmware-clock-drift-issues
When installing VMware Tools on a Windows Guest, “Time Synchronisation” is not enabled by default.
However – “best practise” is to enable time synch on Windows Guests.
There a several ways to do this from outside the VM, but I wanted to find a way to enable time sync from within the guest itself either on or after tools install.
Surprisingly, this wasn’t quite as straightforward as I expected.
(I assumed it would be posible to set this as a parameter / config option during tools install)
After a bit of searching I found a way to do this in a VMware article called “Using the VMware Tools Command-Line Interface“.
So, if time sync is disabled, you can enable it by running the following command line in the guest:
VMwareService.exe –cmd “vmx.set_option synctime 0 1″
Additional Notes
For some (IMHO stupid) reason, this utility requires you to specify the current as well as the new value
0 = disabled
1 = enabled
So – if you run this command on a machine which has this already set, you will get an error saying – “Invalid old value“.
Obviously you can “ignore” this error when run (so not a huge deal) but the current design seems a bit dumb.
IMHO it would be much more sensible if you could simply specify the value you want to set and not require the current value to be specified.
i.e.
VMwareService.exe –cmd “vmx.set_option synctime <0|1>”
In Active Directory environment, it's important to know:
All member machines synchronizes with any domain controller.
In a domain, all domain controllers synchronize from the PDC Emulator (PDCe) of that domain.
The PDC Emulator of a domain should synchronize with local or NTP.
It's important to consider this when setting the time in vmware or configuring the time sync.
Extracted from: http://www.sysadmit.com/2016/12/vmware-esxi-configurar-hora.html
I added the following job to crontab. It is hacky but i think should work.
*/5 * * * * service ntpd stop && ntpdate pool.ntp.org && service ntpd start
It stops ntpd service updates from service and starts ntpd again
I'm using VMware Workstation 6.0 for simulation of tight clusters of "blades" in a "chassis". Both the host and target OSs are Linux. Each "chassis" uses a vmnet switch as a virtual backplane, to which the virtual blades connect. Other vmnet switches are used to mediate point-to-point connections between mutiple virtual ethernet adapters on each blade VM. The chassis, and thus the VMs, are brought up and shutdown rather frequently. My scripts (python) make heavy use of the VIX api, and also manipulate the .vmx config file.
What do I gain and/or lose going from VMware Workstation to ESX? Do my scripts that use the VIX api still work? Do my rather complicated virtual network topologies, with lots of vmnet switches defined as "custom", still work the same way? Is the syntax and semantics of the .vmx config file the same between Workstation and ESX?Thanks in advance for your help.
The first thing you'll gain by switching will be a substantially more powerful platform that's running directly on the bare-metal of your server.
From my experience, moving up the VMware application stack has never been problematic (Server to Workstation to ESX). However, I would verify this by exporting all of your VMs from the workstation install to an ESX install to make sure you're not seeing any 'weird' issues related to running the high-end tool from VMware.
From my [limited] experience, scripts also carry-over cleanly: each offering moving up their product line doesn't break lower-level tools, but do add substantial improvements.
You get scalability and performance.
ESX scales much better and run much faster than any of VMware desktop products like Workstation or Player.
You should not lose anything. ESXi performs all the functions that Workstation does, plus a lot more. I use ESXi at home and Workstation on my laptop.
You will gain more fine-grained control over the virtual networks, over storage, snapshots, cloning, quiescing guest OSes, and many more advanced options in ESXi configuration.
One thing to note is the considerable expense of the ESX line compared to Workstation. If you're working for a successful company, though, the cost can easily be justified as ESX is (imho) da bomb. Also, FYI, the old free VMware Server options definitely had a whole different interface.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I'm looking to replace a couple of machines in the office with a more powerful multi-processor machine running either VMware or Microsoft's Hyper-V with a view to hosting a mix of Windows Server 2003, Windows Server 2008 and Linux operating systems. The machines are used mainly for testing ASP.Net or Perl web sites. I don't need advanced features like live migration of running systems but it would be useful to be able to restore a machine to a known state. Performance is not really a big issue either unless one is noticeable faster than the other.
My question is: Should I play safe and go with VMware or is Hyper-V mature enough to be a candidate?
VMware did recently release a free version of ESXi recently.
VMware has a few advantages:
1. VMware virtual machines are portable across different types of hardware. IIRC, Hyper-V uses the drivers from the Host OS.
2. VMware virtual machines are portable across different VMware products (although you may need to use their converter tool to go from some hosted virtual machines to ESX or ESXi).
3. The VMware platforms have been in use much longer, and are quite mature products and generally better-known for troubleshooting.
With VMware, you could develop and test a virtual machine on your local system using VMware Workstation, Fusion, Server, or Player, and then deploy it to a production server later. With Hyper-V, I believe you would have to build the virtual machine on the target box for best results. If performance isn't really that big of an issue, then VMware Server may be the best option, for it can run most .vmx machines directly and is generally a bit easier to manage; if performance becomes critical, you still have the ESX or ESXi upgrade option that you can use those same virtual machines with.
This entry talks about how Virtual Server machines will not run on Hyper-V:
http://blogs.technet.com/jhoward/archive/2008/02/28/are-vhds-compatible-between-hyper-v-and-virtual-server-and-virtual-pc.aspx
Hyper-V works quite well and even supports Linux VM's. The main advantage is that if you are already running Windows server 2008 it comes along for free whereas you have to pay for VMWare separately. I think that VM ware provides better system management tools, but that isn't really a big benefit in this particular case.
I personally have used Hyper-V for development, i.e. running a vista machine for testing on top of a server 2008 box.
My problem with Hyper-V is that it kills performance on some things on the host OS, especially A/V stuff. Whenever I would be playing music on the host OS and do something that hits the disk hard (like compiling), the music would begin skipping. Similarly, playing streaming video, you'd have to wait until it was completely downloaded before it would play without skipping.
I've since switched back to VMware and couldn't be happier.
I like vmware. One nice feature is that it runs on multiple host OS's, so you can move your guest OS onto a linux server or a windows desktop as you like.
A quick note regarding Windows Vista as a host for VMware Server, it doesn't work as well with Vista as the host OS compared to Windows XP as the host. The system pretty much locks up while VMware server 'boots' a virtual machine. After that has taken place, it isn't too bad to use. VMware Server 2.0 should fix these issues with Vista as the host OS. (I was using Vista Business RTM)
Also of note: VMware forbids any type of benchmarking to be posted on the internet unless if they authorize the data (i.e. you will not see any benchmarks that show VMware as slower than Tech X) The rumor mill states that you can see better performance with Hyper-V, xVM (Sun's enterprise version of VirtualBox) and Xen. However these things you would have to look into yourself as you won't really find anything via Google.
Necros the thread Just wanted to add my 2c since the last post has been a while.
I have been using VMWare Server since version 1.6 all the way up to 2.0.
Just out of curiosity, I tried out Hyper-V, and there's a real definitive performance gain. Hyper-V is plain faster.
Switched over 2 months ago and never looked back.