SlideShare a Scribd company logo
Automating Cloud Deployments with Chef [email_address] www.opscode.com Twitter/IRC/GitHub: mattray
U has a cloud Now what? http://www.flickr.com/photos/ian_munroe/4758240536/ Congratulations!!!
But then what? http://www.flickr.com/photos/doctorow/2698336843
You need to configure them
 
APIs are awesome! You can provision  compute  resources in seconds You can provision  storage  resources in seconds That’ s cool. http://www.flickr.com/photos/jdhancock/3634246981/
Chef can help with that knife ec2 server create  knife rackspace server create knife terremark server create knife voxel server create knife cloudstack server create  knife kvm server create  knife vsphere server create  knife eucalyptus server create  knife openstack server create http://www.flickr.com/photos/kyz/3122499444/
See Node Application Server
See Nodes Application Server Application Database
See Nodes Grow Application Server Application Databases
Application Servers Application Databases See Nodes Grow
Application Servers Application Databases Load Balancer See Nodes Grow
See Nodes Grow Application Servers Application Databases Load Balancers
See Nodes Grow Application Servers Application Database Cache Load Balancers Application Databases
Tied together with Config Application Servers Application Database Cache Load Balancers Application Databases
Infrastructure is a Snowflake Application Servers Application Database Cache Load Balancers Floating IP? Application Databases
Evolving Complexity Load Balancers Application Servers NoSQL Database Slaves Application Cache Database Cache Database
Complexity Grows Quickly DC1 DC3 DC2
http://www.flickr.com/photos/ 16339684 @N00/2681435235/ And it  Continues to Evolve
Golden Images are not the answer Gold is heavy Hard to transport Hard to mold Easy to lose configuration detail http://www.flickr.com/photos/garysoup/2977173063/
Typical Boring Infrastructure Jboss App Memcache Postgres Slaves Postgres Master Nagios Graphite
Move SSH off port 22 Lets put it on 2022 New Compliance Mandate Jboss App Memcache Postgres Slaves Postgres Master Nagios Graphite
edit /etc/ssh/sshd_config 6 Golden Image Updates Jboss App Memcache Postgres Slaves Postgres Master Nagios Graphite 1 2 3 4 5 6
Delete, launch Repeat Typically manually 8 12 Instance Replacements Jboss App Memcache Postgres Slaves Postgres Master Nagios Graphite 1 2 3 4 5 6 7 9 10 11 12
Don't break anything! In a Maintenance Window 5 Jboss App Memcache Postgres Slaves Postgres Master Nagios Graphite 1 2 4 5 6 7 8 9 10 11 12 3
Invalid Configs Bob just got fired :( With Different IP Addresses? Jboss App Memcache Postgres Slaves Postgres Master Nagios Graphite
http://www.flickr.com/photos/francoforeshock/5716969942/ Configuration Desperation
Configuration Management and Automated Systems Integration  is the Answer http://www.flickr.com/photos/philliecasablanca/3354734116/
Chef Solves This Problem But you already guessed that, didn ’t you?
Collections of Resources Networking Files Directories Symlinks Mounts Routes Users  Groups Tasks Packages Software Services Configurations Other Stuff http://www.flickr.com/photos/stevekeys/3123167585/
http://www.flickr.com/photos/glowjangles/4081048126/ Acting in Concert
http://www.flickr.com/photos/28309157@N08/3743455858/ To Provide a Service
Chef is Infrastructure as Code http://www.flickr.com/photos/louisb/4555295187/ Programmatically provision and configure Treat like any other code base Reconstruct business from code repository, data backup, and bare metal resources.
Declarative Interface to Resources Define policy Say what, not how Pull not Push http://www.flickr.com/photos/bixentro/2591838509/
That looks like this extra_packages = case node['platform']   when "ubuntu","debian"   %w{   ruby1.8   ruby1.8-dev   rdoc1.8   ri1.8   libopenssl-ruby   }   end extra_packages.each do |pkg|   package pkg do   action :install   end end
Or this search(:users, '*:*') do |u| user u['id'] do uid u['uid'] shell u['shell'] home "/home/#{u['id']}" end directory "#{home_dir}/.ssh" do owner u['id'] group u['gid'] mode "0700" end template "#{home_dir}/.ssh/authorized_keys" do source "authorized_keys.erb" owner u['id'] group u['id'] mode "0600" variables :ssh_keys => u['ssh_keys'] end end
Recipes and Cookbooks Recipes are collections of Resources Cookbooks contain recipes, templates, files, custom resources, etc Code re-use and modularity Hundreds already on Community.opscode.com http://www.flickr.com/photos/shutterhacks/4474421855/
Chef-Client generates configurations directly on nodes from their run list Reduce management complexity through abstraction Store the configuration of your programs in version control http://www.flickr.com/photos/ssoosay/5126146763/ Nodes
Upload your infrastructure knife cookbook upload chef-client knife cookbook upload java knife cookbook upload jpackage knife cookbook upload ntp knife cookbook upload sudo knife cookbook upload tomcat knife cookbook upload users knife cookbook upload sample knife role from file base.rb knife role from file tc.rb knife role from file sample.rb knife data bag create users knife data bag from file users mray.json
Build it somewhere #EC2 knife ec2 server create -S mray -i ~/.ssh/mray.pem -x ubuntu -G default -I ami-a7a97dce -f m1.small -d omnibus -r 'role[base],role[tc],role[sample] ’ #Rackspace knife rackspace server create --image 110 --flavor 2 -i ~/.ssh/mray.pem -d omnibus -r 'role[base],role[tc],role[sample] ’ #CloudStack knife cs server create -S "small instance" -T "CentOS 5.5(64-bit) no GUI (KVM)" -i ~/.ssh/mray.pem -d omnibus -r 'role[base],role[tc],role[sample] ’ #Ubuntu Linux VM knife bootstrap test.lab -i ~/.ssh/mray.pem -x ubuntu --sudo -d omnibus -r 'role[base],role[tc],role[sample]'
Tomcat stack deployed ec2-107-21-179-169.compute-1.amazonaws.com [Thu, 23 Feb 2012 03:16:27 +0000] INFO: Chef Run complete in 125.548799554 seconds ec2-107-21-179-169.compute-1.amazonaws.com [Thu, 23 Feb 2012 03:16:27 +0000] INFO: Running report handlers ec2-107-21-179-169.compute-1.amazonaws.com [Thu, 23 Feb 2012 03:16:27 +0000] INFO: Report handlers complete Instance ID: i-ee18148b Flavor: m1.small Image: ami-0c6ebd65 Region: us-east-1 Availability Zone: us-east-1b Security Groups: default SSH Key: mray Root Device Type: instance-store Public DNS Name: ec2-107-21-179-169.compute-1.amazonaws.com Public IP Address: 107.21.179.169 Private DNS Name: ip-10-120-255-91.ec2.internal Private IP Address: 10.120.255.91 Environment: _default Run List: role[base], role[tc], role[sample]
Tomcat stack deployed
Update the sample cookbook $ knife cookbook upload sample Uploading sample  [0.0.2] upload complete
Update the nodes $ knife ssh &quot;role:base&quot; &quot;sudo chef-client&quot; -i ~/.ssh/mray.pem -x ubuntu -a cloud.public_ipv4 107.21.179.169 [Thu, 23 Feb 2012 03:30:22 +0000] INFO: *** Chef 0.10.8 *** 107.21.179.169 [Thu, 23 Feb 2012 03:30:30 +0000] INFO: Run List is [role[base], role[tc], role[sample]] 107.21.179.169 [Thu, 23 Feb 2012 03:30:30 +0000] INFO: Run List expands to [chef-client, ntp, sudo, users::sysadmins, java, tomcat, sample] 107.21.179.169 [Thu, 23 Feb 2012 03:30:30 +0000] INFO: Starting Chef Run for i-ee18148b 107.21.179.169 [Thu, 23 Feb 2012 03:30:30 +0000] INFO: Running start handlers 107.21.179.169 [Thu, 23 Feb 2012 03:30:30 +0000] INFO: Start handlers complete. 107.21.179.169 [Thu, 23 Feb 2012 03:30:36 +0000] INFO: Loading cookbooks [chef-client, java, jpackage, ntp, sample, sudo, tomcat, users] 107.21.179.169 [Thu, 23 Feb 2012 03:30:36 +0000] INFO: Storing updated cookbooks/sample/recipes/default.rb in the cache. <SNIP> 107.21.179.169 [Thu, 23 Feb 2012 03:30:37 +0000] INFO: template[/var/lib/tomcat6/webapps/sample/index.html] updated content 107.21.179.169 [Thu, 23 Feb 2012 03:30:37 +0000] INFO: template[/var/lib/tomcat6/webapps/sample/index.html] sending restart action to service[tomcat] (immediate) 107.21.179.169 [Thu, 23 Feb 2012 03:30:37 +0000] INFO: Processing service[tomcat] action restart (tomcat::default line 42) 107.21.179.169 [Thu, 23 Feb 2012 03:30:45 +0000] INFO: service[tomcat] restarted 107.21.179.169 [Thu, 23 Feb 2012 03:30:45 +0000] INFO: Chef Run complete in 15.170097638 seconds 107.21.179.169 [Thu, 23 Feb 2012 03:30:45 +0000] INFO: Running report handlers 107.21.179.169 [Thu, 23 Feb 2012 03:30:45 +0000] INFO: Report handlers complete
Tomcat stack updated
http://www.flickr.com/photos/kathycsus/2686772625 IP addresses Hostnames FQDNs Search for nodes with Roles Find configuration data Search
pool_members = search(&quot;node&quot;,&quot;role:webserver ”) template &quot;/etc/haproxy/haproxy.cfg&quot; do source &quot;haproxy-app_lb.cfg.erb ” owner &quot;root&quot;  group &quot;root ” mode 0644 variables :pool_members => pool_members.uniq notifies :restart, &quot;service[haproxy] ” end Pass results into Templates
# Set up application listeners here. listen application 0.0.0.0:80 balance roundrobin <% @pool_members.each do |memb| -%> server <%= memb[:hostname] %> <%= memb[:ipaddress] %>:> weight 1 maxconn 1 check <% end -%> <% if node[&quot;haproxy&quot;][&quot;enable_admin&quot;] -%> listen admin 0.0.0.0:22002 mode http stats uri / <% end -%> Pass results into Templates
Jboss App Memcache Postgres Slaves Postgres Master So when this Nagios Graphite
Jboss App Memcache Postgres Slaves Postgres Master Nagios Graphite Becomes this
Jboss App Memcache Postgres Slaves Postgres Master Nagios Graphite Updates can be automatic
Nagios Graphite Count the resources Jboss App Memcache Postgres Slaves Load balancer config Nagios host ping Nagios host ssh Nagios host HTTP Nagios host app health Graphite CPU Graphite Memory Graphite Disk Graphite SNMP Memcache firewall Postgres firewall Postgres authZ config 12+ resource changes for 1 node addition
http://www.flickr.com/photos/evelynishere/2798236471/ CLONING CANNOT COPE WITH THIS Chef can.
Build anything Simple internal applications Complex external applications Workstations Hadoop clusters IaaS infrastructure PaaS infrastructure SaaS applications Storage systems You name it http://www.flickr.com/photos/hyku/245010680/
And manage it simply http://www.flickr.com/photos/helico/404640681/ Automatically reconfigure everything Linux, Windows, Unixes, BSDs Load balancers Metrics collection systems Monitoring systems Cloud migrations become trivial
The Chef Community Apache License, Version 2.0 550+ Individual contributors 100+ Corporate contributors Dell, Rackspace,VMware, RightScale, Heroku, and many more 400+ Community cookbooks http://community.opscode.com
Questions? http://www.flickr.com/photos/mrchippy/443960682/ Questions?
Thanks! [email_address] www.opscode.com Twitter/IRC/GitHub: mattray

More Related Content

What's hot (20)

PDF
Fabric workshop(1) - (MOSG)
Soshi Nemoto
 
PPTX
NLIT 2011: Chef & Capistrano
nickblah
 
PDF
SaltConf14 - Eric johnson, Google - Orchestrating Google Compute Engine with ...
SaltStack
 
PDF
Create Development and Production Environments with Vagrant
Brian Hogan
 
PDF
Preparation study of_docker - (MOSG)
Soshi Nemoto
 
PDF
Creating and Deploying Static Sites with Hugo
Brian Hogan
 
PDF
“warpdrive”, making Python web application deployment magically easy.
Graham Dumpleton
 
PDF
Config managament for development environments ii
Gareth Rushgrove
 
PDF
Quick and Dirty Python Deployments with Heroku
Daniel Pritchett
 
PPTX
SaltConf 2014: Safety with powertools
Thomas Jackson
 
PDF
DevOps(2) : Vagrant - (MOSG)
Soshi Nemoto
 
PPTX
Orchestration? You Don't Need Orchestration. What You Want is Choreography.
Julian Dunn
 
PDF
Automating the Network
Puppet
 
PDF
Puppet and Openshift
Gareth Rushgrove
 
KEY
Puppet for dummies - ZendCon 2011 Edition
Joshua Thijssen
 
PDF
Vagrant for real codemotion (moar tips! ;-))
Michele Orselli
 
