The vSphere HTML5 Web Client Fling version 5 has been released and there is a much-awaited surprise: PowerActions is back!
PowerActions is the easiest way to run PowerCLI commands and scripts directly from the vSphere Client. Its first appearance was at VMworld in 2013! It was then introduced in 2014 with a PowerCLI Console and the ability to access a PowerCLI Script Library directly through the vSphere Web Client. However, since that time, the vCenter Server has changed dramatically. The Windows vCenter has evolved into a vCenter Server Appliance (VCSA). The vSphere Web Client has been deprecated and been replaced with the HTML5 based vSphere Client.
To help aid us in the process of these transitions was the introduction of a fantastic utility known as the vSphere HTML5 Web Client Fling. This fling allowed us to introduce the latest and greatest functionalities outside of the normal vSphere release cycle. A little more than a year ago, the fling introduced the concept of a Developer Center. This centrally located area has been the target for all kinds of resources that developers and automation specialists look for. To date, there has been the introduction of Code Capture and the API Explorer. This latest update to the fling re-introduces PowerActions.
In the spirit of the original, this version of PowerActions comes with two distinct areas within the Developer Center: PowerActions and Console. The PowerActions section gives access to two subsections, Script Library and Script Execution. These will be the areas where scripts can be imported, ran, and their output can be viewed. There’s also the Console section, which is a minimal PowerShell console, with access to the PowerCLI 11.5 modules, where commands and scripts can be input and ran ad hoc.
Let’s take a more in-depth look at getting started with PowerActions for the vSphere Client.
Introducing the Script Execution Service
There is a new service behind the scenes that gives PowerActions the ability to run PowerCLI scripts and commands directly from the vSphere Client. This service is known as the Script Execution Service (SES). Under the covers, SES is managing a runspace containing PowerShell 6.1 and the collection of modules for PowerCLI 11.5. This runspace is single threaded, stateless, and periodically refreshed. Therefore, we can only run one script at a time and we should not be storing anything to the local filesystem of the runspace. Control of this service can be found in the Fling Appliance Management Interface (FAMI), and is disabled by default.
Setting Up PowerActions
The first step in using PowerActions is to enable SES from the FAMI. This interface is available at port 5490 of your recently deployed or updated vSphere HTML5 Web Client Fling appliance.
PowerActions makes use of a Content Library to store and reference scripts. We can either create a new Content Library or use an existing one. If you do find yourself having to create a Content Library, ensure that your permissions are configured at the “Global Permissions” level.
In this environment, I’ll need to create a new Content Library. As of PowerCLI 11.5, we can create a Content Library with a single command. Taking some code from the last blog post, What’s New for Content Library Management, we can use the following code to create a new Content Library.
1 2 3 4 5 6 7 |
$contentLibraryInput = @{ Name = "PowerActions CL" Description = "PowerActions Library" Published = $true Datastore = Get-Datastore -Name "Datastore Name" } New-ContentLibrary @contentLibraryInput |
We can now return to the PowerActions tab and start by importing our first script. The next couple sections are going to start with a high-level report then we’ll add some contextual intelligence to take advantage of PowerActions’ more advanced functionalities.
Snapshot Management – Simple Script
Managing snapshots across an entire environment frequently comes up as a pain point. With PowerActions, we can create and import a one-liner script to audit our entire vSphere environment that can be ran by anyone with access to our vSphere Client.
Here’s the body of the one-liner script we’ll be importing, which I’ve named: SnapshotReport_All.ps1
1 |
Get-VM | Get-Snapshot | Select-Object VM, Created, Name, SizeGB |
To start, while we’re in the PowerActions tab and Script Library subsection, make sure the desired Content Library has been chosen from the dropdown box on the right-hand side.
Then, we can begin our import process by clicking “Import”. On the Import Library Item screen, set the Source file to “Local file” and browse to our SnapshotReport_All.ps1 file. The Item name will automatically be populated and we can add notes as needed. Clicking “Import” will complete the process.
The Script Library will now display information about our import script. We will see our name, the Script Type, the version, and the last modified date. Expanding the item will show us even more information, such as the size and the last sync date. Selecting the script will show us the content of the script.
Here’s an example of how the Script Library should display information about the imported Script:
We are now ready to run our script. We can do this directly from the Script Library by clicking the “Run” dropdown and selecting Run.
Once the script has completed running, we’ll see a pop-up containing some basic status information. This pop-up also contains a link back to PowerActions. By browsing to the Script Execution area, we can see the results of whether or not our environment has any snapshots.
Here’s an example of what this process looked like in my environment:
Snapshot Management – Contextually Based
We are now going to take our script a step further by adding some contextual awareness. This gives PowerActions the ability to run the script against specific objects in our vSphere environment. This is done by adding PowerShell parameter blocks to our script.
For our scenario, we only want to return snapshot information from VMs in a specific cluster. Our parameter block will be looking for a strongly typed cluster object.
Here’s what an example script would look like, which will be named: SnapshotReport_Cluster.ps1
1 2 3 4 5 6 |
param ( [VMware.VimAutomation.ViCore.Types.V1.Inventory.Cluster] $cluster ) Get-VM -Location $cluster | Get-Snapshot | Select-Object VM, Created, Name, SizeGB |
Once the above script has been imported, we can run the script against the desired cluster. We will start by changing over to the “Hosts and Clusters” view. We’re going to select a cluster, bring up the “Actions” menu and select “Execute Script”
We’ll then select one of our imported scripts to run. For this scenario, we will select SnapshotReport_Cluster. Note: if you run SnapshotReport_All, you will receive the same results as before since there were no parameter blocks specified.
Clicking “Ok” will bring us to a Script Parameter screen. We can see that we have our cluster parameter and the input has been configured to be our Management Cluster. Clicking “Ok” again will run our script against the Management Cluster.
After a few moments we should see the results pop-up which will take us back to PowerActions. After selecting the Script Executions subsection, we can see the output from our script which has been reduced by two VMs.
Summary
PowerActions is back and available as a new feature within the vSphere Client Developer Center. PowerActions allows us to import scripts to our vSphere environment and execute them with a couple of clicks. This is all thanks to the Script Execution Service, which has been added to version 5 of the vSphere HTML5 Web Client Fling. This blog took a look at setting up PowerActions, creating a Content Library, and importing some scripts to create basic reports. We also added the ability to use one of our scripts in a contextually aware manner, so that PowerActions understands we’re passing in a parameter directly from the user interface!
Let us know how you’re planning to use PowerActions in your environment!
More information about the vSphere HTML5 Web Client Fling can be found here: VMware Flings: vSphere HTML5 Web Client
More information about PowerActions can also be found in the PowerActions_documentation_Fling.pdf, which is available in the dropdown box from the vSphere HTML5 Web Client Fling’s download section.
I set up my PowerCLI Publisher Library and imported the example PS1 scripts but it wont run them. Once i click run or clean run a popup appears with Status: Error.
Would you mind lending me a hand and getting this to run?
Thanks in advance!
I would like to specify my problem:
I can run PowerActions from administrator@vsphere.local, but I can’t run em with another user who has global admin rights.
Hi Fabian,
What is the username and domain name? Are there error details available? Are you able to run script with this user against this VC from PowerCLI on your local machine?
I tested this in-house with user from another domain and it works for me.
trategies as to what they want images of (e.g. bride-to-be and father boiling down the aisle, Lots of people have particular s
great content
@ https://uniquegiftforlove.in
This is really a great article and a great read for me in terms of vmware.
Hey check this out helpful blog,thanks for helping us! vegan HR
Hey check this out helpful blog,thanks for helping us! Accountant Bedford
href=Hey check this out helpful blog,thanks for helping us! Accountant St Neots
Hey can you please check this out helpful blog,thanks for helping us! sustainable seo
Hey check this out helpful blog,thanks for helping us! Accountant Bedford
Hey check this out helpful blog,thanks for helping us! Accountant St Neots
Hey can you please check this out helpful blog,thanks for helping us! vegan HR
Amazing blog, Thank you Sustainable HR
green hosting
Looking for Fast, green hosting and Affordable Web Hosting? green hosting
green web hosting
Looking for Fast, green hosting and Affordable Web Hosting? green web hosting
amazing article man
affordable seo services
Hey can you please check this out helpful blog,thanks for helping us! affordable seo services
What if its required a data based on analysis and Productivity.
This topic is very interesting and I am interested but do not know where to find, thankfully you create this topic, hope everyone will help me
Hey check this out helpful blog,thanks for helping us!
Nice Blog, keep it up for more information like this. buy wine online https://goodstyle.app/
The article is good to read and clearly descriptive as it helps to know all the things clearly and wisely the pictures and graphs have described the matter in a proper manner.
I found really intresting stuff here..Thank you
award winning wedding photographer
I found really intresting stuff here..Thank you
Actual day photographer
I found really intresting stuff here..Thank you
portable shower and toilet
I found really intresting stuff here..Thank you
funeral service singapore
the good website
Web page addresses and e-mail addresses turn into links automatically.
Kyle Ruddy never disappoint us
Nice Blog, keep it up for more information like this. buy wine online
Nice Blog, keep it up for more information like this. buy wine online
Quickbooks error 12031 can also occur while refreshing the payroll services in QuickBooks. There are several causes behind this error but mainly the pertinent issues are firewall and internet settings. You can fix this error by updating Quickbooks.
QuickBooks error 3371 is typical when a user reconfigures their desktop computer or activates QuickBooks for the first time. Missing or destroying company files could possibly be the source of this problem.
This is amazing thanks for sharing this blog I have become a fan of your blogs now. This blog is so interesting and informative.
I have read all your article, I locate the substance very fascinating and point by point, you will have all the more intriguing and careful articles to give peruses understanding. Thanks and good luck!
quickbooks install diagnostic toolis considered the top software to maintain the financial sides of the companies. Trusted by professional entrepreneurs, this incredible software has multiple advanced features to make business-related tasks easy. With so many positive reviews, QuickBooks has become a leading software mainly used for generating invoices, tax reports, maintaining the data, reports, financial bills, and so many other things
Thank you for the amazing post.
Thanks for sharing the best information .
Thanks for sharing such nice blog post.
If you are getting bored and want your lonely night turn into joyful, instant get in touch with most reputed escort agency.
Intuit always keeps on surprising its users with different products and services. Turbotax and QuickBooks are among them. It is specialized with some advanced and unique features that can fascinate anyone around
Intuit always keeps on surprising its users with different products and services. Turbotax and QuickBooks are among them. It is specialized with some advanced and unique features that can fascinate anyone around
QuickBooks Desktop File Doctor (Stand-Alone version) can be downloaded through Intuit’s official webpage and its utilization differs a lot from the In-Built version
hey everyone myself jack mosan and i am working in deloitte company as a senior technician and very much fond of reading and writting blogs so if anyone wants to know about QuickBooks won’t open agitates the users with frequent warning pop-ups whenever they want to run the software. “Stuck on the loading screen”, “not responding”, QuickBooks desktop doesn’t start” or “has stopped working” are other names of this issue. Several users reported about it in the past few days that makes it a common problem
Thanks for this amazing and knowledgeable post.
At QB Techs we help our customers to grow using business automation tools. Cloud accounting services and making smart guided decisions to save on taxes. Vist QB Techs to know more and how we can help your business to strive.
Nice Blog, keep it up for more information like this Guerilla Post
I am happy to see your post getting started power actions. It seems to be very interesting. I just bookmark this web page for future content.
PRP Platelet Rich Plasma Injections are gaining popularity for a variety of conditions, from muscle & joint injuries as well as rejuvenation of skin, hair follicles and acne. Trusted Platelet Rich Plasma Injections Specialist serving San Diego, CA. Contact us: 858-358-6189
Thank you so much for sharing this post, I have read some of your stuff this past weekend . Personally, I loved your post. I appreciate your work. It was a great informative post. Your articles are useful and informative and links also. I feed glad to read your blog. keep It up.
If you want to know more information about
VISIT EXLYAPP Once you can check it.
Thank you so much for sharing this post, I have read some of your stuff this past weekend . Personally, I loved your post. I appreciate your work. It was a great informative post. Your articles are useful and informative and links also. I feed glad to read your blog. keep It up.
Thanks for sharing this wonderful info. keep It up. Online Matka Play
Very interesting content. I love it.
Scoot D Cook
cofounder of Accounting Def
Thank you so much for sharing this post, I have read some of your really awesome stuff on this website . Personally, I loved your content. I appreciate your hard work. It was a great informative post.
Your articles are useful and informative and links also. I feed glad to read your blog. keep It up.
Thank you so much again – check this out if QuickBooks Running Slow
virtual bookkeeping permits a clerk to work from home rather than genuinely working at a client’s office. Beside the work area, there isn’t a lot of distinction between ordinary accounting administrations and a virtual course of action. A virtual clerk utilizes modernized accounting programming to post monetary exchanges, audit and update explanations and accommodate accounts.
Best white motherboard
Because of its outstanding design and gaming-specific features, the CVN Z690 Frozen V20 is regarded as the best looking white motherbaord . It can support DDR4 RAM with speeds of up to 4800MHz.
This motherboard includes an 8-channel audio codec. It aids in the improvement of audio connectivity. It also has Wi-Fi 6 support and a 2.5Gbps LAN chip. Overall, this board is ideal for those looking for a full whitish motherboard with PCB.
Because of its outstanding design and gaming-specific features, the CVN Z690 Frozen V20 is regarded as the best looking white motherbaord . It can support DDR4 RAM with speeds of up to 4800MHz.
This motherboard includes an 8-channel audio codec. It aids in the improvement of audio connectivity. It also has Wi-Fi 6 support and a 2.5Gbps LAN chip. Overall, this board is ideal for those looking for a full whitish motherboard with PCB.
Whenever the QuickBooks Company file requires additional information, the QuickBooks Error code H303 generally appears.
If you are using QuickBooks pro for bookkeeping and facing troubles logging into a company file. Download and install QuickBooks file doctor
Are you facing issues opening your company file in QuickBooks? Download and Install QuickBooks file doctor tool to repair QuickBooks company file errors and network problems easily.