SlideShare a Scribd company logo
1 of 35
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 has several problems
         for puppet
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
...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
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
  }
A simple stack
class my_web_stack {
  cloudstack_instance { 'foo4':
        ensure => present,
        group => 'role=apache',
     }
     cloudstack_instance { 'foo5':
        ensure => present,
        group => 'role=db',
     }
  }
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',
  }
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

What's hot

Windows Azure Virtual Machines
Windows Azure Virtual MachinesWindows Azure Virtual Machines
Windows Azure Virtual MachinesNeil Mackenzie
 
Thinking in Terms of a Data Center Operating System
Thinking in Terms of a Data Center Operating SystemThinking in Terms of a Data Center Operating System
Thinking in Terms of a Data Center Operating SystemWeston Bassler
 
Sven Vogel: Running CloudStack and OpenShift with NetApp on KVM
Sven Vogel: Running CloudStack and OpenShift with NetApp on KVMSven Vogel: Running CloudStack and OpenShift with NetApp on KVM
Sven Vogel: Running CloudStack and OpenShift with NetApp on KVMShapeBlue
 
On CloudStack, Docker, Kubernetes, and Big Data…Oh my ! By Sebastien Goasguen...
On CloudStack, Docker, Kubernetes, and Big Data…Oh my ! By Sebastien Goasguen...On CloudStack, Docker, Kubernetes, and Big Data…Oh my ! By Sebastien Goasguen...
On CloudStack, Docker, Kubernetes, and Big Data…Oh my ! By Sebastien Goasguen...Radhika Puthiyetath
 
Containers and CloudStack
Containers and CloudStackContainers and CloudStack
Containers and CloudStackShapeBlue
 
Dag Sonstebo - CloudStack usage service
Dag Sonstebo - CloudStack usage serviceDag Sonstebo - CloudStack usage service
Dag Sonstebo - CloudStack usage serviceShapeBlue
 
Cloudstack: the best kept secret in the cloud
Cloudstack: the best kept secret in the cloudCloudstack: the best kept secret in the cloud
Cloudstack: the best kept secret in the cloudShapeBlue
 
CloudStack challenges for China customers
CloudStack challenges for China customersCloudStack challenges for China customers
CloudStack challenges for China customersgavin_lee
 
Apache CloudStack at LinuxCon Japan
Apache CloudStack at LinuxCon JapanApache CloudStack at LinuxCon Japan
Apache CloudStack at LinuxCon JapanKimihiko Kitase
 
Ceph and Apache CloudStack
Ceph and Apache CloudStackCeph and Apache CloudStack
Ceph and Apache CloudStackke4qqq
 
Robert Sander: CloudStack and Terraform
Robert Sander: CloudStack and TerraformRobert Sander: CloudStack and Terraform
Robert Sander: CloudStack and TerraformShapeBlue
 
Ansible & CloudStack - Configuration Management
Ansible & CloudStack - Configuration ManagementAnsible & CloudStack - Configuration Management
Ansible & CloudStack - Configuration ManagementShapeBlue
 
DevCloud - Setup and Demo on Apache CloudStack
DevCloud - Setup and Demo on Apache CloudStack DevCloud - Setup and Demo on Apache CloudStack
DevCloud - Setup and Demo on Apache CloudStack buildacloud
 
Building a redundant CloudStack management cluster - Vladimir Melnik
Building a redundant CloudStack management cluster - Vladimir MelnikBuilding a redundant CloudStack management cluster - Vladimir Melnik
Building a redundant CloudStack management cluster - Vladimir MelnikShapeBlue
 
Adam Dagnall: Advanced S3 compatible storage integration in CloudStack
Adam Dagnall: Advanced S3 compatible storage integration in CloudStackAdam Dagnall: Advanced S3 compatible storage integration in CloudStack
Adam Dagnall: Advanced S3 compatible storage integration in CloudStackShapeBlue
 
CloudStack Conference Public Clouds Use Cases
CloudStack Conference Public Clouds Use CasesCloudStack Conference Public Clouds Use Cases
CloudStack Conference Public Clouds Use CasesSebastien Goasguen
 