PDF
Cookbook testing with KitcenCI and Serverrspec
Daniel Paulus
 
PDF
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
Puppet
 
PDF
Puppet Camp Berlin 2015: Pedro Pessoa | Puppet at the center of everything - ...
NETWAYS
 
PDF
Instruction: dev environment
Soshi Nemoto
 
Fabric workshop(1) - (MOSG)
Soshi Nemoto
 
NLIT 2011: Chef & Capistrano
nickblah
 
SaltConf14 - Eric johnson, Google - Orchestrating Google Compute Engine with ...
SaltStack
 
Create Development and Production Environments with Vagrant
Brian Hogan
 
Preparation study of_docker - (MOSG)
Soshi Nemoto
 
Creating and Deploying Static Sites with Hugo
Brian Hogan
 
“warpdrive”, making Python web application deployment magically easy.
Graham Dumpleton
 
Config managament for development environments ii
Gareth Rushgrove
 
Quick and Dirty Python Deployments with Heroku
Daniel Pritchett
 
SaltConf 2014: Safety with powertools
Thomas Jackson
 
DevOps(2) : Vagrant - (MOSG)
Soshi Nemoto
 
Orchestration? You Don't Need Orchestration. What You Want is Choreography.
Julian Dunn
 
Automating the Network
Puppet
 
