Testing Script Runtime Service for vSphere – part 1
Last year I tweeted about the introduction of the Script Runtime Service and now I decided to give it a try. The reason for this is that I think this is something we all waited for: a central script host.
At first, I thought this was an evolution of the Script Execution Service that can be found in the vSphere HTML5 Web Client Fling. This fling had several features, and one of them was called PowerActions: integrating PowerCLI and the vSphere Client. The vSphere Client now provides the ability to execute PowerCLI commands and scripts, and store scripts in a library. Custom actions backed by PowerCLI scripts can be defined and executed on inventory objects.
To use it you would roll out a vSphere HTML5 Web Client Fling appliance and enable the Script Execution Service from the management interface.
Then you would be able to run scripts from a central repository. So SES and SRS seem to offer similar functionality. But to be honest, I don’t know how these two services compare.
The new Script Runtime Service also uses a separate machine. This would either be a K8S cluster or a VM. In this post, I will be using a VM.
First, download the bits from GitHub. I saved the files in D:\SRS. Then import the OVF to your environment. Because the disk is split into three parts importing it using the vSphere Web Client doesn’t work. So you can use PowerCLI for this. Create a connection to your environment and run these two commands:
$vmhost = Get-VMHost -Name esx01.local.lab Import-VApp -Source D:\SRS\SRSHostVM.ovf -VMHost $vmhost
It takes some time to import the VM but in the end, you should see a VM named SRSHostVM. Power on the VM and wait for it to boot. Log on with root (default password is changeme), change the password, and install the SRS. Detailed instructions on how to do the installation can be found on the GitHub page. My first attempt failed because DNS was not configured for the VM. The reason was that I forgot to configure the DNS Server option in the DHCP scope. So make sure that DNS is working. To be sure I also created an A record for the VM (srs.local.lab).
When the installation is finished you should see something like this:
Now you can check the installation by opening the swagger page of the service. Use the name you used in the installation command. In my case it’s https://srs.local.lab/swagger. If all goes well you should see something like this:
Now that the SRS is installed successfully, it is time to use it! Luc Dekens wrote an excellent article about building your own SRS and how to use it: https://www.lucd.info/2020/12/23/a-hitchhikers-guide-to-srs-1-0-0/
In the next post I will try to give you some examples on how to use the Script Runtime Service.