In the spirit of my recent posts around config
management and orchestration tools, I’ve also seen several customers using
Saltstack and want to show how it is very straightforward to set up and use
with Nutanix and the Acropolis Hypervisor (AHV). Saltstack is a powerful tool to help deploy 'states' or idempotent (repeatably identical) sets of expected configuration criteria to your VMs. Also, internally, Acropolis uses Saltstack for our own security and config management. You can find help for creating
a master image from my post here: http://virtual-hiking.blogspot.com/2015/10/acropolis-image-and-cloning-primer-for.html
With your baseline gold image, let’s first install our Salt-master server:
- Create a clone from your gold image and set themaster hostname and a static IP address. I’ll be using Ubuntu 14.04 but for other OS images, please use the relevant package manager.
- Make sure to register the salt master in DNS so that all of the worker nodes will be able to resolve it correctly. By default, the master expects to use the name ‘salt’ but this can be customized.
- Add the salt repo: add-apt-repository ppa:saltstack/salt
- Install the salt-master package: apt-get install salt-master –y
- Ensure you have the current hostname and salt-master key ready to insert in your /etc/salt/minion file by running this command on the master and copying the output: salt-key –F master
Now we can
prep a new worker template with the salt-minion pre-installed:
- Create a clone from your gold image, I’ll be using Ubuntu again but for other OS images, please use the relevant package manager.
- Add the salt repo: add-apt-repository ppa:saltstack/salt
- Install the salt-minion package: apt-get install salt-minion –y
- Depending on whether you customized the salt-master hostname, either uncomment or replace the salt master hostname and IP which is in the /etc/salt/minion config file as:
- Add the salt-master key to the /etc/salt/minion config file:
- With the salt-minion pre-installed, make sure to remove the /etc/salt/minion_id and any other minion identification files: rm /etc/salt/minion_id rm /etc/salt/minion.*
- Shutdown the salt-minion template.
Also you have the option of disabling the authentication step, with the necessary "only do this if you know what you're doing" caveats, by editing the /etc/salt/master:
Finally, you also have the option of just using SSH via the salt-ssh package for an agentless (Ansible-like?) deployment: https://docs.saltstack.com/en/latest/topics/ssh/ For this to work, you will need to enable passwordless-SSH and I described preparing for that here.
For next steps, you could use Salt to deploy some
sample workloads like vim or nginx:
https://docs.saltstack.com/en/latest/topics/tutorials/walkthrough.html#the-first-sls-formula
And you can find more example formulas on github to work with and modify to suit your intended environment:
https://docs.saltstack.com/en/latest/topics/tutorials/walkthrough.html#the-first-sls-formula
...
And you can find more example formulas on github to work with and modify to suit your intended environment:
like an ELK stack: https://github.com/saltstack-formulas/elasticsearch-logstash-kibana-formula (needs some versions updated) or https://github.com/rcbops/elk-formula
If you want a quick ELK stack deployment on a single host:
- Clone the example on the salt-master server: git clone https://github.com/saltstack-formulas/elasticsearch-logstash-kibana-formula.git
- Move the state files to the salt repo directory: mv elasticsearch-logstash-kibana/kibana /srv/salt/
- Apply to one of your guest VMs: salt vm_name state.sls kibana
......
Also if you want to quickly deploy Kubernetes for management and clustering of containers across your Nutanix cluster: http://kubernetes.io/v1.0/docs/admin/salt.html
Additional links:
https://docs.saltstack.com/en/latest/topics/installation/
https://docs.saltstack.com/en/latest/ref/configuration/index.html
https://docs.saltstack.com/en/latest/topics/tutorials/preseed_key.html
https://docs.saltstack.com/en/latest/topics/tutorials/walkthrough.html
https://docs.saltstack.com/en/latest/topics/tutorials/pillar.html
Additional links:
https://docs.saltstack.com/en/latest/topics/installation/
https://docs.saltstack.com/en/latest/ref/configuration/index.html
https://docs.saltstack.com/en/latest/topics/tutorials/preseed_key.html
https://docs.saltstack.com/en/latest/topics/tutorials/walkthrough.html
https://docs.saltstack.com/en/latest/topics/tutorials/pillar.html
This comment has been removed by the author.
ReplyDeleteHi Andrew, great post!
ReplyDeleteI just go started with saltstack and I was wondering if there is a way to create/start/clone a Nutanix VM using salt.
Hi! Right now Salt isn't creating the VM's, the creation/cloning is just done either through Prism (UI), Acropolis (API) or via the acli (command-line).
Delete