vRealize Automation fails to install Salt Minion
I was attempting to leverage the saltConfiguration property in a vRA Cloud Template and ran into an issue where vRA would deploy the VM and then fail with an error indicating that the Salt Minion deploy failed. I was particularly puzzled by this because the cloud template I was using had worked previously, so it was a bit surprising that it was suddenly not working. I spent a lot of time digging into what my issue was. I discovered and eliminated a number of issues: RHEL 9 (not yet supported), NSX MTU issues, and lots of other things that ended up not being the issue.
To solve the issue I ended up having to break the minion installation into steps.
- Deploy the VM without the Minion (this prevents vRA from deleting on failure)
- Execute the Apply Salt Configuration day 2 action
Unsurprisingly, the day 2 action failed, yielding an error message similar the failure exhibited when done as part of the VM deployment. This was interesting because the minion deployment call in the Salt UI indicated that the minion deployment was successful.
This led me to log in to the minion and check things out. I started out be simply checking if the minion was installed and running (it was) - next I checked that minion config file to see what was going on. It was immediately evident in the config file where the issue was...photon-machine is clearly not the name of my SaltStack server.
After some research, I discovered the reason this occured is because the deploy_minion API call that vRA uses to iniate the minion deployment results in the installation of the minion with a master configuration of the fqdn grain on the salt master server. Which if we check my lab environment is set as photon-machine.
I validated that the hostname of my SSC appliance was properly set - and then executed a grain refresh on the salt master to clean things up.
1salt saltmaster saltutil.refreshgrains
After that everythin worked as expected!