Hi and welcome to the VMware VIX API blog. On this blog we'll talk about what VIX is, how it can help you, giving you resources for using VIX, and providing lots of examples.
What is the VIX API?
VIX is an API that lets you programmatically control the products that host VMware VMs, and control the VMs themselves. If you're considering learning more about the VIX API, chances are it's because you need some form of automation. After all, if you deal with only a handful of VMs, it's a lot easier to just use the GUI for eveything than it is to spend the time and effort to learn how to use a programming interface. But, if you're spending lots of time managing all your VMs under VMware Server or Workstation, or even VMware ESX, learning VIX can help you be a lot more productive by automating the tasks you do every day.
Does any of this sound familiar?
If you've been researching VMware APIs, you might have heard a speech like the one above more than one time. VMware has gotten to the point where we have a somewhat dizzying array of APIs, and many of them sound like they do the same things. Let's try to shed some light on this problem by first talking about what APIs can manage what products, then we'll move to what sets VIX apart from other APIs and when you should use it in favor of others.
There are a lot of caveats and footnotes that this simple diagram glosses over, but it's good enough for our purposes. The key points are that, if you're looking to automate management of VMware Workstation or Server, VIX is your best (sometimes only) bet. In addition, if you're building solutions for ESX, you'll find that VIX makes a powerful complement to the VI API (more on this below).
What kinds of things can VIX do?
A full listing of VIX's capabilities is available in the VIX reference guide. A few of the highlights of what you can do with VIX include:
- Registering and unregistering VMs.
- Powering VMs on and off.
- Managing VM snapshots.
- Adding and removing VM shared folders.
- Copying files into and out of the VM guest.
- Starting and stopping processes within the guest.
A special note on managing VMware ESX with VIX.
Starting with VIX 1.5 and VMware ESX 3.5 update 1, it is possible to manage VMware ESX using VIX. My background is almost exclusively with VMware ESX and VMware VirtualCenter, and that tends to be my comfort zone. If you've used the VI API, you're probably wondering why you should look at VIX. The reason is pretty simple, the VIX API provides critical functionality that the VI API lacks, for instance:
- VIX allows you to copy files in and out of guests.
- VIX allows you to start and stop processes within guests.
- With a bit of trickery you can run programs in the guest and get their output (more on this in another post).
In short, VIX allows you to treat the VM as more than just a black box, something none of the other APIs can do today. Before joining VMware, I worked for Opsware before it was acquired by HP, and specifically on software to manage VMware. We had a few important problems that we were never able to solve very well, such as "how do you install an agent onto a VM?", or "how do you start or stop a service within a VM?". There aren't any good solutions when you use the VI API, but all of this stuff is easy when you have VIX.
The latest released version of VIX is 1.1.4, available on the VIX API landing page. I've also been talking about VIX 1.5. Currently, VIX 1.5 is not available as a standalone download. Instead you've got to download it from the VMware Server Beta 2.0 site. Later, VIX 1.5 will also be available as a standalone download.
What language bindings are available for the VIX API?
The VIX download provides support for 3 languages: C, Perl and COM. If those are not your thing, there are also some open-source projects, not endorsed in any way by VMware, that provide Java and Python bindings.
What resources are available for VIX?
First, you should familiarize yourself with the VIX documentation. Second is our VIX Community. A third resource I would recommend if you're looking for a good source of examples is Eric Hammersley's Professional VMware Server, which has a good chapter on VIX from the VMware Server perspective.