Sometimes Your Servers Need a Little SaltStack to be Tasty
By Steven J. Vaughan-Nichols
When it comes to managing dozens to thousand of servers, you’ve got lots of DevOps choices: Ansible, Chef, and Puppet all spring to the top of my mind. But there are others that also demand you kick their tires. One of the best of these is SaltStack.
SaltStack, aka Salt, was created by Thomas Hatch in 2011. When it first began, it was a remote server management tool. It quickly evolved into a true DevOps program. In its latest version, SaltStack 2016.11.5, it can handle tens-of-thousands of server instances.
The open-source Salt is written in Python and is licensed under Apache 2. From a developer’s viewpoint, one of its most interesting features is that it can use ZeroMQ or Reliable Asynchronous Event Transport Protocol (RAET) for fast and reliable inter-component communications.
While ZeroMQ is fast enough for small server-farms and clouds, it doesn’t scale that well. So, the SaltStack programmers worked on RAET to enable SaltStack to scale better. ZeroMQ is based on TCP/IP, so it suffers from the latter’s latency and non-asynchronicity issues.
Tuning ZeroMQ for the best possible performance is also troublesome. RAET provides a more secure, reliable, scalable, asynchronous message/event transport by using UDP for inter-host communication. The bottom line: SaltStack components work quickly together, leading to very fast DevOps operations.
SaltStack enables you to install, manage, and maintain your servers’ configuration using an infrastructure-as-code model. This means writing code to do deployments, manage configurations and set up automated infrastructure provisioning. It’s not simply writing scripts, although that’s often part of it. Instead you use software development practices, such as version control, testing, test deployments, and use of design patterns to create reproducible, easy-to-manage models.
In SaltStack, this is done by having Masters and Minions. Masters controls acts both as a configuration data repository and as the control center. Masters runs remote commands and ensures the state of your other machines. This is done by salt-master daemon.
Minions, which may be named Stuart, Kevin and Bob, execute the Master’s instructions, report on configuration status, and deliver Minion server data.
SaltStack takes two approaches to delivering instructions: Remote execution and configuration management functions.
Execution modules run commands on Minions. While these can include shell commands, the idea is to run at a higher-level of abstraction. So, for example, you should be able to execute commands that deliver the same functional results even when the Minions are running on platforms as different as Linux and Windows.
SaltStack has many configuration functions. The most important of these are States, Formulas, and Templates.
States are exactly what they sound like. They describe the desired configuration state of a Minoned server. These often go hand-in-glove with execution modules.
Formulas are sets of state-module calls. These are configuration management files that describe how a system should look once the formula has been applied, which are written in YAML Ain’t Matkup Language (YAML). You can find many useful SaltStack formulas in an official GitHub repository.
Finally, Templates enable you to easily customize formula or configuration files. By default, SaltStack uses the Jinja template engine to make editing possible. When using all of these in production, it’s important to remember Jinja is evaluated before YAML, which means it’s evaluated before the States are run.
If this sounds complex, well, yes it is. SaltStack is very flexible and very powerful, but that comes at the cost of having a steep and high learning curve. That’s a price many businesses may well find worth paying.
The only way to know for sure how much Salt you want is to try it for yourself. SaltStack is available in both a pure-open-source version, Salt Open, and a more fully-featured enterprise version: Salt Enterprise.
In either case, SaltStack is easy to install. If you’re running SUSE Linux Enterprise Server (SLES), you have the option of using SaltStack Enterprise since it’s integrated with SUSE Manager.
SUSE, Red Hat, or Debian, I recommend giving it a try — you can run it with as few as three server instances — and then deciding if you want to Salt up your data-center or cloud.
Please feel free to share below any comments or insights about your experience with or questions about SaltStack. And if you found this blog useful, please consider sharing it through social media.
About the blogger: Steven J. Vaughan-Nichols is a veteran IT journalist whose estimable work can be found on a host of channels, including ZDNet.com, PC Magazine, InfoWorld, ComputerWorld, Linux Today and eWEEK. Steven’s IT expertise comes without parallel — he has even been a Jeopardy! clue. And while his views and cloud situations are solely his and don’t necessarily reflect those of Linode, we are grateful for his contributions. He can be followed on Twitter (@sjvn).