Enable Management API in VMWare vSphere Hypervisor - vmware

I am using the free version of vmWares vSphere Hypervision 6.
The problem I have is that I want to use the Management API.
I want to start and stop vm's and also take and reset to snapshots via scripts but the API is read-only for the free version.
I used the sample scripts from https://github.com/vmware/pyvmomi
The scripts with write access are failing with
Caught vmodl fault : Current license or ESXi version prohibits execution of the requested operation.
Is there a way to enable this or another way to access this api or do I have to buy the Standard license?

You must pay to use any write mode operations in the vSphere API. If you run the HostSystem in demo mode which works for 60 days you can use the full API, the same goes for vCenter, but after those 60 days are up you will loose the write mode API features.
Edit
Here is a KB article. Its old but still valid and this part applies today:http://kb.vmware.com/kb/1023990
Notes:
vCLI, PowerCLI, and vSphere SDK for Perl are limited to read-only access for the free vSphere Hypervisor edition. To enable full functionality of vCLI on a VMware ESXi host, the host must be licensed with vSphere Essentials, vSphere Essential Plus, vSphere Standard, vSphere Advanced, vSphere Enterprise, or vSphere Enterprise Plus.
Where it says for Perl should just be vSphere SDK.

Related

VIX API clone call - the operation is not supported for the specified parameters

I have 2 instances of ESXi host and vCenter. I installed VIX API package on my Ubuntu 16.04 and tried to clone a VM. To do it i used the sample from documentation.
Unfortunately, my program crashes with this message after executing the code below (connection to host and opening vm processes work properly):
"The operation is not supported for the specified parameters"
The code:
jobHandle = VixVM_Clone(vmHandle,
VIX_INVALID_HANDLE,
VIX_CLONETYPE_FULL,
"[datastore1] mytemp-21_linked/mytemp-21_linked.vmx",
0,
VIX_INVALID_HANDLE,
NULL,
NULL);
Worth noting, in the doc sample VIX_SERVICEPROVIDER_VMWARE_WORKSTATION host type is used, by i've not found any info about restrictions for ESXi and vCenter (VIX_SERVICEPROVIDER_VMWARE_VI_SERVER type) and it should be supported too.
What's wrong with my call?
Also, I saw something similar there, but there are quite bad description of the problem.
Clone from VIXAPI operation is NOT supported under VMware Server. I faced the same issue, while connecting to the host, the host-type should be set and connected through VIX_SERVICEPROVIDER_VMWARE_WORKSTATION.
You can find the full compatibility matrix at here, or under Requirements in the support document as you listed above where it mentions: "VMware Workstation 6.5 (not supported on VMware Server)"
As YSK mentioned in the comments above this is the last VIX SDK release supported for vSphere. A set of VIX Guest Operation APIs have been integrated in vSphere WebServices SDK. Here is an article from VMware on how to migrate to vSphere SDK: https://www.vmware.com/support/developer/vix-api/guestOps50_technote.pdf

Free VM with management API that runs on windows?

Is anyone aware of a free (as in beer) VM that will run on a wide range of windows hosts (XP/Vista/7/etc), that comes with a full management API (at least the ability to create, monitor, start/stop and snapshot guest VMs) ?
I looked at VMPlayer, but its VIX API appears to be crippled for that product.
I looked at Xen, and it comes with a management API, but Xen only runs on Linux hosts.
thanks
Steve
Have a look at VirtualBox I have ran that succesfully on both XP and 7, have not tried Vista

which vmware server is a better choice and which host OS (for QE)

