I wanted to reach out and see if anybody else was running into this problem. I'm trying to execute some PowerShell scripts on the VM after it is built in the PRE MachineActivated phase. I'm using the built-in Orchestrator workflow of "Copy file from VCO to guest" and that seems to work reliably 100% of the time.
However, when I use the built-in Orchestrator workflow called "Run program in guest" I seem to be getting mixed results. Sometimes the PowerShell scripts execute... sometimes they don't. I can't seem to get a good reason on why they do or don't execute. It seems to be at random... I'm not sure if Orchestrator is having issues contacting VMware Tools? However, everything always green checkmarks in Orchestrator.. as far as vRO is concerned the script ran successfully.
I have set those PowerShell scripts up to auto-delete after they run on the server. If the script doesn't run it is still on the filesystem of the VM that was deployed. Does anyone have a better mechanism for this?
In my first try I used a secured SSL connection to our PowerShell server to have PowerShell connect to vCenter and then try to use the Invoke Powershell commands for running something off the VM. That also seemed to be not reliable.. it would sometimes run.. sometimes fail.
Is there a preferred, supported, mechanism for running custom scripts on a VM after the box is built? I'm willing to modify the scripts as necessary but I need to support Windows Server 2012R2, Server 2016, and Server 2019. Right now Server 2016 seems to be the biggest problem child... and I haven't even begun testing with Server 2019 yet.
Since you're doing this through vRA, there are a few methods for installing software via running a PowerShell script.
Since you're doing this through vRA, there are a few methods for installing software via running a PowerShell script.
Wow thank you so much! I'm still somewhat new to the vRA game... and I really appreciate this. I'll try to figure out which option is best for us.