A new interesting feature in VMware vSphere 6.7 Update 2 (U2) is Developer Center Code Capture. If you've followed VMware long enough, and you've heard about Project Onyx, Code Capture is basically doing what Project Onyx did several years ago. But now, VMware has fully integrated this technology into the latest version of vSphere.

VMware introduced the Developer Center and Code Capture with the release of vCenter Server Appliance (VCSA) 6.7 U2. As far as I know, the Windows-based vCenter does not provide this feature. This is perhaps another reason to migrate to VCSA finally and use the HTML5 client, which does not need any plug-in. Any compatible web browser can access vCenter Server installed as VCSA or installed on a Windows platform.

The vSphere Client Developer Center provides tools for automation experts, DevOps engineers, and developers to find the resources to manage API structures, capture vSphere Client actions, and then translate them into PowerCLI.

VCSA and the vSphere Client contain the Developer Center, which has various features that allow vSphere administrators to automate different vSphere processes and functionality by way of API calls or PowerCLI code. The system allows you to "capture" the UI tasks you do within the UI into PowerCLI code.

You can then copy the code or download it as a script and use it in a PowerShell session to execute the task.

In this post, we will look at the new VMware vSphere 6.7 U2 Client Developer Center Code Capture and API Explorer.

Code Capture ^

The Code Capture feature brings real visibility, so you can see the actions and see what's happening under the hood when you execute commands and actions within vSphere. These could be simple tasks or more complicated ones. Code Capture analyzes all of this, allowing you to reuse the actions via PowerCLI code generated on the fly.

Code Capture is part of the HTML5 vSphere Client only. The Flash client does not provide this option, and VMware won't develop it further. Thus, the Flash-based vSphere Client will have no new features.

You can start a code capture, perform a task in the HTML5 vSphere Client, and export the code used to perform that task. This is useful for generating code you can later use to automate certain vSphere tasks.

For this, go to the menu and select Developer Center > Code Capture > Enable Code Capture. You'll see a new red recording button appear.

VMware Developer Center

VMware Developer Center

If you disable Code Capture, you'll see a short message saying that doing so will clear actions recorded in the current session and hide Code Capture on the navigation header. If you have previously generated some code, just make sure you copy or download the code before proceeding.

For now, the 6.7 U2 has the option to generate PowerCLI only, but there is already a new Fling with a newer version of the vSphere HTML5 client. It allows generating code as low-level PowerCLI, Javascript, and Python. So I'd expect this to be available in next release or major update of vSphere.

In sum, VMware Code Capture gives us the option to record actions performed in the vSphere Client and output code. This code is actionable, which means you can use it on a local system to reproduce those tasks.

It also produces the code in a language known as low-level PowerCLI. What is it? Basically, instead of the high-level PowerCLI cmdlets you may be used to using, like Get-VM or Get-VMHost, the output is .NET based and is able to interact directly with the vSphere API services.

vSphere API Explorer ^

The same Developer Center hosts another useful tool: API Explorer.

The API Explorer is accessible in the vSphere Client under Developer Center. It is an easy-to-use API search tool.

With this tool, you can search for key API calls, and you can also execute examples to test particular calls. API Explorer lets you browse and invoke vSphere representational state transfer (REST) APIs supported by the system. It provides information and context around the API calls.

vSphere API Explorer

vSphere API Explorer

Final Words ^

Developer Center with API Explorer and Code Capture is a very neat addition in vSphere 6.7 U2. VMware has greatly simplified the upgrade process from previous releases. Whether you need to upgrade a single host or a large cluster, the built-in vSphere Update Manager (VUM) does the job pretty well. We have covered the ESXi host upgrade process via VUM in this article.

Subscribe to 4sysops newsletter!

VMware continues to enhance and improve the vSphere HTML5 client through a Fling accessible via the VMware Labs site. So before you find a new feature in the production release of vSphere, you can download and test it as a Fling.

avatar
0 Comments

Leave a reply

Your email address will not be published.

*

© 4sysops 2006 - 2022

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account