we are setting up new QE testing server. I guess host OS will be win2008
Which vmware server to choose - 1.x or 2.x ?
A year ago I tried vmware 1 server with Win2008 and it did not work at all.
However, Vmware server 2 did not seem to have the handy vmware console
VMware Server Console\vmware.exe
(is the new vmware server2 still just web based?)
we have a lot of vmware 1 images, are these ok for v2?
Or is it just better to go with HyperV?
Hyper-V Server or ESXi would probably be the best performing and most trouble free options - ie virtualisation not really dependant on the host operating system (but still free).
You can use tools like Vmdk2Vhd to convert image files. Be aware that you should boot the image in its old format first and uninstall vmware tools and some drivers like specific disk controller drivers (as per the instructions of the tool) before you convert it.
Going the enterprise route the System Center Virtual Machine Manager can do this mostly automatically, but then it's not a free solution anymore :) This platform can of course also do physical to virtual migrations for you...
...but alas, you can prepare a physical machine the same way as before converting a vmware image and then use normal imaging tools to clone it into a virtual machine. Or you can use Vmware's free converter tool and then convert the resulting vmdk image to vhd :)
Vmware Server v2 can use v1 images. Windows Server 2008 is supported only in v2. v2 also includes the Virtual Infrastructure Client which you can use instead of the web access ( the client replaces the old console from v1). This is the same client that is used with ESX.
vmware 2.0 crashed regularly on one server I have - however, hasn't crashed since the recent 2.0.1 update (but its only been a week).
I have w2K8 running under vmware 1.0.9 - by selecting Vista (experimental) as the OS setting. However, it's not under any load yet.
I'd recommend ESXi over VMware Server (you can migrate the images) purely for performance reasons. Server 2008 and Vista both run abysmally under VMware Server from my experience. With ESXi and a decent hardware RAID setup, things can be a bit more bearable.

How do you use completely free software to create ovf files for VMware ESXi?

Ok, so let's say that I want to try virtualization in my environment. I want to use ESXi to do that because it is free. I can use the install disk and setup a box to run the ESXi Host.
I'm not sure if the VMware Infrastructure Client is free for one thing. You can use it to attach an ovf file (a packaged VM). The problem I had is creating an ovf file that worked. The free converter didn't do the trick.
Does anyone have any tips or guidelines?
The VMware Infrastructure Client is free with certain restrictions. You just download it over the web from an installed ESXi host.
You need licenses to enable vMotion, but for a single host there's no problem.
We're using ESXi (free) with the VI Client (free) and getting tons better performance than VMware Server (also free). I wasn't so sure about the VI Client thing until I talked to someone else that had a working setup, it's a bit confusing and definitely not "obvious" if you're new to the various enterprise level VMware solutions.
Edit: This was true for ESX3, things change and it is no longer true. See comments for ESX4/5 solutions.
Yes, VI Client is free with ESXi, you just don't get advanced features.
For creating an OVF you should have a look at VMware Studio, a new Beta was released recently.
Sadly, no, the VMware client is not free:
"Further, managing a VMware ESXi host with VMware vCenter Server requires a VMware vCenter Server Agent for each host, only available with the purchase of a VMware Infrastructure license (Foundation, Standard, or Enterprise)."
From this VMware page:
http://www.vmware.com/products/esxi/uses.html

Automating VMWare or VirtualPC

I'm currently experimenting with build script, and since I have an ASP.net Web Part under source control, my build script should do that at the end:
Grab the "naked" Windows 2003 IIS VMWare or Virtual PC Image from the Network
Boot it up
Copy the Files from the Build Folder to the Server
Install it
Do whatever else is needed
I have never tried automating a Virtual Machine, but I saw that both VMWare and Virtual Server offer automation facilities. While I cannot use Virtual Server (Windows XP Home :-(), Virtual PC works.
Does anyone here have experience with either VMWare Server or Virtual PC 2007 SP1 in terms of automation?
Which one is better suited (I run windows, so the Platform-independence of VMWare does not count) and easier to automate?
With VMWare, there is the Virtual Machine Automation APIs (VIX API). You can find the reference guide here. It works with VMWare Server and WorkStation, but AFAIK it's not available for ESX Server.
From the main page for VIX:
The VIX API allows you to write
scripts and programs that automate
virtual machine operations. The API is
high-level, easy to use, and practical
for both script writers and
application programmers. It runs on
VMware Server and Workstation
products, both Windows and Linux.
Bindings are provided for C, Perl, and
COM (Visual Basic, VBscript, C#).
Use https://github.com/dblock/vmwaretasks rather than the raw VixCOM API if you're going to do this in C#.
I agree with Chris.
Virtual Machine Automation APIs is a very good possibility for automating of virtual machine operations.
VIX API Version 1.6.2 can be used for automating of ESX guest operations as well.
VirtualBox also has API's for automating their VM's.
To follow-up to #Chris, ESX is extremely scriptable. A client I've been working with recently has built a web service that launches a VMware script to create the VM they need, then start the VM with a custom boot ISO. That ISO includes all the kickstart or unattend.txt info it needs to do a totally unassisted OS build.