SlideShare a Scribd company logo
Introduction to
Systems Management
with SaltStack
Craig Sebenik
Infrastructure Engineer@Matterport
3 Oct 2015
• Introduction
• Architecture Overview
• Execution Modules
• States
• Data - Minion and Master
• Extending Salt
• Demo
• Summary
What Is SaltStack?
• System and Configuration Management
• Encrypted communication channel
• Remote execution framework
• 100% open: one of the most active on github
• Scales to tens of thousands of nodes
• Built (and extended) with python
What Am I Covering?
• Simple/quick overview of salt
• Very simple examples
• Only a basic single master topology
• Only the core functionality
• Glossing over details: ask questions!
Who Am I?
• Degrees in Chemistry, Mathematics, Food
• Computational Chemist (lifetime ago)
• Abbott Labs, Eastman Kodak, Parke-Davis
• Sysadmin/SRE
• NetApp, LinkedIn, Matterport
One More Thing About Me…
Quick History Of Salt
• Initial release in March 2011
• States added a few months later
• Pillars added March 2012
• Salt SSH added Sept 2013
• Salt Cloud merged in Jan 2014
• Custom transport (RAET) added in Jul 2014
• Introduction
• Architecture Overview
• Execution Modules
• States
• Data - Minion and Master
• Extending Salt
• Demo
• Summary
Minions and Master
• Master: central command and control
• Minion: paired with master
• Encrypted communication
• Communication over ZeroMQ using
MessagePack
• Target minions based on their attributes
Quick Example
What Does This Mean?
• Central management of many nodes
• Ensuring hosts match a “recipe”
• Easy to add more hosts that match a template
PUB-SUB
master minion1
minion2
4505
Returning Data
master minion1
minion2
4506
Targeting Minions
• List: “minion1,minion2
• Globs: “minion*”
• Regular expression: “minion([2|3])”
• Grains: “OS: Ubuntu”
• Combinations of the above
Set up Trust With salt-key
• Salt uses standard public key encryption
• Key exchange
• Master needs to verify identity of minions
• User needs to “accept” the minion’s key
• Minion’s public key stored on master
• Master’s public key stored on minion
• Introduction
• Architecture Overview
• Execution Modules
• States
• Data - Minion and Master
• Extending Salt
• Demo
• Summary
Execution Modules
• Salt comes with over 100 modules
• Over 1000 functions
• Examples:
• pkg.install, pkg.remove
• file.copy, file.find, file.chown
• user.add, user.info
Minor Vocabulary
Clarification
• Modules contains functions
• Modules correspond to python files
• Functions correspond to methods
• There are some exceptions, but beyond today’s
scope
Add User To All Hosts
What’s Happening
• Master looks at target (‘*’) and determines hosts
• Puts message out on event bus
• Over ZeroMQ using messagepack
• Minion sees message and executes
• All execution is on minion, not master
• Minion returns data back to master
Master Maintains Job Data
• Job cache on master
• Contains history of jobs run and data returned
• Tools to query the job cache
• Default is to cache 24 hours of history
• Performance penalties when storing longer
Commands Sent In Parallel
• Command sent via event bus
• Minions see and execute
• Jobs are done asynchronously
Can Run Locally
• Command to run locally: salt-call
• No central coordination
• Data *IS* still returned to master
• Can bypass with “—local” flag
Documentation
• Function called “sys.doc”
• Uses python docstrings
• Important when writing your own custom
modules/functions
salt-call Example
• Introduction
• Architecture Overview
• Execution Modules
• States
• Data - Minion and Master
• Extending Salt
• Demo
• Summary
States
• Recipe for how a host should be configured
• Default file format is YAML (with jinja)
• Write state files on the master
• Master will sync to minion automatically
• States use the remote execution framework
• But, they are not the same
State Example
Running State Example
Running highstate
• Running individual states can be tedious
• Collect all states for a host (or “template”) in a
single file: top.ls
• Called: top file
• Target just like running the “salt” command
Example Top File
Running highstate
Targeting Example
Running Targeting Example
• Introduction
• Architecture Overview
• Execution Modules
• States
• Data - Minion and Master
• Extending Salt
• Demo
• Summary
Data: Minion and Master
• Grains: minion side data
• Example: host operating system
• Pillars: master side data
• Example: database passwords
Grains: Minion-Side Data
• Data gathered on the minion
• Master has a cache of minion grains
• Salt comes with a number of grains built in
• OS name (eg CentOS)
• number of CPUs
• kernel version
Viewing Grains
Targeting With Grains
Adding Grains
• Minion config
• /etc/salt/grains
• Via command
• sudo salt minion grains.setval foo bar
• Via python (will discuss later)
Pillars: Master-Side Data
• Data sent to a specific minion (from master)
• Typically used for sensitive data
• E.g. passwords
• Uses a “top file” (just like “states”)
Pillar Example
Running Pillar Example
Targeted Pillar Data
Running Targeted Pillars
• Introduction
• Architecture Overview
• Execution Modules
• States
• Data - Minion and Master
• Extending Salt
• Demo
• Summary
Extending Salt
• Jinja
• Custom modules/functions (python)
• salt python API (LocalClient)
• Customizations are synced via salt command
• Easy to automate
Templates Using jinja
• Jinja is a widely used python templating
language
• Inspired by Django’s templates
• Default template for flask applications
• Gives basic control commands to flat files
Jinja Example
Running The ‘vim state’
Python Module/Function
Custom Modules are NOT
Automatically Synced
Running hello.world
Docstrings Are Important
• Introduction
• Architecture Overview
• Execution Modules
• States
• Data - Minion and Master
• Extending Salt
• Demo
• Summary
Demo Minions
• minion1: development database server
• minion2: development application server
• minion3: production database server
• minion4: production application server
• Introduction
• Architecture Overview
• Execution Modules
• States
• Data - Minion and Master
• Extending Salt
• Demo
• Summary
Summary
• Master and minions encrypted communications
• Grains: minion-side data, Pillars: master-side data
• Execution functions run on the minions
• States are formulas/recipes to define a host
• Collect multiple states with highstate
• Lots of ways to extend salt functionality
Other Features
• Runners: master side orchestration
• Orchestrate Runner: master coordination of states
• Salt cloud: manage cloud virtual machines
• Salt ssh: like normal salt without minion process
• More advanced topologies
• multi-master
• master-less minions (with salt-call)
• GitFS
References
• https://docs.saltstack.com/en/latest/
• https://docs.saltstack.com/en/getstarted/
• https://github.com/saltstack/salt
Questions?
@craigs55
irc:chitown
https://www.linkedin.com/in/craigsebenik
Yes, we’re hiring!
http://matterport.com/positions/