Windows Azure Virtual Machines And Virtual Networks
Windows Azure Virtual Machines And Virtual NetworksWindows Azure Virtual Machines And Virtual Networks
Windows Azure Virtual Machines And Virtual NetworksKristof Rennen
 

What's hot (20)

Windows Azure Virtual Machines
Windows Azure Virtual MachinesWindows Azure Virtual Machines
Windows Azure Virtual Machines
 
Thinking in Terms of a Data Center Operating System
Thinking in Terms of a Data Center Operating SystemThinking in Terms of a Data Center Operating System
Thinking in Terms of a Data Center Operating System
 
Sven Vogel: Running CloudStack and OpenShift with NetApp on KVM
Sven Vogel: Running CloudStack and OpenShift with NetApp on KVMSven Vogel: Running CloudStack and OpenShift with NetApp on KVM
Sven Vogel: Running CloudStack and OpenShift with NetApp on KVM
 
On CloudStack, Docker, Kubernetes, and Big Data…Oh my ! By Sebastien Goasguen...
On CloudStack, Docker, Kubernetes, and Big Data…Oh my ! By Sebastien Goasguen...On CloudStack, Docker, Kubernetes, and Big Data…Oh my ! By Sebastien Goasguen...
On CloudStack, Docker, Kubernetes, and Big Data…Oh my ! By Sebastien Goasguen...
 
Containers and CloudStack
Containers and CloudStackContainers and CloudStack
Containers and CloudStack
 
Apache JClouds
Apache JCloudsApache JClouds
Apache JClouds
 
Dag Sonstebo - CloudStack usage service
Dag Sonstebo - CloudStack usage serviceDag Sonstebo - CloudStack usage service
Dag Sonstebo - CloudStack usage service
 
Cnam azure 2015 storage
Cnam azure 2015  storageCnam azure 2015  storage
Cnam azure 2015 storage
 
vBACD - Deploying Infrastructure-as-a-Service with CloudStack - 2/28
vBACD - Deploying Infrastructure-as-a-Service with CloudStack - 2/28vBACD - Deploying Infrastructure-as-a-Service with CloudStack - 2/28
vBACD - Deploying Infrastructure-as-a-Service with CloudStack - 2/28
 
Cloudstack: the best kept secret in the cloud
Cloudstack: the best kept secret in the cloudCloudstack: the best kept secret in the cloud
Cloudstack: the best kept secret in the cloud
 
CloudStack challenges for China customers
CloudStack challenges for China customersCloudStack challenges for China customers
CloudStack challenges for China customers
 
Apache CloudStack at LinuxCon Japan
Apache CloudStack at LinuxCon JapanApache CloudStack at LinuxCon Japan
Apache CloudStack at LinuxCon Japan
 
Ceph and Apache CloudStack
Ceph and Apache CloudStackCeph and Apache CloudStack
Ceph and Apache CloudStack
 
Robert Sander: CloudStack and Terraform
Robert Sander: CloudStack and TerraformRobert Sander: CloudStack and Terraform
Robert Sander: CloudStack and Terraform
 
Ansible & CloudStack - Configuration Management
Ansible & CloudStack - Configuration ManagementAnsible & CloudStack - Configuration Management
Ansible & CloudStack - Configuration Management
 
DevCloud - Setup and Demo on Apache CloudStack
DevCloud - Setup and Demo on Apache CloudStack DevCloud - Setup and Demo on Apache CloudStack
DevCloud - Setup and Demo on Apache CloudStack
 
Building a redundant CloudStack management cluster - Vladimir Melnik
Building a redundant CloudStack management cluster - Vladimir MelnikBuilding a redundant CloudStack management cluster - Vladimir Melnik
Building a redundant CloudStack management cluster - Vladimir Melnik
 
Adam Dagnall: Advanced S3 compatible storage integration in CloudStack
Adam Dagnall: Advanced S3 compatible storage integration in CloudStackAdam Dagnall: Advanced S3 compatible storage integration in CloudStack
Adam Dagnall: Advanced S3 compatible storage integration in CloudStack
 
