Hi readers!! I am writing this blog after a very long sabbatical, due to some personal commitments. I decided to start off with the "Power Actions" fling as I found this to be one of the most useful tools from VMware (for sysadmins), in recent times.
VMware's PowerShell module aka 'PowerCLI' is a very useful and handy tool for VMware administrators. It allows the automation of various repetitive activities such as reporting, provisioning, allocation etc. It can be deployed on various OS flavors including Windows and Linux (thanks to PowerShell core).
What if there was a way to execute the PowerCLI scripts directly from the vCenter UI, using a CLI interface (very much like AWS CLI)? This is exactly what the VMware Power Actions fling allows you to do.
You can visit the VMware fling page here: https://flings.vmware.com/power-actions
The setup instructions are pretty straight forward; and has been detailed in the "Power Actions user's guide" document, which can be downloaded from the fling's homepage. However, I will briefly outline the setup procedure here.
Steps to setup the VMware Power actions fling:
1- Download the fling from the fling website: https://flings.vmware.com/power-actions
2- Go to Home --> administration --> Solutions --> Client-plugins
3- Click on "ADD" to add the plugin, 'install new solution' wizard opens
4- Select the OVF file from local system, you downloaded from the fling site.
5- Assign a name to the VM
6- Select the compute resource:
7- Accept the license agreements
8- Select a datastore
9- Select the VM network (Ensure you have a DNS server with pre-defined corresponding PTR records for the Power Actions vm)
10- Enter the OVA customization data as per your environment
11- Associate the vCenter server in your environment, click on Finish to close the wizard and start plugin deploy
12- Wait for the OVF import task and install solution to complete
You can open the power actions VM console and observe the setup progress. The setup is completed when you see the below message:
NOTE: The Power actions deploy fails with failure to run the initialization script message, when you set static addresses to the appliance (including in the latest fling version 1.0.3). Hence, it is advisable to have a DHCP server in the environment and use dynamic IPs for the Power actions VM.
Once the Power Actions fling is successfully deployed, you can see the plugin it under the plugins section:
To use the plugin, navigate to the "Developer Center" and go to the "Power Actions" tab. You can use the CLI console from the "Console" section:
This is a really useful fling and I really hope VMware team is working on it's productization. This feature would allow sys admins to carry out automation tasks on demand, directly from vCenter, without the need to have a PC/VM with PowerCLI module installed in the environment.
For example, you can run the below script, directly from the vCenter Power actions console, to list the VMs running a vulnerable version of VMware tools (CVE : CVE-2023-20900)
In addition to this, you can also upload pre-written PowerShell/PowerCLI scripts into the 'script library' and directly execute them via the fling; for performing various infrastructure automation tasks. As of now, you cannot schedule the execution of these scripts, something that would be really helpful in CI/CD pipelines. I am sure VMware's team is working on that as well!