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
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

PDF
Automating CloudStack with Puppet - David Nalley
PDF
Integrating cloud stack with puppet
ODP
Infrastructure as code with Puppet and Apache CloudStack
ODP
Puppet and CloudStack
ODP
Puppet and Apache CloudStack
PDF
OpenSource ToolChain for the Hybrid Cloud
PPTX
Packer, where DevOps begins
PPTX
Ansible fest Presentation slides
Automating CloudStack with Puppet - David Nalley
Integrating cloud stack with puppet
Infrastructure as code with Puppet and Apache CloudStack
Puppet and CloudStack
Puppet and Apache CloudStack
OpenSource ToolChain for the Hybrid Cloud
Packer, where DevOps begins
Ansible fest Presentation slides

What's hot (20)

PPTX
Building Windows Images with Packer
PPTX
Automation with Packer and TerraForm
PDF
Service Delivery Assembly Line with Vagrant, Packer, and Ansible
ODP
Puppet and the HashiCorp Suite
PPTX
ILM - Pipeline in the cloud
PDF
Usecase examples of Packer
PPTX
Introduction to Packer and Suitcase: A Packer-based OS Image Build System
PDF
Deploying VMware vCloud Hybrid Service with Puppet - PuppetConf 2013
PDF
Managing Your Cisco Datacenter Network with Ansible
PDF
A Introduction of Packer
PPTX
An intro to Docker, Terraform, and Amazon ECS
KEY
Making Your Capistrano Recipe Book
PDF
Kubernetes Boston — Custom High Availability of Kubernetes
PDF
Rackspace Hack Night - Vagrant & Packer
PDF
Amazon EC2 Container Service in Action
PDF
PDF
Using Ansible for Deploying to Cloud Environments
PPTX
Learn you some Ansible for great good!
PDF
Apache Cassandra and Go
PDF
Developing Terraform Modules at Scale - HashiTalks 2021
Building Windows Images with Packer
Automation with Packer and TerraForm
Service Delivery Assembly Line with Vagrant, Packer, and Ansible
Puppet and the HashiCorp Suite
ILM - Pipeline in the cloud
Usecase examples of Packer
Introduction to Packer and Suitcase: A Packer-based OS Image Build System
Deploying VMware vCloud Hybrid Service with Puppet - PuppetConf 2013
Managing Your Cisco Datacenter Network with Ansible
A Introduction of Packer
An intro to Docker, Terraform, and Amazon ECS
Making Your Capistrano Recipe Book
Kubernetes Boston — Custom High Availability of Kubernetes
Rackspace Hack Night - Vagrant & Packer
Amazon EC2 Container Service in Action
Using Ansible for Deploying to Cloud Environments
Learn you some Ansible for great good!
Apache Cassandra and Go
Developing Terraform Modules at Scale - HashiTalks 2021
Ad

Similar to 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 Puppet (20)

PPTX
Puppet Community Day: Planning the Future Together
PPTX
The Evolution of Puppet: Key Changes and Modernization Tips
PPTX
Can You Help Me Upgrade to Puppet 8? Tips, Tools & Best Practices for Your Up...
PPTX
Bolt Dynamic Inventory: Making Puppet Easier
PPTX
Customizing Reporting with the Puppet Report Processor
PPTX
Puppet at ConfigMgmtCamp 2025 Sponsor Deck
PPTX
The State of Puppet in 2025: A Presentation from Developer Relations Lead Dav...
PPTX
Let Red be Red and Green be Green: The Automated Workflow Restarter in GitHub...
PDF
Puppet camp2021 testing modules and controlrepo
PPTX
Puppetcamp r10kyaml
PDF
2021 04-15 operational verification (with notes)
PPTX
Puppet camp vscode
PDF
Modules of the twenties
PDF
Applying Roles and Profiles method to compliance code
PPTX
KGI compliance as-code approach
PDF
Enforce compliance policy with model-driven automation
PDF
Keynote: Puppet camp compliance
PPTX
Automating it management with Puppet + ServiceNow
PPTX
Puppet: The best way to harden Windows
PPTX
Simplified Patch Management with Puppet - Oct. 2020
Puppet Community Day: Planning the Future Together
The Evolution of Puppet: Key Changes and Modernization Tips
Can You Help Me Upgrade to Puppet 8? Tips, Tools & Best Practices for Your Up...
Bolt Dynamic Inventory: Making Puppet Easier
Customizing Reporting with the Puppet Report Processor
Puppet at ConfigMgmtCamp 2025 Sponsor Deck
The State of Puppet in 2025: A Presentation from Developer Relations Lead Dav...
Let Red be Red and Green be Green: The Automated Workflow Restarter in GitHub...
Puppet camp2021 testing modules and controlrepo
Puppetcamp r10kyaml
2021 04-15 operational verification (with notes)
Puppet camp vscode
Modules of the twenties
Applying Roles and Profiles method to compliance code
KGI compliance as-code approach
Enforce compliance policy with model-driven automation
Keynote: Puppet camp compliance
Automating it management with Puppet + ServiceNow
Puppet: The best way to harden Windows
Simplified Patch Management with Puppet - Oct. 2020

Recently uploaded (20)

PPTX
Tartificialntelligence_presentation.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PPTX
TLE Review Electricity (Electricity).pptx
PDF
Mushroom cultivation and it's methods.pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
A Presentation on Artificial Intelligence
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Approach and Philosophy of On baking technology
PPTX
1. Introduction to Computer Programming.pptx
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Tartificialntelligence_presentation.pptx
Machine learning based COVID-19 study performance prediction
Heart disease approach using modified random forest and particle swarm optimi...
Accuracy of neural networks in brain wave diagnosis of schizophrenia
TLE Review Electricity (Electricity).pptx
Mushroom cultivation and it's methods.pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Programs and apps: productivity, graphics, security and other tools
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Unlocking AI with Model Context Protocol (MCP)
A comparative study of natural language inference in Swahili using monolingua...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
A comparative analysis of optical character recognition models for extracting...
A Presentation on Artificial Intelligence
Per capita expenditure prediction using model stacking based on satellite ima...
NewMind AI Weekly Chronicles - August'25-Week II
Approach and Philosophy of On baking technology
1. Introduction to Computer Programming.pptx
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...

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