I have a VDI platform I look after in which some of the VMs autostop after a certain amount of time idle. It's not possible to use WoL to wake these VMs but I've found I can successfully start all autostopped VMs with a powershell step in Deploy that calls in the infrastructure's API (key to this is the "invoke-command" option).

I also have successfully pulled info out of the VDI infrastructure's API and put it into Inventory as custom fields. This info includes "owner", "Workstation ID" (not the computer name), and the "Autostop" tag that identifies the VMs I need to start to be able to deploy to them. The workstation ID is important as it's this info that's used in the API to start the VMs...

What I'd like to do now is add a step to my deployments that will start the VM if it's stopped. I can see two ways of potentially doing this but so far I haven't found a way to make it work in PDQ:

Option 1: Add a Powershell step that queries the VDI API to get the workstation ID from the computer name, then start the workstation using the ID via the API.

Option 2: Add a Powershell step that takes the workstation ID directly from the custom field in Inventory and starts the machine via the API.

In both the options above, I can't seem to get the relevant information from Inventory or Deploy to be able to use it in the deploy step as a variable. I've scoured the forums and the best I've found is people looking to do similar things around 5 years ago and told it was requested as a feature with no ETA. Is it possible to do any of this yet?

If anyone has a way of doing this, I'd love to hear it.

login to comment