The Salt proxy agent is a relatively new feature of Salt allowing to control networked devices where salt-minion cannot be installed directly. The official Salt documentation on the subject is outdated and full of syntax errors. It’s actually quite sad that some talented folks at SaltStack spend months developing new functionality and then decide that spending ten minutes on updating the docs is too much of a hassle. Here’s a quick example of configuring a Salt proxy server for controlling vCenter and individual ESX hosts. 

I started out with a basic RHEL 6+ VM and installed salt-minion and salt-proxy. Then I installed and configured esxcli to work with my vCenter. The next step is to configure Salt Pillars on the Salt Master server. Reference the sample configuration below and adjust hostnames/login credentials as needed for your environment.

The next step is to launch the salt-proxy process on the Salt Proxy VM. There is no init script for this at the moment, so I started the process with nohup and will need to write a startup script at some point.

Now you should be able to run some basic test commands on the Salt Master to test connectivity. Here are some examples for you:

 Note:  in the last example, you’re connecting to the Proxy, which connects to the vCenter, which connects to the two ESX hosts to get a list of running VMs. You only need to supply the ESX root password, while the login credentials for the vCenter are provided to the proxy server by the Salt master.

Similar to the example above, but will get a list of all VMs matching the Unix host naming convention running on all ESX hosts in the vCenter. This will take a bit of time to run.

 

Leave A Reply

Please enter your comment!
Please enter your name here