Puppet and Openshift
Gareth Rushgrove
 
Puppet for dummies - ZendCon 2011 Edition
Joshua Thijssen
 
Vagrant for real codemotion (moar tips! ;-))
Michele Orselli
 
Cookbook testing with KitcenCI and Serverrspec
Daniel Paulus
 
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
Puppet
 
Puppet Camp Berlin 2015: Pedro Pessoa | Puppet at the center of everything - ...
NETWAYS
 
Instruction: dev environment
Soshi Nemoto
 

Viewers also liked (16)

PDF
Database Tools and Developer Software Licence Management
Michael Findling
 
PDF
ESS Group Brochure
Martin Jenkins
 
PDF
Colliers International: Retail Highlights Fall 2010
Coy Davidson
 
PDF
Alm assessment poster en
reidca
 
PPT
Alex erman&alex leoussis_eltrun
Alex Airman
 
PDF
Q plot tutorial
Abhik Seal
 
PPTX
How to do everything with PowerShell
Juan Carlos Gonzalez
 
PPTX
Bordeaux sales presenation general
PrintLAT
 
PDF
Commercialising nanotubes 2011
Applied Market Information Ltd
 
PDF
Cultec Stormwater Product Booklet
InterMountain Materials Company
 
PDF
StartAct.me - We create the new culture of success!
Aleksei Shabarshin
 
PDF
Family of boom
mekat
 
PDF
Swedbank economic outlook update, april 2014
Swedbank
 
PPTX
Humans vs Zombies
ploderup
 
PPT
Mobile app marketing
Mobile Programming LLC.
 
PDF
150224 stratus dmi_productoverview_rev9_with brochures
Greg Hamlen
 