CloudStack Conference Public Clouds Use Cases
CloudStack Conference Public Clouds Use CasesCloudStack Conference Public Clouds Use Cases
CloudStack Conference Public Clouds Use Cases
 
Windows Azure Virtual Machines And Virtual Networks
Windows Azure Virtual Machines And Virtual NetworksWindows Azure Virtual Machines And Virtual Networks
Windows Azure Virtual Machines And Virtual Networks
 

Similar to Puppetpreso

Puppet and CloudStack
Puppet and CloudStackPuppet and CloudStack
Puppet and CloudStackke4qqq
 
Puppet and Apache CloudStack
Puppet and Apache CloudStackPuppet and Apache CloudStack
Puppet and Apache CloudStackPuppet
 
Infrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStackInfrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStackke4qqq
 
Puppet and Apache CloudStack
Puppet and Apache CloudStackPuppet and Apache CloudStack
Puppet and Apache CloudStackPuppet
 
Stack kicker devopsdays-london-2013
Stack kicker devopsdays-london-2013Stack kicker devopsdays-london-2013
Stack kicker devopsdays-london-2013Simon McCartney
 
Infrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStackInfrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStackke4qqq
 
ApacheCloudStack
ApacheCloudStackApacheCloudStack
ApacheCloudStackPuppet
 
Just one-shade-of-openstack
Just one-shade-of-openstackJust one-shade-of-openstack
Just one-shade-of-openstackRoberto Polli
 
Introduction to Apache CloudStack by David Nalley
Introduction to Apache CloudStack by David NalleyIntroduction to Apache CloudStack by David Nalley
Introduction to Apache CloudStack by David Nalleybuildacloud
 
Cutting through the fog of cloud
Cutting through the fog of cloudCutting through the fog of cloud
Cutting through the fog of cloudKyle Rames
 
Google Cloud Platform for DeVops, by Javier Ramirez @ teowaki
Google Cloud Platform for DeVops, by Javier Ramirez @ teowakiGoogle Cloud Platform for DeVops, by Javier Ramirez @ teowaki
Google Cloud Platform for DeVops, by Javier Ramirez @ teowakijavier ramirez
 
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Cosimo Streppone
 
Postgres the hardway
Postgres the hardwayPostgres the hardway
Postgres the hardwayDave Pitts
 
OSDC 2015: Mitchell Hashimoto | Automating the Modern Datacenter, Development...
OSDC 2015: Mitchell Hashimoto | Automating the Modern Datacenter, Development...OSDC 2015: Mitchell Hashimoto | Automating the Modern Datacenter, Development...
OSDC 2015: Mitchell Hashimoto | Automating the Modern Datacenter, Development...NETWAYS
 
Reusable, composable, battle-tested Terraform modules
Reusable, composable, battle-tested Terraform modulesReusable, composable, battle-tested Terraform modules
Reusable, composable, battle-tested Terraform modulesYevgeniy Brikman
 
Automating Complex Setups with Puppet
Automating Complex Setups with PuppetAutomating Complex Setups with Puppet
Automating Complex Setups with PuppetKris Buytaert
 
Deploying OpenStack with Chef
Deploying OpenStack with ChefDeploying OpenStack with Chef
Deploying OpenStack with ChefMatt Ray
 
Building a Dev/Test Cloud with Apache CloudStack
Building a Dev/Test Cloud with Apache CloudStackBuilding a Dev/Test Cloud with Apache CloudStack
Building a Dev/Test Cloud with Apache CloudStackke4qqq
 

Similar to Puppetpreso (20)

Puppet and CloudStack
Puppet and CloudStackPuppet and CloudStack
Puppet and CloudStack
 
Puppet and Apache CloudStack
Puppet and Apache CloudStackPuppet and Apache CloudStack
Puppet and Apache CloudStack
 
Infrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStackInfrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStack
 
Puppet and Apache CloudStack
Puppet and Apache CloudStackPuppet and Apache CloudStack
Puppet and Apache CloudStack
 
