Vmware vSphere 6.5 vSphere 6.7

Learn How To Capture PowerCLI Code Using VMware HTML5 Client Fling

Want create site? Find Free WordPress Themes and plugins.

Recently I saw the post on the VMware PowerCLI site regarding the new feature of the latest VMware HTML5 web client fling that allows you to capture the PowerCLI code from your actions on vCenter Server. In previous versions, it was called Onyx, but according to the website's website, the latest version of the HTML5 web client fling was named "code capture".
As you can imagine, there are a lot of usecases and many reasons to capture vCenter Server activities in the PowerCLI code. One of the most important automation usecases. First, let's take a look at the VMware HTML5 Web Client Fling PowerCLI Code Capture to see how we can set it up and perform code capture operations to test it.

Install HTML5 Web Client Fling

We have not had a full HTML5 Web Client so far), we are officially using vSphere 6.7 Update 1 now.) HTML5 Web Client Fling is a great way to test the progress and development of HTML5 Web Client Fling as a new feature that has been added. To access the HTML5 Web Client, you can simply go to the following site and download it:

https://labs.vmware.com/flings/vsphere-html5-web-client

Fling is an OVA device that can easily be deployed in your existing vCenter environment. Fling is a technical preview. They are not used for production. However, you can install it for trial and testing purposes. This software is used with the least amount of resources:

  • 2 vCPUs
  • 4096 MB of memory

After launching the software, you will be logged in to the fami interface, which is located on the 5490 port. Login with the following username and password:

  • user: root
  • pass: demova

VMware web Client Fling login screen

After login, configure the connection between HTML5 Web Client Fling and vCenter Server. One point is that do not do the mistake that I committed. Do not log in the first time in your sso account configuration, as it will cause your login to fail. You must enter your own root password in vCenter VCSA.

Sso connection configuration

The VMware HTML5 Web Client Appliance configuration starts connecting vCenter

The vSphere Client Web server is initially launched on the VMware HTML5 web server

 

Capture VMware HTML5 Client Fling Power Cli Code

After initializing vSphere Client Web Server, you will be taken to the vCenter interface, which contains capture codes, which will identify the red dot that your account information shows.

The new registration button will appear with the login information on the HTML5 interface

Create a new datacenter in vCenterServer

Named the new datacenter

Complete the process of capturing PowerCli code

The result of the PowerCLI code will be the following:

 

# —— Start of code capture ——

<# 
.SYNOPSIS 
Gets VI server connection by a given server update. 
.DESCRIPTION 
Gets a VI server connection by a particular instance of the server instance from the default connected VI server collection. 
#> 
function Get-VcConnection ([string] $ VcInstanceUuid) { 
$ DefaultVIServers | Where-Object {$ _. InstanceUuid -eq $ vcInstanceUuid} 

# —– ChildType —– 
$ _this = Get-View -Id 'Folder-group-d1' -Server (Get-VcConnection -VcInstanceUuid ' e2e21bd8-8e92-4b75-948b-9de6ddb7405e ') 
$ _this.ChildType 
# —– CreateDatacenter —– 
$ name =' TestDC ' 
$ _this = Get-View -Id' Folder-group-d1 '-Server (Get-VcConnection -VcInstanceUuid 'e2e21bd8-8e92-4b75-948b-9de6ddb7405e')
$ _this.CreateDatacenter ($ name) 
# —— End of code capture ——

As you've probably noticed, based on the kyle ruddy entry on the VMware PowerCLI website, the PowerCLI code is based on built-in objects and methods used, the code is very low. However, according to a website, research is underway to upgrade this low-level code to PowerCLI cmdlets, which we're used to using PowerCLI one-liner and the like. An interesting point is that although this code is a functional code, it may even be a bit more complicated than that needed for automation purposes.

These are the great steps provided by VMware to provide an easy way to see how the UI functions are powered by the PowerCLI code and for many purposes, such as learning to create code for automation, and so on. You can copy the code from the code generator to your favorite ISE for PowerShell. At the bottom, I copied it to Visual Studio, and after testing the data center, I tested it and went ahead. it's interesting!!!!!

PowerCLI code copied to the visual studio

The new version of VMware HTML5 Web Client Fling The PowerCLI Code Capture in Fling has a great performance to generate PowerCLI code from a variety of actions. Setting up fling using OVA methods is very simple on the FAMI interface on the 5490 port.

The generated code is relatively low, however, again, the map referred to for functionality that was expressed by the official VMware PowerCLI posts may have the features upgraded to PowerCLI cmdlets in the future. This is definitely an excellent tool for learning and automation purposes in the VMware vSphere environment. Check out the new HTML5 web client fling and generate your PowerCLI code easily.

Did you find apk for android? You can find new Free Android Games and apps.
Learn How To Capture PowerCLI Code Using VMware HTML5 Client Fling
Rate this post

Sabir Hussain Soomro
About Sabir Hussain This website is maintained by Sabir Hussain. Sabir is as an Independent consultant, professional blogger VM Virtualization site has started as a simple bookmarking site, but quickly found a large following of readers and subscribers. Connect on: Google + or Feel free to network via Twitter.@VMGate110
http://www.VMGate.com