Database Tools and Developer Software Licence Management
Michael Findling
 
ESS Group Brochure
Martin Jenkins
 
Colliers International: Retail Highlights Fall 2010
Coy Davidson
 
Alm assessment poster en
reidca
 
Alex erman&alex leoussis_eltrun
Alex Airman
 
Q plot tutorial
Abhik Seal
 
How to do everything with PowerShell
Juan Carlos Gonzalez
 
Bordeaux sales presenation general
PrintLAT
 
Commercialising nanotubes 2011
Applied Market Information Ltd
 
Cultec Stormwater Product Booklet
InterMountain Materials Company
 
StartAct.me - We create the new culture of success!
Aleksei Shabarshin
 
Family of boom
mekat
 
Swedbank economic outlook update, april 2014
Swedbank
 
Humans vs Zombies
ploderup
 
Mobile app marketing
Mobile Programming LLC.
 
150224 stratus dmi_productoverview_rev9_with brochures
Greg Hamlen
 
Ad

Similar to vBACD - Introduction to Opscode Chef - 2/29 (20)

PDF
AtlasCamp 2015 Docker continuous integration training
Steve Smith
 
PPTX
Docker on openstack by OpenSource Consulting
Open Source Consulting
 
PDF
DeveloperWeek 2015: A Practical Introduction to Docker
Steve Smith
 
PPT
MySQL 5.1 Replication
Ligaya Turmelle
 
PDF
Check the version with fixes. Link in description
Przemyslaw Koltermann
 
PDF
Docker: ao vivo e a cores
Pedro Arthur Duarte
 
PDF
AWS와 Docker Swarm을 이용한 쉽고 빠른 컨테이너 오케스트레이션 - AWS Summit Seoul 2017
Amazon Web Services Korea
 
PDF
Streamline your development environment with docker
Giacomo Bagnoli
 
PPTX
SQL Server On SANs
Quest Software
 
PDF
Docker in Production: Reality, Not Hype
bridgetkromhout
 
PPTX
Pipe your script to slack
Chikashi Kato
 
PDF
Reverse engineering Swisscom's Centro Grande Modem
Cyber Security Alliance
 
PDF
Making Spinnaker Go @ Stitch Fix
Diana Tkachenko
 
KEY
Ruby and Rails Packaging to Production
Fabio Kung
 
PDF
kubernetes practice
wonyong hwang
 
PDF
Docker, c'est bonheur !
Alexandre Salomé
 
PPTX
Practical Operation Automation with StackStorm
Shu Sugimoto
 
PPT
Capistrano Overview
Travis Roberts
 
PDF
Docker and Your Path to a Better Staging Environment - webinar by Gil Tayar
Applitools
 
PPT
Adventures in infrastructure as code
Julian Simpson
 
AtlasCamp 2015 Docker continuous integration training
Steve Smith
 
Docker on openstack by OpenSource Consulting
Open Source Consulting
 
DeveloperWeek 2015: A Practical Introduction to Docker
Steve Smith
 
MySQL 5.1 Replication
Ligaya Turmelle
 
Check the version with fixes. Link in description
Przemyslaw Koltermann
 
Docker: ao vivo e a cores
Pedro Arthur Duarte
 
AWS와 Docker Swarm을 이용한 쉽고 빠른 컨테이너 오케스트레이션 - AWS Summit Seoul 2017
Amazon Web Services Korea
 
Streamline your development environment with docker
Giacomo Bagnoli
 
SQL Server On SANs
Quest Software
 
Docker in Production: Reality, Not Hype
bridgetkromhout
 
Pipe your script to slack
Chikashi Kato
 
Reverse engineering Swisscom's Centro Grande Modem
Cyber Security Alliance
 
Making Spinnaker Go @ Stitch Fix
Diana Tkachenko
 
Ruby and Rails Packaging to Production
Fabio Kung
 
kubernetes practice
wonyong hwang
 
Docker, c'est bonheur !
Alexandre Salomé
 
Practical Operation Automation with StackStorm
Shu Sugimoto
 
Capistrano Overview
Travis Roberts
 
Docker and Your Path to a Better Staging Environment - webinar by Gil Tayar
Applitools
 
Adventures in infrastructure as code
Julian Simpson
 
Ad

More from CloudStack - Open Source Cloud Computing Project (20)

PPTX
Apache CloudStack from API to UI
CloudStack - Open Source Cloud Computing Project
 
PDF
CloudStack Hyderabad Meetup: How the Apache community works
CloudStack - Open Source Cloud Computing Project
 
PDF
CloudStack Hyderabad Meetup: Migrating applications to IaaS clouds
CloudStack - Open Source Cloud Computing Project
 
PDF
CloudStack Hyderabad Meetup: Using CloudStack to build IaaS clouds
CloudStack - Open Source Cloud Computing Project
 
PPTX
CloudStack technical overview
CloudStack - Open Source Cloud Computing Project
 
PPTX
Introduction to CloudStack: How to Deploy and Manage Infrastructure-as-a-Serv...
CloudStack - Open Source Cloud Computing Project
 
PDF
vBACD July 2012 - Apache Hadoop, Now and Beyond
CloudStack - Open Source Cloud Computing Project
 
PDF
vBACD July 2012 - Scaling Storage with Ceph
CloudStack - Open Source Cloud Computing Project
 
PPTX
vBACD July 2012 - Deploying Private PaaS with ActiveState Stackato
CloudStack - Open Source Cloud Computing Project
 
