SlideShare a Scribd company logo
Infrastructure as code
   with Puppet and
  Apache CloudStack
David Nalley <ke4qqq@apache.org> @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://cloudstack.apache.org/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
...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
Infrastructure as code with Puppet and Apache 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 { 'baz':
     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 <ke4qqq@apache.org> @ke4qqq
CloudStack: http://cloudstack.apache.org
  users@cloudstack.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
Puppet and 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
Puppet and 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
ODP
Puppet and the HashiCorp Suite
PDF
PPTX
Introduction to Packer and Suitcase: A Packer-based OS Image Build System
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!
PDF
Apache Cassandra and Go
PPTX
ILM - Pipeline in the cloud
PDF
Carlos Conde : AWS Game Days - TIAD Paris
PDF
(2016-06-11) Packer: Make Multi-Platform Images
PPTX
Ufo Ship for AWS ECS
PDF
Using Ansible for Deploying to Cloud Environments
PPTX
An intro to Docker, Terraform, and Amazon ECS
PPTX
OpenStack Glance
KEY
Open Atrium (DrupalCon Paris 2009, Day 3)
PPTX
Packer
OpenSource ToolChain for the Hybrid Cloud
Automation with Packer and TerraForm
Puppet and the HashiCorp Suite
Introduction to Packer and Suitcase: A Packer-based OS Image Build System
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!
Apache Cassandra and Go
ILM - Pipeline in the cloud
Carlos Conde : AWS Game Days - TIAD Paris
(2016-06-11) Packer: Make Multi-Platform Images
Ufo Ship for AWS ECS
Using Ansible for Deploying to Cloud Environments
An intro to Docker, Terraform, and Amazon ECS
OpenStack Glance
Open Atrium (DrupalCon Paris 2009, Day 3)
Packer
Ad

Similar to Infrastructure as code with Puppet and Apache CloudStack (20)

ODP
Puppetpreso
PDF
Infrastructure as code with Puppet and Apache CloudStack
PDF
ApacheCloudStack
PPT
Automating Your CloudStack Cloud with Puppet
PDF
Txlf2012
PPTX
Getting Started with Apache CloudStack
PPT
PowerPoint Presentation
PDF
Building a Dev/Test Cloud with Apache CloudStack
PPT
Introduction to Apache CloudStack by David Nalley
PPTX
Openstack Summit Tokyo 2015 - Building a private cloud to efficiently handle ...
PPTX
Apache CloudStack from API to UI
PDF
On CloudStack, Docker, Kubernetes, and Big Data…Oh my ! By Sebastien Goasguen...
PDF
Infrastructure as Code with Chef / Puppet
PDF
One-Man Ops
PPTX
Puppet Camp Seattle 2014: Puppet: Cloud Infrastructure as Code
PPTX
Apache CloudStack: API to UI (STLLUG)
PDF
TXLF: Automated Deployment of OpenStack with Chef
PDF
CloudStack - LinuxFest NorthWest
PPTX
Deploying Apache CloudStack from API to UI
ODP
Building a Dev/Test Cloud with Apache CloudStack
Puppetpreso
Infrastructure as code with Puppet and Apache CloudStack
ApacheCloudStack
Automating Your CloudStack Cloud with Puppet
Txlf2012
Getting Started with Apache CloudStack
PowerPoint Presentation
Building a Dev/Test Cloud with Apache CloudStack
Introduction to Apache CloudStack by David Nalley
Openstack Summit Tokyo 2015 - Building a private cloud to efficiently handle ...
Apache CloudStack from API to UI
On CloudStack, Docker, Kubernetes, and Big Data…Oh my ! By Sebastien Goasguen...
Infrastructure as Code with Chef / Puppet
One-Man Ops
Puppet Camp Seattle 2014: Puppet: Cloud Infrastructure as Code
Apache CloudStack: API to UI (STLLUG)
TXLF: Automated Deployment of OpenStack with Chef
CloudStack - LinuxFest NorthWest
Deploying Apache CloudStack from API to UI
Building a Dev/Test Cloud with Apache CloudStack
Ad

More from ke4qqq (14)

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
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
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
Review of recent advances in non-invasive hemoglobin estimation
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
A Presentation on Artificial Intelligence
PDF
KodekX | Application Modernization Development
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Approach and Philosophy of On baking technology
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
Review of recent advances in non-invasive hemoglobin estimation
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
A Presentation on Artificial Intelligence
KodekX | Application Modernization Development
20250228 LYD VKU AI Blended-Learning.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Unlocking AI with Model Context Protocol (MCP)
NewMind AI Monthly Chronicles - July 2025
Encapsulation_ Review paper, used for researhc scholars
Network Security Unit 5.pdf for BCA BBA.
Chapter 3 Spatial Domain Image Processing.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Approach and Philosophy of On baking technology
NewMind AI Weekly Chronicles - August'25 Week I
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Building Integrated photovoltaic BIPV_UPV.pdf

Infrastructure as code with Puppet and Apache CloudStack

  • 1. Infrastructure as code with Puppet and Apache CloudStack David Nalley <ke4qqq@apache.org> @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://cloudstack.apache.org/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. ...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
  • 36. So then for Christmas... • puppet types and providers arrived - courtesy of Dan Bode • https://github.com/bodepd/cloudstack_resources
  • 37. 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 }
  • 38. Setting defaults Cloudstack_instance { image => 'CentOS 6.3', flavor => 'M1.medium', zone => 'San Jose', network => 'davids_net', keypair => 'david_keys', } cloudstack_instance { 'baz': ensure => $::ensure, group => 'role=db', }
  • 39. A simple stack class my_web_stack { cloudstack_instance { 'foo4': ensure => present, group => 'role=apache', } cloudstack_instance { 'foo5': ensure => present, group => 'role=db', } }
  • 41. Resources/contact Me: David Nalley <ke4qqq@apache.org> @ke4qqq CloudStack: http://cloudstack.apache.org users@cloudstack.apache.org cloudstack_resources: https://github.com/bodepd/cloudstack_resources Jason Hancock Vids http://youtu.be/c8YWctfOpwo http://youtu.be/8W0BqCmNZQQ