More Related Content

PDF
Understanding salt modular sub-systems and customization
PDF
Real-time Cloud Management with SaltStack
PDF
Continuous Deployment with Jenkins and Salt
PPT
SaltConf14 - Saurabh Surana, HP Cloud - Automating operations and support wit...
PPT
SaltConf14 - Brendan Burns, Google - Management at Google Scale
PDF
Introduction to SaltStack
PPTX
Salty OPS – Saltstack Introduction
PDF
SaltConf14 - Matthew Williams, Flowroute - Salt Virt for Linux contatiners an...
Understanding salt modular sub-systems and customization
Real-time Cloud Management with SaltStack
Continuous Deployment with Jenkins and Salt
SaltConf14 - Saurabh Surana, HP Cloud - Automating operations and support wit...
SaltConf14 - Brendan Burns, Google - Management at Google Scale
Introduction to SaltStack
Salty OPS – Saltstack Introduction
SaltConf14 - Matthew Williams, Flowroute - Salt Virt for Linux contatiners an...

What's hot (20)

PDF
SaltConf14 - Craig Sebenik, LinkedIn - SaltStack at Web Scale
PPT
SaltConf14 - Oz Akan, Rackspace - Deploying OpenStack Marconi with SaltStack
PDF
Salt Air 19 - Intro to SaltStack RAET (reliable asyncronous event transport)
PDF
Pulsarctl & Pulsar Manager
PDF
Puppet Camp Chicago 2014: Running Multiple Puppet Masters (Beginner)
PDF
Running at Scale: Practical Performance Tuning with Puppet - PuppetConf 2013
PDF
Inside the Chef Push Jobs Service - ChefConf 2015
PPTX
Containerizing Network Services - Alon Harel - OpenStack Day Israel 2016
PPTX
Writing Custom Saltstack Execution Modules
PPTX
What's new in chef 12
PPTX
Creating SaltStack State data with Pyobjects
PDF
Node.js 101 with Rami Sayar
PDF
PyCon India 2012: Celery Talk
PDF
ZooKeeper - wait free protocol for coordinating processes
PPTX
Ansible MySQL MHA
PDF
Jesse Olson - Nagios Log Server Architecture Overview
PPTX
Infrastructure modeling with chef
ODP
Nagios Conference 2012 - Mike Weber - Failover
PDF
Push jobs: an orchestration building block for private Chef
PPTX
Saltconf 2016: Salt stack transport and concurrency
SaltConf14 - Craig Sebenik, LinkedIn - SaltStack at Web Scale
SaltConf14 - Oz Akan, Rackspace - Deploying OpenStack Marconi with SaltStack
Salt Air 19 - Intro to SaltStack RAET (reliable asyncronous event transport)
Pulsarctl & Pulsar Manager
Puppet Camp Chicago 2014: Running Multiple Puppet Masters (Beginner)
Running at Scale: Practical Performance Tuning with Puppet - PuppetConf 2013
Inside the Chef Push Jobs Service - ChefConf 2015
Containerizing Network Services - Alon Harel - OpenStack Day Israel 2016
Writing Custom Saltstack Execution Modules
What's new in chef 12
Creating SaltStack State data with Pyobjects
Node.js 101 with Rami Sayar
PyCon India 2012: Celery Talk
ZooKeeper - wait free protocol for coordinating processes
Ansible MySQL MHA
Jesse Olson - Nagios Log Server Architecture Overview
Infrastructure modeling with chef
Nagios Conference 2012 - Mike Weber - Failover
Push jobs: an orchestration building block for private Chef
Saltconf 2016: Salt stack transport and concurrency
Ad

