SlideShare a Scribd company logo
Infrastructure as code
   with Puppet and
  Apache CloudStack
  David Nalley <david@gnsa.us> @ke4qqq
#whoami

• Recovering sysadmin
• Apache CloudStack Committer
• Designer of ugly slides
To set the stage...

• Apache CloudStack is...
 • an open source IaaS platform
 • proven in production at massive scale
 • awesome
Gorgeous UI
Decent API


• EC2 or native
•   http://incubator.apache.org/cloudstack/docs/api
So IaaS removes one
           constraint....


No longer waiting days/weeks to provision a
 machine.
...but introduces another
             constraint..


Now have to get a machine configured in a
 timely manner.
People provision stuff


Often not ops folks
Often not intimately familiar with intricacies
Baseline is important; but...
Classification


Problem: We spin up, dynamically, 1-500 VMs at
 any given time - how do we decide what
 configurations apply.
Classification


The wrong way - dedicated images for each
 purpose
Classification
editing nodes.pp


node 'foo-356.cloud.com' {
 include httpd
}
Classification
globbing


node 'foo*' {
 include httpd
}
Classification
Everything is default


node 'default' {
 include httpd
}
Classification


External node classifier
Classification
Facts
class base {
 case $::fact {
   'httpd': {
     include httpd
    }
   'otherrole': {
     include nginx
   }
  }
 }
One solution

During instance provisioning define metadata.
Custom fact for that metadata
Case statement based on that fact
Example metadata

role=webserver
location=datacenter1
environment=production
Corresponding
class base {
             manifest
case $::fact {
  'webserver': {
    include httpd
   }
  'database': {
    include postgresql
  }
 }
}
Links, et al

Fact:
 http://s.apache.org/acs_userdata
Blog with details:
  http://s.apache.org/acs_userdata2
Video is here, go watch it


• I only have 45 minutes - so can't delve into
  everything, you should watch the video- it’s
  great.
• http://youtu.be/c8YWctfOpwo
And then there was a
              knife.....plugin

• So the folks at Edmunds.com wrote a knife
    plugin for CloudStack.
• The knife plugin had the ability to define an
    application stack, potentially hundreds of
    nodes, that are interrelated, and provision
    them with a single knife command.
•   https://github.com/cloudstack-extras/knife-cloudstack
Deploying a machine with knife



