VMWare turn on server on-demand, APIs? - vmware

I have a environment where I have a huge pool of machines (60 thus far en growing each day), now these machines are used in a testing environment and machines do not need to be online around the clock as were paying for CPU time so I want to create a system where our users can turn on machines without having to logon through either vSphere desktop client or the vSphere site. Now i know there are systems such as plesk and similar but these are way over the top of what we need for an internal system.
Are there any API for VMWare that lets me remotely turn on virtual machines on demand?
We are running ESXi 5.1.0 on our hosts.

Related

How VMware components work each other

I am beginner in VMware. I am trying to understand the VMware components and how it works.But I could not understand how vsphere Client access the EXSi host. Is it directly or through the VMWare VCenter server.please give any reference or explanation to get the understanding.
Using vSphere client you can connect to vCenter or directly to host. Of course if host is added to vCenter you should to connect ONLY to vCenter because vCenter should to know about any changes made on hosts. Connecting directly to host should be done ony in emergency situations (e.g. vCenter is down).
V-Center is the umbrella, under which all EXSI can be controlled. We can assume an example of a company where we have 3 physical servers installed ESXi on it and each server has as many processors cores so it can handle 5 virtual machines on it.
Now What is EXSi ---- EXSI is the product/OS/kernel which will allow you to create the environment to run multiple Servers/OS on the same hardware.
V-sphere client/V-sphere Web client --- If you have only one EXSI Server and you want to control that server functionality you need v-sphere because taking direct connection of EXSI Hardware machine will not allow you to do much with it. so the v-sphere client will give you many tools to play with it.
V-Center/VC ----- Now what if when your company has many ESXi servers as we taken for example. V-Sphere can not control all of those into one centralized platform. Here VC comes into play. VC allow you to manage all of these servers under one tool and many other functionalities which are not available in V-Sphere like Distribution switch, V-Motion(Which allow you to migrate one VM machine from Hardware to hardware in the fluctuation of time or not human noticeable time ).

Alternative to VMWare Server on Windows Server 2008 R2

Currently we are running a VMWare Server on a Windows Server 2008 R2. The hardware specs of the machine are very good. Nonetheless, performance in virtual machines is not at all acceptable when two or more virtual machines are running at the same time (just running, not performing any CPU or disk intensive tasks).
Hence we are looking for alternatives. VMWare's website is full of buzz words only, I cannot figure out if they provide a product fitting our requirements. But alternatives from other suppliers are also welcome.
There are some constraints:
The virtualization product must run on Windows 2008 R2 - the server will not be virtualized (hence esx is excluded)
Many Virtual Machines already exist. They must be usable with the new system, or the conversion process must be simple
The virtualization engine must be able to run without an interactive user session (hence VMWare Player and VirtualBox are excluded)
It must be possible to reset a machine to a snapshot and to start a machine via command line from a different (i.e. not the host) machine (something like the vmrun command)
Several machines must be able to run in parallel without causing an enormous drop in performance
Do you have some hints for that?
Have you considered Hyper-V (native hypervisor in Windows)?
However I would suggest troubleshooting the performance issues (the most common is not enough RAM for VM or host - which result in paging and poor performance)
Though I could not find a real alternative to VMWare Server with the constraints given, I could at least speed the performance up:
changing the disk policies from "Optimize for safety" to "Optimize for performance" reduced the time of most build projects by a third
installing IP version 6 protocol on the XP machines typically brought another 10%
The slowest integation testing project (installation of Dragon Naturally Seaking 12) is now done in 20 minutes instead of 2h20min.
Still, when copying larger files from the host to the virtual machine, performance is inacceptable - while copying them from a different VM on the same host works far better...
I would still consider esxi and 2008 on top of that if i would be in your place.
We used vmware server and performance is simply not comparable to esxi especially if you are using IO intensive applications.

Linux as a guest on MacOS X: VirtualBox or Parallels?

I'm going to develop mostly Django sites on a MacBook Pro and would like to use Ubuntu VMs for testing purposes.
Which product is better suited for this purpose?
Can I connect to the VM via TCP/IP (so I can have apache running on the VM and access it from Safari on my MBP)?
Thanks!
It should be possible using VMWARE FUSION. It has a good network management, and you should be able to access easily your vm via network.
I've successfully used both VirtualBox and VMWare Fusion for this. On both systems, you can set the guest up so that it has its own IP address, and connect to it via HTTP, SSH and even native file sharing, so you can mount the guest's drive as a network drive from the Mac, and vice versa. This makes it possible to do the editing on the Mac in eg Textmate, but run the server on the VM.
I can only tell you about my experiences with a Core2Quad Q6600 on VMWare Fusion 3.0. I have three boot partitions on this system (ahem yes it is a hackintosh running with the E-Fix USB).
So i can do performance measurements. I use it for sometimes very large compiler sessions. And the amazing fact was that Linux as a Guest runs without any measureable time difference on virtualised and native Linux. Windows7 on the other hand only runs with 40% on my machine and GUI is allmost non useable while the GNOME Desktop from latest Ubuntu still works fine.
Check this out. Virtual Box is free so there is nothing to loose.

How to keep a VMWare VM's clock in sync?

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

VMware ESX vs. VMware Workstation

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.