PPTX
vBACD July 2012 - Xen Cloud Platform
CloudStack - Open Source Cloud Computing Project
 
PPTX
vBACD- July 2012 - Crash Course in Open Source Cloud Computing
CloudStack - Open Source Cloud Computing Project
 
PPTX
Virtualization in the cloud
CloudStack - Open Source Cloud Computing Project
 
PDF
Build a Cloud Day San Francisco - Ubuntu Cloud
CloudStack - Open Source Cloud Computing Project
 
PPTX
Cloudstack UI Customization
CloudStack - Open Source Cloud Computing Project
 
PPTX
Management server internals
CloudStack - Open Source Cloud Computing Project
 
PPTX
Introduction to CloudStack
CloudStack - Open Source Cloud Computing Project
 
PPT
vBACD - Introduction to Puppet, Configuration Management and IT Automation So...
CloudStack - Open Source Cloud Computing Project
 
Apache CloudStack from API to UI
CloudStack - Open Source Cloud Computing Project
 
CloudStack Hyderabad Meetup: How the Apache community works
CloudStack - Open Source Cloud Computing Project
 
CloudStack Hyderabad Meetup: Migrating applications to IaaS clouds
CloudStack - Open Source Cloud Computing Project
 
CloudStack Hyderabad Meetup: Using CloudStack to build IaaS clouds
CloudStack - Open Source Cloud Computing Project
 
Introduction to CloudStack: How to Deploy and Manage Infrastructure-as-a-Serv...
CloudStack - Open Source Cloud Computing Project
 
vBACD July 2012 - Apache Hadoop, Now and Beyond
CloudStack - Open Source Cloud Computing Project
 
vBACD July 2012 - Scaling Storage with Ceph
CloudStack - Open Source Cloud Computing Project
 
vBACD July 2012 - Deploying Private PaaS with ActiveState Stackato
CloudStack - Open Source Cloud Computing Project
 
vBACD July 2012 - Xen Cloud Platform
CloudStack - Open Source Cloud Computing Project
 
vBACD- July 2012 - Crash Course in Open Source Cloud Computing
CloudStack - Open Source Cloud Computing Project
 
Build a Cloud Day San Francisco - Ubuntu Cloud
CloudStack - Open Source Cloud Computing Project
 
vBACD - Introduction to Puppet, Configuration Management and IT Automation So...
CloudStack - Open Source Cloud Computing Project
 

Recently uploaded (20)

PPTX
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
PPTX
Top Managed Service Providers in Los Angeles
Captain IT
 
PDF
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
PDF
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
PDF
NewMind AI Journal - Weekly Chronicles - July'25 Week II
NewMind AI
 
PPT
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
PDF
2025-07-15 EMEA Volledig Inzicht Dutch Webinar
ThousandEyes
 
PPTX
The Yotta x CloudStack Advantage: Scalable, India-First Cloud
ShapeBlue
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
PDF
Empowering Cloud Providers with Apache CloudStack and Stackbill
ShapeBlue
 
PDF
Novus Safe Lite- What is Novus Safe Lite.pdf
Novus Hi-Tech
 
PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PDF
Novus-Safe Pro: Brochure-What is Novus Safe Pro?.pdf
Novus Hi-Tech
 
PDF
How Current Advanced Cyber Threats Transform Business Operation
Eryk Budi Pratama
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
Top Managed Service Providers in Los Angeles
Captain IT
 
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
NewMind AI Journal - Weekly Chronicles - July'25 Week II
NewMind AI
 
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
2025-07-15 EMEA Volledig Inzicht Dutch Webinar
ThousandEyes
 
The Yotta x CloudStack Advantage: Scalable, India-First Cloud
ShapeBlue
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
Empowering Cloud Providers with Apache CloudStack and Stackbill
ShapeBlue
 
Novus Safe Lite- What is Novus Safe Lite.pdf
Novus Hi-Tech
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
Novus-Safe Pro: Brochure-What is Novus Safe Pro?.pdf
Novus Hi-Tech
 
How Current Advanced Cyber Threats Transform Business Operation
Eryk Budi Pratama
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 