knife cs server create
"name": "hadoop_cluster_a",
"description": "A small hadoop cluster with hbase",
"version": "1.0",
"environment": "production",
"servers": [
  {
     "name": "zookeeper-a, zookeeper-b, zookeeper-c",
     "description": "Zookeeper nodes",
     "template": "rhel-5.6-base",
     "service": "small",
     "port_rules": "2181",
     "run_list": "role[cluster_a], role[zookeeper_server]",
     "actions": [
       { "knife_ssh": ["role:zookeeper_server", "sudo chef-client"] }
     ]
  },
  {
     "name": "hadoop-master",
     "description": "Hadoop master node",
     "template": "rhel-5.6-base",
     "service": "large",
     "networks": "app-net, storage-net",
     "port_rules": "50070, 50030, 60010",
     "run_list": "role[cluster_a], role[hadoop_master], role[hbase_master]"
  },
  {
     "name": "hadoop-worker-a hadoop-worker-b hadoop-worker-c",
     "description": "Hadoop worker nodes",
     "template": "rhel-5.6-base",
     "service": "medium",
     "port_rules": "50075, 50060, 60030",
     "run_list": "role[cluster_a], role[hadoop_worker], role[hbase_regionserver]",
     "actions": [
       { "knife_ssh": ["role:hadoop_master", "sudo chef-client"] },
       { "http_request": "http://${hadoop-master}:50070/index.jsp" }
     ]
  }
Deploy that with...

knife cs stack create hadoop_cluster_a
I was jealous...
Then at FOSDEM 2012

• CloudStack user shows me Puppet types
    and resources for OpenNebula.
•   https://puppetlabs.com/blog/puppetizing-opennebula/


• They indicated they wanted this
    awesomeness for CloudStack....
Why???
•   They wanted to define each of their application
    stacks in puppet, so that not only the
    configuration of software on the machine, but
    the machines themselves would be configured
    by Puppet.
•   Automated deployment of test environments
    that are exactly the same
•   Really gets outside of machine configuration to
    entire infrastructure configuration
What we have grown used to



Puppet _defines_ the configuration within the
 machine
What we want...
What we want...


Puppet _defines_ the machine
What we want...


Puppet _defines_ a collection of machines
What we want...


Puppet _defines_ ALL the machines
This even has its own buzzword



     Software defined datacenter
...and then at PuppetConf


• There was Google Compute Engine types
    and resources for Puppet.
• Dan Bode gave a presentation showing off
    the work he had done... that presentation is
    worth seeing...
•   http://www.slideshare.net/bodepd/google-compute-presentation-puppet-conf
Puppet and CloudStack
So then for Christmas...


• puppet types and providers arrived -
    courtesy of Dan Bode
•   https://github.com/bodepd/cloudstack_resources
So how does this work

cloudstack_instance { 'foo1':
  ensure   => present,
  flavor  => 'Small Instance',
  zone    => 'FMT-ACS-001',
  image    => 'CentOS 5.6(64-bit) no GUI (XenServer)',
  network => 'puppetlabs-network',
  # domain
  # account
  # hostname
  }
Setting defaults
Cloudstack_instance {
     image => 'CentOS 6.3',
     flavor => 'M1.medium',
     zone => 'San Jose',
     network => 'davids_net',
     keypair => 'david_keys',
  }
  cloudstack_instance {
     ensure => $::ensure,
     group => 'role=db',
  }
A simple stack
class my_web_stack {
  cloudstack_instance { 'foo4':
        ensure => present,
        group => 'role=apache',
     }
     cloudstack_instance { 'foo5':
        ensure => present,
        group => 'role=db',
     }
  }
Define all your
infrastructure
Resources/contact
Me: David Nalley <david@gnsa.us> @ke4qqq
CloudStack: http://cloudstack.org
  cloudstack-users@incubator.apache.org
cloudstack_resources:
 https://github.com/bodepd/cloudstack_resources

Jason Hancock Vids
   http://youtu.be/c8YWctfOpwo
   http://youtu.be/8W0BqCmNZQQ

More Related Content

ODP
Infrastructure as code with Puppet and Apache CloudStack
PDF
Automating CloudStack with Puppet - David Nalley
PDF
Integrating cloud stack with puppet
PPTX
Packer, where DevOps begins
ODP
Puppet and Apache CloudStack
PPTX
Building Windows Images with Packer
PDF
Usecase examples of Packer
PDF
Service Delivery Assembly Line with Vagrant, Packer, and Ansible
Infrastructure as code with Puppet and Apache CloudStack
Automating CloudStack with Puppet - David Nalley
Integrating cloud stack with puppet
Packer, where DevOps begins
Puppet and Apache CloudStack
Building Windows Images with Packer
Usecase examples of Packer
Service Delivery Assembly Line with Vagrant, Packer, and Ansible

What's hot (20)

PDF
OpenSource ToolChain for the Hybrid Cloud
PPTX
Automation with Packer and TerraForm
PDF
PPTX
Introduction to Packer and Suitcase: A Packer-based OS Image Build System
ODP
Puppet and the HashiCorp Suite
PDF
Deploying VMware vCloud Hybrid Service with Puppet - PuppetConf 2013
PDF
A Introduction of Packer
PDF
Rackspace Hack Night - Vagrant & Packer
PPTX
Ansible fest Presentation slides
PPTX
Learn you some Ansible for great good!
PPTX
ILM - Pipeline in the cloud
PDF
(2016-06-11) Packer: Make Multi-Platform Images
PPTX
Packer
PPTX
OpenStack Glance
PDF
Apache Cassandra and Go
KEY
Open Atrium (DrupalCon Paris 2009, Day 3)
PPTX
Ufo Ship for AWS ECS
PDF
Using Ansible for Deploying to Cloud Environments
PPTX
Stack kicker devopsdays-london-2013
PPTX
An intro to Docker, Terraform, and Amazon ECS
OpenSource ToolChain for the Hybrid Cloud
Automation with Packer and TerraForm
Introduction to Packer and Suitcase: A Packer-based OS Image Build System
Puppet and the HashiCorp Suite
Deploying VMware vCloud Hybrid Service with Puppet - PuppetConf 2013
A Introduction of Packer
Rackspace Hack Night - Vagrant & Packer
Ansible fest Presentation slides
Learn you some Ansible for great good!
ILM - Pipeline in the cloud
(2016-06-11) Packer: Make Multi-Platform Images
Packer
OpenStack Glance
Apache Cassandra and Go
Open Atrium (DrupalCon Paris 2009, Day 3)
Ufo Ship for AWS ECS
Using Ansible for Deploying to Cloud Environments
Stack kicker devopsdays-london-2013
An intro to Docker, Terraform, and Amazon ECS
Ad

Similar to Puppet and CloudStack (20)

ODP
Puppet and Apache CloudStack
ODP
Puppetpreso
PDF
Infrastructure as code with Puppet and Apache CloudStack
PDF
ApacheCloudStack
PPT
Automating Your CloudStack Cloud with Puppet
PDF
Txlf2012
PPT
PowerPoint Presentation
PPTX
Getting Started with Apache CloudStack
PDF
Building a Dev/Test Cloud with Apache CloudStack
PPTX
Apache CloudStack from API to UI
PDF
Hacking apache cloud stack
PDF
Cloudstack for beginners
PPT
Introduction to Apache CloudStack by David Nalley
PDF
CloudStack - LinuxFest NorthWest
PPTX
Apache CloudStack: API to UI (STLLUG)
PPTX
Openstack Summit Tokyo 2015 - Building a private cloud to efficiently handle ...
PDF
Cloud stack for_beginners
PPTX
Deploying Apache CloudStack from API to UI
PPTX
Cloud computing and OpenStack
PPTX
Puppet Camp Seattle 2014: Puppet: Cloud Infrastructure as Code
Puppet and Apache CloudStack
Puppetpreso
Infrastructure as code with Puppet and Apache CloudStack
ApacheCloudStack
Automating Your CloudStack Cloud with Puppet
Txlf2012
PowerPoint Presentation
Getting Started with Apache CloudStack
Building a Dev/Test Cloud with Apache CloudStack
Apache CloudStack from API to UI
Hacking apache cloud stack
Cloudstack for beginners
Introduction to Apache CloudStack by David Nalley
CloudStack - LinuxFest NorthWest
Apache CloudStack: API to UI (STLLUG)
Openstack Summit Tokyo 2015 - Building a private cloud to efficiently handle ...
Cloud stack for_beginners
Deploying Apache CloudStack from API to UI
Cloud computing and OpenStack
Puppet Camp Seattle 2014: Puppet: Cloud Infrastructure as Code
Ad

More from ke4qqq (15)

PPTX
The Tragedy of Open Source
PPT
On-demand Continuous Integration with Jenkins, jclouds, and CloudStack
PPTX
Cloud Innovation and Risks
PPTX
Understanding the CloudStack Release Process
PPTX
ApacheConEU Keynote: What is the value of the Apache Software Foundation
PDF
Ceph and Apache CloudStack
PDF
It's not tools, Stupid
PDF
DevOps, Cloud, and the Death of Backup Tape Changers
ODP
Building a Dev/Test Cloud with Apache CloudStack
PPT
10 Minute Overview of Apache CloudStack
PPT
CloudStack Intro NYC
PDF
Bacd zenoss
ODP
Build a Cloud Day - CloudStack
ODP
Build a Cloud Day - CloudStack
PPTX
Successfully deploy build manage your cloud with cloud stack2
The Tragedy of Open Source
On-demand Continuous Integration with Jenkins, jclouds, and CloudStack
Cloud Innovation and Risks
Understanding the CloudStack Release Process
ApacheConEU Keynote: What is the value of the Apache Software Foundation
Ceph and Apache CloudStack
It's not tools, Stupid
DevOps, Cloud, and the Death of Backup Tape Changers
Building a Dev/Test Cloud with Apache CloudStack
10 Minute Overview of Apache CloudStack
CloudStack Intro NYC
Bacd zenoss
Build a Cloud Day - CloudStack
Build a Cloud Day - CloudStack
Successfully deploy build manage your cloud with cloud stack2

Recently uploaded (20)

PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Spectroscopy.pptx food analysis technology
PDF
Encapsulation theory and applications.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Machine learning based COVID-19 study performance prediction
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
The Rise and Fall of 3GPP – Time for a Sabbatical?
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Review of recent advances in non-invasive hemoglobin estimation
Advanced methodologies resolving dimensionality complications for autism neur...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Big Data Technologies - Introduction.pptx
Spectroscopy.pptx food analysis technology
Encapsulation theory and applications.pdf
Understanding_Digital_Forensics_Presentation.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Machine learning based COVID-19 study performance prediction
NewMind AI Weekly Chronicles - August'25 Week I
Building Integrated photovoltaic BIPV_UPV.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Unlocking AI with Model Context Protocol (MCP)
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
MYSQL Presentation for SQL database connectivity
Reach Out and Touch Someone: Haptics and Empathic Computing
Per capita expenditure prediction using model stacking based on satellite ima...

Puppet and CloudStack

  • 1. Infrastructure as code with Puppet and Apache CloudStack David Nalley <[email protected]> @ke4qqq
  • 2. #whoami • Recovering sysadmin • Apache CloudStack Committer • Designer of ugly slides
  • 3. To set the stage... • Apache CloudStack is... • an open source IaaS platform • proven in production at massive scale • awesome
  • 5. Decent API • EC2 or native • http://incubator.apache.org/cloudstack/docs/api
  • 6. So IaaS removes one constraint.... No longer waiting days/weeks to provision a machine.
  • 7. ...but introduces another constraint.. Now have to get a machine configured in a timely manner.
  • 8. People provision stuff Often not ops folks Often not intimately familiar with intricacies
  • 10. Classification Problem: We spin up, dynamically, 1-500 VMs at any given time - how do we decide what configurations apply.
  • 11. Classification The wrong way - dedicated images for each purpose
  • 14. Classification Everything is default node 'default' { include httpd }
  • 16. Classification Facts class base { case $::fact { 'httpd': { include httpd } 'otherrole': { include nginx } } }
  • 17. One solution During instance provisioning define metadata. Custom fact for that metadata Case statement based on that fact
  • 19. Corresponding class base { manifest case $::fact { 'webserver': { include httpd } 'database': { include postgresql } } }
  • 20. Links, et al Fact: http://s.apache.org/acs_userdata Blog with details: http://s.apache.org/acs_userdata2
  • 21. Video is here, go watch it • I only have 45 minutes - so can't delve into everything, you should watch the video- it’s great. • http://youtu.be/c8YWctfOpwo
  • 22. And then there was a knife.....plugin • So the folks at Edmunds.com wrote a knife plugin for CloudStack. • The knife plugin had the ability to define an application stack, potentially hundreds of nodes, that are interrelated, and provision them with a single knife command. • https://github.com/cloudstack-extras/knife-cloudstack
  • 23. Deploying a machine with knife knife cs server create
  • 24. "name": "hadoop_cluster_a", "description": "A small hadoop cluster with hbase", "version": "1.0", "environment": "production", "servers": [ { "name": "zookeeper-a, zookeeper-b, zookeeper-c", "description": "Zookeeper nodes", "template": "rhel-5.6-base", "service": "small", "port_rules": "2181", "run_list": "role[cluster_a], role[zookeeper_server]", "actions": [ { "knife_ssh": ["role:zookeeper_server", "sudo chef-client"] } ] }, { "name": "hadoop-master", "description": "Hadoop master node", "template": "rhel-5.6-base", "service": "large", "networks": "app-net, storage-net", "port_rules": "50070, 50030, 60010", "run_list": "role[cluster_a], role[hadoop_master], role[hbase_master]" }, { "name": "hadoop-worker-a hadoop-worker-b hadoop-worker-c", "description": "Hadoop worker nodes", "template": "rhel-5.6-base", "service": "medium", "port_rules": "50075, 50060, 60030", "run_list": "role[cluster_a], role[hadoop_worker], role[hbase_regionserver]", "actions": [ { "knife_ssh": ["role:hadoop_master", "sudo chef-client"] }, { "http_request": "http://${hadoop-master}:50070/index.jsp" } ] }
  • 25. Deploy that with... knife cs stack create hadoop_cluster_a
  • 27. Then at FOSDEM 2012 • CloudStack user shows me Puppet types and resources for OpenNebula. • https://puppetlabs.com/blog/puppetizing-opennebula/ • They indicated they wanted this awesomeness for CloudStack....
  • 28. Why??? • They wanted to define each of their application stacks in puppet, so that not only the configuration of software on the machine, but the machines themselves would be configured by Puppet. • Automated deployment of test environments that are exactly the same • Really gets outside of machine configuration to entire infrastructure configuration
  • 29. What we have grown used to Puppet _defines_ the configuration within the machine
  • 31. What we want... Puppet _defines_ the machine
  • 32. What we want... Puppet _defines_ a collection of machines
  • 33. What we want... Puppet _defines_ ALL the machines
  • 34. This even has its own buzzword Software defined datacenter
  • 35. ...and then at PuppetConf • There was Google Compute Engine types and resources for Puppet. • Dan Bode gave a presentation showing off the work he had done... that presentation is worth seeing... • http://www.slideshare.net/bodepd/google-compute-presentation-puppet-conf
  • 37. So then for Christmas... • puppet types and providers arrived - courtesy of Dan Bode • https://github.com/bodepd/cloudstack_resources
  • 38. So how does this work cloudstack_instance { 'foo1': ensure => present, flavor => 'Small Instance', zone => 'FMT-ACS-001', image => 'CentOS 5.6(64-bit) no GUI (XenServer)', network => 'puppetlabs-network', # domain # account # hostname }
  • 39. Setting defaults Cloudstack_instance { image => 'CentOS 6.3', flavor => 'M1.medium', zone => 'San Jose', network => 'davids_net', keypair => 'david_keys', } cloudstack_instance { ensure => $::ensure, group => 'role=db', }
  • 40. A simple stack class my_web_stack { cloudstack_instance { 'foo4': ensure => present, group => 'role=apache', } cloudstack_instance { 'foo5': ensure => present, group => 'role=db', } }
  • 42. Resources/contact Me: David Nalley <[email protected]> @ke4qqq CloudStack: http://cloudstack.org [email protected] cloudstack_resources: https://github.com/bodepd/cloudstack_resources Jason Hancock Vids http://youtu.be/c8YWctfOpwo http://youtu.be/8W0BqCmNZQQ