Stack kicker devopsdays-london-2013
Stack kicker devopsdays-london-2013Stack kicker devopsdays-london-2013
Stack kicker devopsdays-london-2013
 
Infrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStackInfrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStack
 
ApacheCloudStack
ApacheCloudStackApacheCloudStack
ApacheCloudStack
 
Just one-shade-of-openstack
Just one-shade-of-openstackJust one-shade-of-openstack
Just one-shade-of-openstack
 
Introduction to Apache CloudStack by David Nalley
Introduction to Apache CloudStack by David NalleyIntroduction to Apache CloudStack by David Nalley
Introduction to Apache CloudStack by David Nalley
 
Cutting through the fog of cloud
Cutting through the fog of cloudCutting through the fog of cloud
Cutting through the fog of cloud
 
One-Man Ops
One-Man OpsOne-Man Ops
One-Man Ops
 
Google Cloud Platform for DeVops, by Javier Ramirez @ teowaki
Google Cloud Platform for DeVops, by Javier Ramirez @ teowakiGoogle Cloud Platform for DeVops, by Javier Ramirez @ teowaki
Google Cloud Platform for DeVops, by Javier Ramirez @ teowaki
 
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013
 
Postgres the hardway
Postgres the hardwayPostgres the hardway
Postgres the hardway
 
OSDC 2015: Mitchell Hashimoto | Automating the Modern Datacenter, Development...
OSDC 2015: Mitchell Hashimoto | Automating the Modern Datacenter, Development...OSDC 2015: Mitchell Hashimoto | Automating the Modern Datacenter, Development...
OSDC 2015: Mitchell Hashimoto | Automating the Modern Datacenter, Development...
 
TIAD : Automating the modern datacenter
TIAD : Automating the modern datacenterTIAD : Automating the modern datacenter
TIAD : Automating the modern datacenter
 
Reusable, composable, battle-tested Terraform modules
Reusable, composable, battle-tested Terraform modulesReusable, composable, battle-tested Terraform modules
Reusable, composable, battle-tested Terraform modules
 
Automating Complex Setups with Puppet
Automating Complex Setups with PuppetAutomating Complex Setups with Puppet
Automating Complex Setups with Puppet
 
Deploying OpenStack with Chef
Deploying OpenStack with ChefDeploying OpenStack with Chef
Deploying OpenStack with Chef
 
Building a Dev/Test Cloud with Apache CloudStack
Building a Dev/Test Cloud with Apache CloudStackBuilding a Dev/Test Cloud with Apache CloudStack
Building a Dev/Test Cloud with Apache CloudStack
 

More from ke4qqq

The Tragedy of Open Source
The Tragedy of Open SourceThe Tragedy of Open Source
The Tragedy of Open Sourceke4qqq
 
Cloud Innovation and Risks
Cloud Innovation and RisksCloud Innovation and Risks
Cloud Innovation and Riskske4qqq
 
Understanding the CloudStack Release Process
Understanding the CloudStack Release ProcessUnderstanding the CloudStack Release Process
Understanding the CloudStack Release Processke4qqq
 
ApacheConEU Keynote: What is the value of the Apache Software Foundation
ApacheConEU Keynote: What is the value of the Apache Software FoundationApacheConEU Keynote: What is the value of the Apache Software Foundation
ApacheConEU Keynote: What is the value of the Apache Software Foundationke4qqq
 
It's not tools, Stupid
It's not tools, StupidIt's not tools, Stupid
It's not tools, Stupidke4qqq
 
DevOps, Cloud, and the Death of Backup Tape Changers
DevOps, Cloud, and the Death of Backup Tape ChangersDevOps, Cloud, and the Death of Backup Tape Changers
DevOps, Cloud, and the Death of Backup Tape Changerske4qqq
 
10 Minute Overview of Apache CloudStack
10 Minute Overview of Apache CloudStack10 Minute Overview of Apache CloudStack
10 Minute Overview of Apache CloudStackke4qqq
 
CloudStack Intro NYC
CloudStack Intro NYCCloudStack Intro NYC
CloudStack Intro NYCke4qqq
 
