I’ve been fairly public with my opinion that RESTful APIs are the fast approaching future for how we cobble together bits of infrastructure in the modern data center. It makes a lot of sense – the architecture is resilient, language independent, and allows for the interconnection of devices across a complex working space. And while VMware has done a superb job with PowerCLI for administrators to create bits of automation for their environments, there hasn’t been much in the way of a standard and available API for vSphere. Sure, there’s pyvmomi and the vSphere Management Assistant and a handful of other projects. But they all were built with different purposes, syntax, arguments, and styles – much like how no two products seemed to have the same root user and password for getting started.
My typical experience working with VMware’s endpoints is to use the MOB (Managed Object Browser), string searches in the vSphere online documentation, or browsing object extension data via PowerCLI. It’s a bit hunt-and-peck. In the future, however, VMware is aiming for a simplified API model that focuses on using a modern, RESTful interface in a CRUD (create, read, update, delete) scheme. And providing documentation that can be explored and sampled via Swagger.
Part of the problem was that each business unit decided whether or not it wanted to opt into making automation components such as PowerCLI cmdlets. This is why some cmdlets were fully fleshed out, others were somewhat lacking, and others were missing entirely. The new formula allows for all API, SDK, documentation, and automation workflows to spring forth from a single process. What it should mean is that all products will have RESTful APIs, various language SDKs, PowerCLI cmdlets, DCLI commands, and vRealize Orchestrator (vRO) plugins out of the box – with consistency across these platforms.
RESTful API for vCenter
I’m fairly stoked to see vCenter get a RESTful API with an associated explorer. It’s long overdue, especially since VMware has been telling a cloud story for at least the past 5 years. Truth be told, there are a few API endpoints available in the 6.0 release of vCenter Server, but they are severely limited in their scope and function. Moving forward, this graphic depicts how the RESTful API will act as a middle tier between use cases and the data.
The result is that the VCSA 6.5 will contain endpoints to manage a ton of new resources, such as access, user details, health, services, statistics, networking aspects, backup and recovery workflows, and system settings. In addition, VM specific endpoints will grant administrators the ability to control provisioning, power state, hardware details (CPU, memory, disks, removable media, network, and such), and vSphere hierarchy objects (data center, cluster, folder, data store, etc).
To browse the API explorer, hit the vcenter.url/apiexplorer. This will contain endpoints for vCenter, the appliance, tags, the content library, and API queries. If you’ve ever used Swagger before, it should look familiar.
PowerCLI Goes 100% Modules
Another great thing is that PowerCLI, which began as a snappin and then started slowly migrating to modules, is now planned to be 100% module based. For PowerShell newbies, this is a huge thing – modules are the way forward, allow use of the PowerShell Gallery (which is like package management for Windows), include auto load and auto complete, and don’t muck around with the registry.
This has the potential to make PowerCLI something that can be easily slipped into many different platforms. I’ve already mentioned the PowerShell Gallery, but also for Linux / Mac deployments of PowerShell and non-install / non-download deployments from MyVMware (which is super annoying today).
vMA, vCLI, and DCLI
To be honest, I haven’t used the vMA in a long time … I think since the 5.0 release or thereabouts. It’s just a really old school way to do administration across hosts, and is something that VMware has announced is being retired.
Moving forward, the vCLI (vSphere CLI) is going to support RHEL, SLES, Ubuntu LTS, Windows 7/8 and Server 2008/2012. This will empower you to use ESXCLI (console) commands, vicfg-* commands, and other miscellaneous perl commands.
There’s also the Data Center CLI (DCLI) that is being made accessible via the VCSA shell, Windows vCenter Server command (cmd) prompt, and the vCLI Installation Package. I’ll admit to not having used this shell in the past, but do like the various output formats supported: simple, table, JSON, XML, and HTML. Supposedly I can take credit for the Cisco NX-OS-esque tab-complete feature based on comments I made a few years back. You’re welcome. 😉
Funny enough, on my last trip to the VMware campus I noticed a bunch of flyers posted around the walls asking to try out the RESTful API. This sort of let the cat out of the bag and lead me to start asking excited questions about when the feature would be released. I’m very happy to see VMware embrace true automation with standardized access across languages and endpoints for operations engineers and developers alike. Really looking forward to this feature!