vBACD - Introduction to Opscode Chef - 2/29

  • 1. Automating Cloud Deployments with Chef [email_address] www.opscode.com Twitter/IRC/GitHub: mattray
  • 2. U has a cloud Now what? http://www.flickr.com/photos/ian_munroe/4758240536/ Congratulations!!!
  • 3. But then what? http://www.flickr.com/photos/doctorow/2698336843
  • 4. You need to configure them
  • 5.  
  • 6. APIs are awesome! You can provision compute resources in seconds You can provision storage resources in seconds That’ s cool. http://www.flickr.com/photos/jdhancock/3634246981/
  • 7. Chef can help with that knife ec2 server create knife rackspace server create knife terremark server create knife voxel server create knife cloudstack server create knife kvm server create knife vsphere server create knife eucalyptus server create knife openstack server create http://www.flickr.com/photos/kyz/3122499444/
  • 9. See Nodes Application Server Application Database
  • 10. See Nodes Grow Application Server Application Databases
  • 11. Application Servers Application Databases See Nodes Grow
  • 12. Application Servers Application Databases Load Balancer See Nodes Grow
  • 13. See Nodes Grow Application Servers Application Databases Load Balancers
  • 14. See Nodes Grow Application Servers Application Database Cache Load Balancers Application Databases
  • 15. Tied together with Config Application Servers Application Database Cache Load Balancers Application Databases
  • 16. Infrastructure is a Snowflake Application Servers Application Database Cache Load Balancers Floating IP? Application Databases
  • 17. Evolving Complexity Load Balancers Application Servers NoSQL Database Slaves Application Cache Database Cache Database
  • 20. Golden Images are not the answer Gold is heavy Hard to transport Hard to mold Easy to lose configuration detail http://www.flickr.com/photos/garysoup/2977173063/
  • 21. Typical Boring Infrastructure Jboss App Memcache Postgres Slaves Postgres Master Nagios Graphite
  • 22. Move SSH off port 22 Lets put it on 2022 New Compliance Mandate Jboss App Memcache Postgres Slaves Postgres Master Nagios Graphite
  • 23. edit /etc/ssh/sshd_config 6 Golden Image Updates Jboss App Memcache Postgres Slaves Postgres Master Nagios Graphite 1 2 3 4 5 6
  • 24. Delete, launch Repeat Typically manually 8 12 Instance Replacements Jboss App Memcache Postgres Slaves Postgres Master Nagios Graphite 1 2 3 4 5 6 7 9 10 11 12
  • 25. Don't break anything! In a Maintenance Window 5 Jboss App Memcache Postgres Slaves Postgres Master Nagios Graphite 1 2 4 5 6 7 8 9 10 11 12 3
  • 26. Invalid Configs Bob just got fired :( With Different IP Addresses? Jboss App Memcache Postgres Slaves Postgres Master Nagios Graphite
  • 28. Configuration Management and Automated Systems Integration is the Answer http://www.flickr.com/photos/philliecasablanca/3354734116/
  • 29. Chef Solves This Problem But you already guessed that, didn ’t you?
  • 30. Collections of Resources Networking Files Directories Symlinks Mounts Routes Users Groups Tasks Packages Software Services Configurations Other Stuff http://www.flickr.com/photos/stevekeys/3123167585/
  • 33. Chef is Infrastructure as Code http://www.flickr.com/photos/louisb/4555295187/ Programmatically provision and configure Treat like any other code base Reconstruct business from code repository, data backup, and bare metal resources.
  • 34. Declarative Interface to Resources Define policy Say what, not how Pull not Push http://www.flickr.com/photos/bixentro/2591838509/
  • 35. That looks like this extra_packages = case node['platform'] when &quot;ubuntu&quot;,&quot;debian&quot; %w{ ruby1.8 ruby1.8-dev rdoc1.8 ri1.8 libopenssl-ruby } end extra_packages.each do |pkg| package pkg do action :install end end
  • 36. Or this search(:users, '*:*') do |u| user u['id'] do uid u['uid'] shell u['shell'] home &quot;/home/#{u['id']}&quot; end directory &quot;#{home_dir}/.ssh&quot; do owner u['id'] group u['gid'] mode &quot;0700&quot; end template &quot;#{home_dir}/.ssh/authorized_keys&quot; do source &quot;authorized_keys.erb&quot; owner u['id'] group u['id'] mode &quot;0600&quot; variables :ssh_keys => u['ssh_keys'] end end
  • 37. Recipes and Cookbooks Recipes are collections of Resources Cookbooks contain recipes, templates, files, custom resources, etc Code re-use and modularity Hundreds already on Community.opscode.com http://www.flickr.com/photos/shutterhacks/4474421855/
  • 38. Chef-Client generates configurations directly on nodes from their run list Reduce management complexity through abstraction Store the configuration of your programs in version control http://www.flickr.com/photos/ssoosay/5126146763/ Nodes
  • 39. Upload your infrastructure knife cookbook upload chef-client knife cookbook upload java knife cookbook upload jpackage knife cookbook upload ntp knife cookbook upload sudo knife cookbook upload tomcat knife cookbook upload users knife cookbook upload sample knife role from file base.rb knife role from file tc.rb knife role from file sample.rb knife data bag create users knife data bag from file users mray.json
  • 40. Build it somewhere #EC2 knife ec2 server create -S mray -i ~/.ssh/mray.pem -x ubuntu -G default -I ami-a7a97dce -f m1.small -d omnibus -r 'role[base],role[tc],role[sample] ’ #Rackspace knife rackspace server create --image 110 --flavor 2 -i ~/.ssh/mray.pem -d omnibus -r 'role[base],role[tc],role[sample] ’ #CloudStack knife cs server create -S &quot;small instance&quot; -T &quot;CentOS 5.5(64-bit) no GUI (KVM)&quot; -i ~/.ssh/mray.pem -d omnibus -r 'role[base],role[tc],role[sample] ’ #Ubuntu Linux VM knife bootstrap test.lab -i ~/.ssh/mray.pem -x ubuntu --sudo -d omnibus -r 'role[base],role[tc],role[sample]'
  • 41. Tomcat stack deployed ec2-107-21-179-169.compute-1.amazonaws.com [Thu, 23 Feb 2012 03:16:27 +0000] INFO: Chef Run complete in 125.548799554 seconds ec2-107-21-179-169.compute-1.amazonaws.com [Thu, 23 Feb 2012 03:16:27 +0000] INFO: Running report handlers ec2-107-21-179-169.compute-1.amazonaws.com [Thu, 23 Feb 2012 03:16:27 +0000] INFO: Report handlers complete Instance ID: i-ee18148b Flavor: m1.small Image: ami-0c6ebd65 Region: us-east-1 Availability Zone: us-east-1b Security Groups: default SSH Key: mray Root Device Type: instance-store Public DNS Name: ec2-107-21-179-169.compute-1.amazonaws.com Public IP Address: 107.21.179.169 Private DNS Name: ip-10-120-255-91.ec2.internal Private IP Address: 10.120.255.91 Environment: _default Run List: role[base], role[tc], role[sample]
  • 43. Update the sample cookbook $ knife cookbook upload sample Uploading sample [0.0.2] upload complete
  • 44. Update the nodes $ knife ssh &quot;role:base&quot; &quot;sudo chef-client&quot; -i ~/.ssh/mray.pem -x ubuntu -a cloud.public_ipv4 107.21.179.169 [Thu, 23 Feb 2012 03:30:22 +0000] INFO: *** Chef 0.10.8 *** 107.21.179.169 [Thu, 23 Feb 2012 03:30:30 +0000] INFO: Run List is [role[base], role[tc], role[sample]] 107.21.179.169 [Thu, 23 Feb 2012 03:30:30 +0000] INFO: Run List expands to [chef-client, ntp, sudo, users::sysadmins, java, tomcat, sample] 107.21.179.169 [Thu, 23 Feb 2012 03:30:30 +0000] INFO: Starting Chef Run for i-ee18148b 107.21.179.169 [Thu, 23 Feb 2012 03:30:30 +0000] INFO: Running start handlers 107.21.179.169 [Thu, 23 Feb 2012 03:30:30 +0000] INFO: Start handlers complete. 107.21.179.169 [Thu, 23 Feb 2012 03:30:36 +0000] INFO: Loading cookbooks [chef-client, java, jpackage, ntp, sample, sudo, tomcat, users] 107.21.179.169 [Thu, 23 Feb 2012 03:30:36 +0000] INFO: Storing updated cookbooks/sample/recipes/default.rb in the cache. <SNIP> 107.21.179.169 [Thu, 23 Feb 2012 03:30:37 +0000] INFO: template[/var/lib/tomcat6/webapps/sample/index.html] updated content 107.21.179.169 [Thu, 23 Feb 2012 03:30:37 +0000] INFO: template[/var/lib/tomcat6/webapps/sample/index.html] sending restart action to service[tomcat] (immediate) 107.21.179.169 [Thu, 23 Feb 2012 03:30:37 +0000] INFO: Processing service[tomcat] action restart (tomcat::default line 42) 107.21.179.169 [Thu, 23 Feb 2012 03:30:45 +0000] INFO: service[tomcat] restarted 107.21.179.169 [Thu, 23 Feb 2012 03:30:45 +0000] INFO: Chef Run complete in 15.170097638 seconds 107.21.179.169 [Thu, 23 Feb 2012 03:30:45 +0000] INFO: Running report handlers 107.21.179.169 [Thu, 23 Feb 2012 03:30:45 +0000] INFO: Report handlers complete
  • 46. http://www.flickr.com/photos/kathycsus/2686772625 IP addresses Hostnames FQDNs Search for nodes with Roles Find configuration data Search
  • 47. pool_members = search(&quot;node&quot;,&quot;role:webserver ”) template &quot;/etc/haproxy/haproxy.cfg&quot; do source &quot;haproxy-app_lb.cfg.erb ” owner &quot;root&quot; group &quot;root ” mode 0644 variables :pool_members => pool_members.uniq notifies :restart, &quot;service[haproxy] ” end Pass results into Templates
  • 48. # Set up application listeners here. listen application 0.0.0.0:80 balance roundrobin <% @pool_members.each do |memb| -%> server <%= memb[:hostname] %> <%= memb[:ipaddress] %>:> weight 1 maxconn 1 check <% end -%> <% if node[&quot;haproxy&quot;][&quot;enable_admin&quot;] -%> listen admin 0.0.0.0:22002 mode http stats uri / <% end -%> Pass results into Templates
  • 49. Jboss App Memcache Postgres Slaves Postgres Master So when this Nagios Graphite
  • 50. Jboss App Memcache Postgres Slaves Postgres Master Nagios Graphite Becomes this
  • 51. Jboss App Memcache Postgres Slaves Postgres Master Nagios Graphite Updates can be automatic
  • 52. Nagios Graphite Count the resources Jboss App Memcache Postgres Slaves Load balancer config Nagios host ping Nagios host ssh Nagios host HTTP Nagios host app health Graphite CPU Graphite Memory Graphite Disk Graphite SNMP Memcache firewall Postgres firewall Postgres authZ config 12+ resource changes for 1 node addition
  • 54. Build anything Simple internal applications Complex external applications Workstations Hadoop clusters IaaS infrastructure PaaS infrastructure SaaS applications Storage systems You name it http://www.flickr.com/photos/hyku/245010680/
  • 55. And manage it simply http://www.flickr.com/photos/helico/404640681/ Automatically reconfigure everything Linux, Windows, Unixes, BSDs Load balancers Metrics collection systems Monitoring systems Cloud migrations become trivial
  • 56. The Chef Community Apache License, Version 2.0 550+ Individual contributors 100+ Corporate contributors Dell, Rackspace,VMware, RightScale, Heroku, and many more 400+ Community cookbooks http://community.opscode.com
  • 58. Thanks! [email_address] www.opscode.com Twitter/IRC/GitHub: mattray

Editor's Notes

  • #3: Contratulations! You have yourself some clooooud. But now what?
  • #4: But then what? 5 minutes later, you can have an entire rack of servers at your disposal. But until you do one important thing, all they ’re doing is sitting around eating electricity and costing you money.
  • #6: Introducing Chef. Hopefully you ’ve already met! Today we&apos;re going to talk about what Chef is and what it&apos;s good for.
  • #7: APIs are awesome. They ’re what make the Cloud the Cloud. You can provision resources by simply flinging the right combination of packets at the appropriate DNS address.
  • #8: And Chef can help with that. Knife is our command line tool for talking to APIs And we have plugins for all sorts of cloud providers, both public and private. This lets you provision a server, install the chef agent on it and configure it as a database, webserver, tomcat stack or whatever from a single command.
  • #9: Let&apos;s walk through the evolution of your infrastructure. Things are going well, you&apos;ve just started a new project and your new application has come online.
  • #10: As you get your feet under you and get a feel for what you&apos;re doing, you move your database to another machine to help handle the overloaded box.
  • #11: Turns out, the database was the bottleneck, so you add another.
  • #12: Demand continues to grow, so you add another application server.
  • #13: You&apos;re going to need a load balancer for that of course, so everyone can use the same IP.
  • #14: And things are really taking off now, 2 load balancers, 5 application servers and a pair of databases. We&apos;re growing fast!
  • #15: Caching, time to add some
  • #16: This Infrastructure has a Topology. All the nodes are talking to each other and need to know about their individual interests. Maybe you don ’t want to do it that way.
  • #17: How should I know. It ’s your application. Your application is unique, and so is your infrastructure. They evolve organically.
  • #18: And as they evolve, things continue to change as you switch out components and scale
  • #19: And success breeds success, we&apos;re going nuts now.
  • #20: And a basic fact about Infrastructure -- it EVOLVES.
  • #21: Currently, the most widely used configuration management strategy is Cloning and Snapshotting. THIS DOES NOT WORK (and you know it.)
  • #22: OK, it&apos;s a JBoss stack on PostgreSQL with Nagios monitoring.
  • #23: Policy change time!!! SSH on port 22 is a security liability (OK, maybe not, but stick with the story)
  • #24: First we&apos;ll update the sshd_config on 6 golden images
  • #25: We&apos;ll have to replace the instances that are there
  • #26: 12 new boxes, be careful not to break anything. We only have 30 minutes
  • #27: IP addresses all changed, since we&apos;re in the cloud right? Oh wait, Bob screwed up.
  • #28: Tracking all these changes by hand breaks down fast. Mistakes get made and things get overlooked.
  • #29: Keep track of all the steps required to take bare metal systems to doing their job in the infrastructure. It is all about the policy. Taking all the systems that have been configured to do their job, and make them work together to actually run the infrastructure.
  • #30: How do we do this? WRT Chef, we talk about Fully Automated Infrastructure. Chef provides a framework for fully automating infrastructure, and has some important design principles. Chef makes it easy to reason about your infrastructure at scale and the predictable ordering makes it easy to understand what ’s going on. The declarative Ruby configuration language is easy to read, easy to share and flexible enough to do powerful things. Chef gives you the tools you need to manage large scale infrastructure in a coherent, logical fashion that can be picked up by the next person doing your job.
  • #31: In Chef a Node is an Abstraction of a server. With the chef server, node state data is persisted between runs. The edge node does all the heavy lifting. Resources are the things on Nodes that we manage. ... a collection of Resources that can span nodes and networks. Resources are simple things that you deal with every day as a systems administrator or developer. Resources include files, directories, mounts, routes, users, groups, packages installations, source code deployments, configuration files, and “stuff” in general.
  • #32: All this is arranged in a very specific way, to it acts in concert to provide ...
  • #33: a service. That ’s it. An Application Infrastructure provides a view of all it’s component nodes and their attributes, as well as information that needs to be shared among resources.
  • #34: When dealing with Chef, need to literally “think outside the box”, by shifting your thinking about configuration away from a single system, to that of an Application Infrastructure. The concept of an Infrastructure is an abstract one with a specific technical meaning. When we talk about Infrastructure, we mean..
  • #35: Chef gives you declarative interfaces into the Resources on those Nodes. Being declarative means that you say what you want to do, instead of how to do it. For example, you declare that package foobar-1.2.3 should be installed, or that the directory /var/log/foobar should exist. Chef pulls down policy from the chef-server, ensuring that a node down for maintenance will receive its policy update when it comes back online.
  • #36: Because we use a 3GL for the recipe config files, we can use features of ruby like case statements and iterative loops. Sysadmins don ’t need to be afraid of Ruby, they’ve been dealing with sub-standard programming languages like configuration files for years. They ’re also not limited to what the language tells them they can do.
  • #37: By using Ruby we can make calls to web services, in this case we&apos;re calling search against the Chef server for all the users stored there. We&apos;re going to iterate over them, create the users, their home directories and write out the authorized_keys file. As you need to do more complex and powerful things with your infrastructure, Chef&apos;s use of Ruby will allow you to harness whatever resources you need.
  • #39: The nodes are going to execute their run lists to configure their Resources defined in your Cookbooks and Recipes. The chef-client maintains the state of your machines, and are also responsible for generating the configuration that is the topology of the infrastructure.
  • #47: This is where the sauce is, and what enables systems integration. (back up to previous slide) When provisioning on Clouds, you typically don ’t get to do up front IP address planning So how do you point a web server to its database? You search for it.
  • #57: Chef is hackable! Permissive Apache2 license, vibrant community of awesome folks. More than 360 individual contributors, over 70 corporate contributors. Community is very important to us. That&apos;s why we&apos;re here.