CloudStack - LinuxFest NorthWest
CloudStack - LinuxFest NorthWestCloudStack - LinuxFest NorthWest
CloudStack - LinuxFest NorthWestke4qqq
 
Build a Cloud Day - CloudStack
Build a Cloud Day - CloudStackBuild a Cloud Day - CloudStack
Build a Cloud Day - CloudStackke4qqq
 
Build a Cloud Day - CloudStack
Build a Cloud Day - CloudStackBuild a Cloud Day - CloudStack
Build a Cloud Day - CloudStackke4qqq
 

More from ke4qqq (11)

The Tragedy of Open Source
The Tragedy of Open SourceThe Tragedy of Open Source
The Tragedy of Open Source
 
Cloud Innovation and Risks
Cloud Innovation and RisksCloud Innovation and Risks
Cloud Innovation and Risks
 
Understanding the CloudStack Release Process
Understanding the CloudStack Release ProcessUnderstanding the CloudStack Release Process
Understanding the CloudStack Release Process
 
ApacheConEU Keynote: What is the value of the Apache Software Foundation
ApacheConEU Keynote: What is the value of the Apache Software FoundationApacheConEU Keynote: What is the value of the Apache Software Foundation
ApacheConEU Keynote: What is the value of the Apache Software Foundation
 
It's not tools, Stupid
It's not tools, StupidIt's not tools, Stupid
It's not tools, Stupid
 
DevOps, Cloud, and the Death of Backup Tape Changers
DevOps, Cloud, and the Death of Backup Tape ChangersDevOps, Cloud, and the Death of Backup Tape Changers
DevOps, Cloud, and the Death of Backup Tape Changers
 
10 Minute Overview of Apache CloudStack
10 Minute Overview of Apache CloudStack10 Minute Overview of Apache CloudStack
10 Minute Overview of Apache CloudStack
 
CloudStack Intro NYC
CloudStack Intro NYCCloudStack Intro NYC
CloudStack Intro NYC
 
CloudStack - LinuxFest NorthWest
CloudStack - LinuxFest NorthWestCloudStack - LinuxFest NorthWest
CloudStack - LinuxFest NorthWest
 
Build a Cloud Day - CloudStack
Build a Cloud Day - CloudStackBuild a Cloud Day - CloudStack
Build a Cloud Day - CloudStack
 
Build a Cloud Day - CloudStack
Build a Cloud Day - CloudStackBuild a Cloud Day - CloudStack
Build a Cloud Day - CloudStack
 

Puppetpreso

  • 1. Infrastructure as code with Puppet and Apache CloudStack David Nalley <david@gnsa.us> @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 has several problems for puppet
  • 7. People provision stuff Often not ops folks Often not intimately familiar with intricacies
  • 9. Classification Problem: We spin up, dynamically, 1-500 VMs at any given time - how do we decide what configurations apply.
  • 10. Classification The wrong way - dedicated images for each purpose
  • 13. Classification Everything is default node 'default' { include httpd }
  • 15. Classification Facts class base { case $::fact { 'httpd': { include httpd } 'otherrole': { include nginx } } }
  • 16. One solution During instance provisioning define metadata. Custom fact for that metadata Case statement based on that fact
  • 18. Corresponding class base { manifest case $::fact { 'webserver': { include httpd } 'database': { include postgresql } } }
  • 19. Links, et al Fact: http://s.apache.org/acs_userdata Blog with details: http://s.apache.org/acs_userdata2
  • 20. 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
  • 21. 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
  • 22. Deploying a machine with knife knife cs server create
  • 23. "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" } ] }
  • 24. Deploy that with... knife cs stack create hadoop_cluster_a
  • 26. 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....
  • 27. 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
  • 28. ...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
  • 29.
  • 30. So then for Christmas... • puppet types and providers arrived - courtesy of Dan Bode • https://github.com/bodepd/cloudstack_resources
  • 31. 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 }
  • 32. A simple stack class my_web_stack { cloudstack_instance { 'foo4': ensure => present, group => 'role=apache', } cloudstack_instance { 'foo5': ensure => present, group => 'role=db', } }
  • 33. 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', }
  • 35. 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