Similar to Introduction to Systems Management with SaltStack (20)

PDF
John adams talk cloudy
PDF
Performance and Abstractions
PPTX
Monitoring MongoDB’s Engines in the Wild
PDF
Salt at school
PDF
Deploying and managing Solr at scale
PDF
What's new in Solr 5.0
PPTX
Operationalizing MongoDB at AOL
PPTX
MongoDC 2012: "Operationalizing" MongoDB@AOL
PDF
Stackato v2
PPTX
SQL Explore 2012: P&T Part 1
PDF
Microservices: The Best Practices
DOC
Best Data stage online training institute
PPTX
The Art & Zen of Managing Nagios with Puppet
PPTX
Configuration management
ZIP
How we use Twisted in Launchpad
PDF
Node.js
PPTX
An Azure of Things, a developer’s perspective
PPTX
PPTX
Reactive Development: Commands, Actors and Events. Oh My!!
PPT
kjdiakdnfdifjadsjkjklljlldasgjdjdljgfldjgldjgldjgl.ppt
John adams talk cloudy
Performance and Abstractions
Monitoring MongoDB’s Engines in the Wild
Salt at school
Deploying and managing Solr at scale
What's new in Solr 5.0
Operationalizing MongoDB at AOL
MongoDC 2012: "Operationalizing" MongoDB@AOL
Stackato v2
SQL Explore 2012: P&T Part 1
Microservices: The Best Practices
Best Data stage online training institute
The Art & Zen of Managing Nagios with Puppet
Configuration management
How we use Twisted in Launchpad
Node.js
An Azure of Things, a developer’s perspective
Reactive Development: Commands, Actors and Events. Oh My!!
kjdiakdnfdifjadsjkjklljlldasgjdjdljgfldjgldjgldjgl.ppt
Ad

Recently uploaded (20)

PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPT
Teaching material agriculture food technology
PDF
Modernizing your data center with Dell and AMD
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
cuic standard and advanced reporting.pdf
PPTX
Cloud computing and distributed systems.
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Big Data Technologies - Introduction.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Encapsulation_ Review paper, used for researhc scholars
Diabetes mellitus diagnosis method based random forest with bat algorithm
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Review of recent advances in non-invasive hemoglobin estimation
Teaching material agriculture food technology
Modernizing your data center with Dell and AMD
Building Integrated photovoltaic BIPV_UPV.pdf
cuic standard and advanced reporting.pdf
Cloud computing and distributed systems.
Advanced methodologies resolving dimensionality complications for autism neur...
Big Data Technologies - Introduction.pptx
Unlocking AI with Model Context Protocol (MCP)
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
The AUB Centre for AI in Media Proposal.docx
CIFDAQ's Market Insight: SEC Turns Pro Crypto
The Rise and Fall of 3GPP – Time for a Sabbatical?
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...

Introduction to Systems Management with SaltStack