SlideShare uma empresa Scribd logo
1 de 40
Baixar para ler offline
Integrating
                    CloudStack
                    with Puppet



Saturday, December 1, 12
About me:

                    Dan Bode
                    Integration Specialist at PuppetLabs

                    @bodepd

                    bodepd <on> freenode




Saturday, December 1, 12
Who is this talk for?

         current CloudStack Users

         Puppet beginners




Saturday, December 1, 12
It will cover

         why integrate?

         explanation of Puppet’s architecture as it applies to
         integration

         using Puppet to model VM instances




Saturday, December 1, 12
Why Integrate?




Saturday, December 1, 12
Why integrate?

         CloudStack provides an API for provisioning virtual
         machines


 deployVirtualMachine



                            Self Service API



                                 VM1




Saturday, December 1, 12
Why integrate?

         Puppet converts freshly provisioned VMs into
         functional applications




                                              Self Service APi


                                                                    Make me an
                                                   VM1              apache server
                           Here are the
                           instructions for
                           becoming an
                                                                 Puppet
                           apache server
                                                                 Master

Saturday, December 1, 12
Why integrate?

         Combined, they create fully automated application
         stacks.

                            deploy me a DB,
                            then 2 apache servers



                                 Self Service APi



                           DB1      Apache1 Apache2




Saturday, December 1, 12
Understanding
                              Puppet




Saturday, December 1, 12
2 run modes

       puppet apply - all content is stored on the individual
       nodes. commonly used for testing (or for scale)

       client/server - content is served from a central
       master (this is what we will be talking about)




Saturday, December 1, 12
A Puppet client/server run

                           Classifier            Modules

                                        Master



                            Facts                  Catalog




                                        VM1




Saturday, December 1, 12
Facter returns system specific
       information

                             Classifier            Modules

                                          Master



                           Facts                     Catalog




                                          Agent




Saturday, December 1, 12
Facter

       to see a system’s facts, run

       $ facter
       architecture => x86_64
       domain => local
       facterversion => 2.0.0
       fqdn => DansLapTop.local
       hardwareisa => i386
       hardwaremodel => x86_64
       id => danbode


Saturday, December 1, 12
Facter

              Nodes submit their facts as a part of the request
              for catalog.

              Available as top scope variables from manifests

              ie : $::fact_name

              Creating custom facts is easy.




Saturday, December 1, 12
A Puppet client/server run
                                                 Modules
                           Classifier

                                        Master



                            Facts                 Catalog




                                        VM1




Saturday, December 1, 12
Modules

              Sharable content composed of classes and defined
              resource types (configuration interfaces).




Saturday, December 1, 12
Module Forge


              http://forge.puppetlabs.com/

              http://forge.puppetlabs.com/puppetlabs/apache




Saturday, December 1, 12
Classes/defines compose resources




Saturday, December 1, 12
Resources

            Describe the configuration state of individual system
            elements.

              user { ‘dan’:
                ensure => present,
                shell => ‘/bin/bash’,
              }




Saturday, December 1, 12
Resources

            Describe the configuration state of individual system
            elements.

              user { ‘dan’:             # a user named dan
                ensure => present,      # should exist
                shell => ‘/bin/bash’,   # with this shell
              }




Saturday, December 1, 12
Resources

              package { ‘apache2’: # a package named apache2
                ensure => present, # should be installed
              }




Saturday, December 1, 12
Puppet DSL and resources




Saturday, December 1, 12
Puppet DSL and Resources

       The Puppet DSL can be used to compose collections of
       resources into classes or defined resources.




Saturday, December 1, 12
Example apache class
       class apache {
        package { ‘apache2’:
          ensure => present,
        }
        file { ‘/etc/apache2/apache2.conf’:
          content => template(‘apache2/apache2.erb’),
          require => Package[‘apache2’],
        }
        service { ‘apache2’:
          ensure => running
          subscribe => File[‘/etc/apache2/apache2.conf’]
           }
       }


Saturday, December 1, 12
A Puppet client/server run

                           Classifier
                                                 Modules

                                        Master



                                Facts              Catalog




                                        VM1




Saturday, December 1, 12
Classification


              Process that determines how Puppet maps a role
              to a specific instance.




Saturday, December 1, 12
Site manifest

                                Master
                           /etc/puppet/manifest/site.pp




     The master utilizes code from its site manifest to figure
     out how to assign a role to a node.




Saturday, December 1, 12
Site manifest
    Node blocks map a host’s certname to content from a
    module

       node /^my_node/ {
         include apache
       }




Saturday, December 1, 12
Determine role based on facts
                deploy me an apache server



                                             Self Service APi



                                                Apache1




Saturday, December 1, 12
Determine role based on facts

      ‘deployVirtualMachine’ -> userdata -> facts

      node default {
        if $::role == ‘apache’ {
          include apache
        } else {
          fail(“Undefine role: ${role}”)
        }
      }




Saturday, December 1, 12
Decouple role assignment from
       provisioning
       After provisioning is completed, ssh into a machine,
       set a custom fact (using facts.d), and trigger a
       puppet run.

       pros - you can easily execute a script to install and
       bootstrap puppet

       cons - extra step




Saturday, December 1, 12
facts.d

       facts.d comes with stdlib
       (http://forge.puppetlabs.com/puppetlabs/stdlib)

       it converts any ‘key=value’ pairs listed in /etc/
       facts.d/*.txt into facts




Saturday, December 1, 12
ENC
                                            ENC

                           Master


           The master can call out to arbitrary executables to
           figure out how a node should be classified.




Saturday, December 1, 12
ENC
          You can set the ‘group’ attribute with classification
          information when instances are created.

          The ENC can then query the ‘group’ attribute from the
          VM instance that needs to be classified.




Saturday, December 1, 12
A Puppet client/server run

                           Classifier            Modules

                                        Master



                            Facts
                                                   Catalog

                                        VM1




Saturday, December 1, 12
Catalog
          Collection of resources that describe how a node can
          achieve a specified configuration.




Saturday, December 1, 12
Catalog
     Resources
                                            Catalog
                                  Package

                           Package             File

                                                         File
                           User         User

                                  Service
Dependencies                                   Service


Saturday, December 1, 12
VM provisioning with Puppet
            (experimental! use cases
            appreciated)




Saturday, December 1, 12
Share Application Stacks as text

       class my_app_stack {
           cloudstack_instance { 'foo4':
               ensure      => present,
               group       => 'role=db',
           }
           cloudstack_instance { 'foo3':
               ensure      => present,
               group       => 'role=apache',
           }
       }




Saturday, December 1, 12
Use resource defaults for
       common settings
       Cloudstack_instance {
           image           => 'CentOS 5.6 key+pass',
           flavor          => 'Small Instance',
           zone            => 'ACS-FMT-001',
           network         => 'puppetlabs-network',
           keypair         => 'dans_keypair4',
       }
       cloudstack_instance { 'foo4':
           ensure          => $::ensure,
           group           => 'role=db',
       }
       cloudstack_instance { 'foo3':
           ensure          => $::ensure,
           group           => 'role=apache',
       }




Saturday, December 1, 12

Mais conteúdo relacionado

Mais procurados

Exploration of eucalyptus_v2.0
Exploration of eucalyptus_v2.0Exploration of eucalyptus_v2.0
Exploration of eucalyptus_v2.0
huangwenjun310
 
Cloudstack networking2
Cloudstack networking2Cloudstack networking2
Cloudstack networking2
Hiroaki Kawai
 

Mais procurados (20)

hibernate
hibernatehibernate
hibernate
 
Cassandra data modeling talk
Cassandra data modeling talkCassandra data modeling talk
Cassandra data modeling talk
 
Exploration of eucalyptus_v2.0
Exploration of eucalyptus_v2.0Exploration of eucalyptus_v2.0
Exploration of eucalyptus_v2.0
 
JRuby at Square
JRuby at SquareJRuby at Square
JRuby at Square
 
D7 entities fields
D7 entities fieldsD7 entities fields
D7 entities fields
 
ARGUS - THE OMNISCIENT CI
ARGUS - THE OMNISCIENT CIARGUS - THE OMNISCIENT CI
ARGUS - THE OMNISCIENT CI
 
3 Networking CloudStack Developer Day
3  Networking CloudStack Developer Day 3  Networking CloudStack Developer Day
3 Networking CloudStack Developer Day
 
DevCloud and CloudMonkey
DevCloud and CloudMonkeyDevCloud and CloudMonkey
DevCloud and CloudMonkey
 
JCO Conference OpenStack
JCO Conference OpenStackJCO Conference OpenStack
JCO Conference OpenStack
 
Hadoop on Virtual Machines
Hadoop on Virtual MachinesHadoop on Virtual Machines
Hadoop on Virtual Machines
 
OpenStack Boston User Group, OpenStack overview
OpenStack Boston User Group, OpenStack overviewOpenStack Boston User Group, OpenStack overview
OpenStack Boston User Group, OpenStack overview
 
Apache Hadoop on Virtual Machines
Apache Hadoop on Virtual MachinesApache Hadoop on Virtual Machines
Apache Hadoop on Virtual Machines
 
Objective C Memory Management
Objective C Memory ManagementObjective C Memory Management
Objective C Memory Management
 
iPhone Memory Management
iPhone Memory ManagementiPhone Memory Management
iPhone Memory Management
 
iOS Memory Management Basics
iOS Memory Management BasicsiOS Memory Management Basics
iOS Memory Management Basics
 
Cloudian dynamic consistency
Cloudian dynamic consistencyCloudian dynamic consistency
Cloudian dynamic consistency
 
Cloudstack networking2
Cloudstack networking2Cloudstack networking2
Cloudstack networking2
 
OSGi Cloud Ecosystems (EclipseCon 2013)
OSGi Cloud Ecosystems (EclipseCon 2013)OSGi Cloud Ecosystems (EclipseCon 2013)
OSGi Cloud Ecosystems (EclipseCon 2013)
 
Intro to CloudStack Build a Cloud Day
Intro to CloudStack Build a Cloud DayIntro to CloudStack Build a Cloud Day
Intro to CloudStack Build a Cloud Day
 
Memory management in Objective C
Memory management in Objective CMemory management in Objective C
Memory management in Objective C
 

Destaque (6)

Beginning Android Development
Beginning Android DevelopmentBeginning Android Development
Beginning Android Development
 
Social media thoughts Show v1
Social media thoughts Show v1Social media thoughts Show v1
Social media thoughts Show v1
 
Director Version 2
Director Version 2Director Version 2
Director Version 2
 
Web accessibility
Web accessibilityWeb accessibility
Web accessibility
 
Titanium setup
Titanium setupTitanium setup
Titanium setup
 
Community Works! Pfcongres 2011
Community Works! Pfcongres 2011Community Works! Pfcongres 2011
Community Works! Pfcongres 2011
 

Semelhante a Cloudstack talk

Cloud building talk
Cloud building talkCloud building talk
Cloud building talk
bodepd
 
TripCase Unit Testing with Jasmine
TripCase Unit Testing with JasmineTripCase Unit Testing with Jasmine
TripCase Unit Testing with Jasmine
Stephen Pond
 
Docker Online Meetup #3: Docker in Production
Docker Online Meetup #3: Docker in ProductionDocker Online Meetup #3: Docker in Production
Docker Online Meetup #3: Docker in Production
Docker, Inc.
 
Puppetpreso
PuppetpresoPuppetpreso
Puppetpreso
ke4qqq
 
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
ke4qqq
 
Docker Based Hadoop Provisioning
Docker Based Hadoop ProvisioningDocker Based Hadoop Provisioning
Docker Based Hadoop Provisioning
DataWorks Summit
 
Puppet and CloudStack
Puppet and CloudStackPuppet and CloudStack
Puppet and CloudStack
ke4qqq
 
Practicing Continuous Deployment
Practicing Continuous DeploymentPracticing Continuous Deployment
Practicing Continuous Deployment
zeeg
 
CloudStack, jclouds, Jenkins and CloudCat
CloudStack, jclouds, Jenkins and CloudCatCloudStack, jclouds, Jenkins and CloudCat
CloudStack, jclouds, Jenkins and CloudCat
Andrew Bayer
 

Semelhante a Cloudstack talk (20)

Automatic Configuration of Your Cloud with Puppet
Automatic Configuration of Your Cloud with PuppetAutomatic Configuration of Your Cloud with Puppet
Automatic Configuration of Your Cloud with Puppet
 
Cloud building talk
Cloud building talkCloud building talk
Cloud building talk
 
TripCase Unit Testing with Jasmine
TripCase Unit Testing with JasmineTripCase Unit Testing with Jasmine
TripCase Unit Testing with Jasmine
 
Docker Online Meetup #3: Docker in Production
Docker Online Meetup #3: Docker in ProductionDocker Online Meetup #3: Docker in Production
Docker Online Meetup #3: Docker in Production
 
Shipping Applications to Production in Containers with Docker
Shipping Applications to Production in Containers with DockerShipping Applications to Production in Containers with Docker
Shipping Applications to Production in Containers with Docker
 
Harmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and PuppetHarmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and Puppet
 
Puppet meetup testing
Puppet meetup testingPuppet meetup testing
Puppet meetup testing
 
Rapid Home Provisioning
Rapid Home ProvisioningRapid Home Provisioning
Rapid Home Provisioning
 
Puppetpreso
PuppetpresoPuppetpreso
Puppetpreso
 
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
 
Docker Based Hadoop Provisioning
Docker Based Hadoop ProvisioningDocker Based Hadoop Provisioning
Docker Based Hadoop Provisioning
 
Why Scala Is Taking Over the Big Data World
Why Scala Is Taking Over the Big Data WorldWhy Scala Is Taking Over the Big Data World
Why Scala Is Taking Over the Big Data World
 
Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)
Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)
Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)
 
Puppet and CloudStack
Puppet and CloudStackPuppet and CloudStack
Puppet and CloudStack
 
Writing & Sharing Great Modules - Puppet Camp Boston
Writing & Sharing Great Modules - Puppet Camp BostonWriting & Sharing Great Modules - Puppet Camp Boston
Writing & Sharing Great Modules - Puppet Camp Boston
 
Practicing Continuous Deployment
Practicing Continuous DeploymentPracticing Continuous Deployment
Practicing Continuous Deployment
 
CloudStack, jclouds, Jenkins and CloudCat
CloudStack, jclouds, Jenkins and CloudCatCloudStack, jclouds, Jenkins and CloudCat
CloudStack, jclouds, Jenkins and CloudCat
 
BDM32: AdamCloud Project - Part II
BDM32: AdamCloud Project - Part IIBDM32: AdamCloud Project - Part II
BDM32: AdamCloud Project - Part II
 
Automating CloudStack with Puppet - David Nalley
Automating CloudStack with Puppet - David NalleyAutomating CloudStack with Puppet - David Nalley
Automating CloudStack with Puppet - David Nalley
 

Mais de bodepd (7)

Openstack havana
Openstack havanaOpenstack havana
Openstack havana
 
Puppet as data_chicago
Puppet as data_chicagoPuppet as data_chicago
Puppet as data_chicago
 
Puppet: Orchestration framework?
Puppet: Orchestration framework?Puppet: Orchestration framework?
Puppet: Orchestration framework?
 
Openstack grizzley puppet_talk
Openstack grizzley puppet_talkOpenstack grizzley puppet_talk
Openstack grizzley puppet_talk
 
Hacking puppet
Hacking puppetHacking puppet
Hacking puppet
 
Google compute presentation puppet conf
Google compute presentation puppet confGoogle compute presentation puppet conf
Google compute presentation puppet conf
 
Openstack presentation
Openstack presentationOpenstack presentation
Openstack presentation
 

Cloudstack talk

  • 1. Integrating CloudStack with Puppet Saturday, December 1, 12
  • 2. About me: Dan Bode Integration Specialist at PuppetLabs @bodepd bodepd <on> freenode Saturday, December 1, 12
  • 3. Who is this talk for? current CloudStack Users Puppet beginners Saturday, December 1, 12
  • 4. It will cover why integrate? explanation of Puppet’s architecture as it applies to integration using Puppet to model VM instances Saturday, December 1, 12
  • 6. Why integrate? CloudStack provides an API for provisioning virtual machines deployVirtualMachine Self Service API VM1 Saturday, December 1, 12
  • 7. Why integrate? Puppet converts freshly provisioned VMs into functional applications Self Service APi Make me an VM1 apache server Here are the instructions for becoming an Puppet apache server Master Saturday, December 1, 12
  • 8. Why integrate? Combined, they create fully automated application stacks. deploy me a DB, then 2 apache servers Self Service APi DB1 Apache1 Apache2 Saturday, December 1, 12
  • 9. Understanding Puppet Saturday, December 1, 12
  • 10. 2 run modes puppet apply - all content is stored on the individual nodes. commonly used for testing (or for scale) client/server - content is served from a central master (this is what we will be talking about) Saturday, December 1, 12
  • 11. A Puppet client/server run Classifier Modules Master Facts Catalog VM1 Saturday, December 1, 12
  • 12. Facter returns system specific information Classifier Modules Master Facts Catalog Agent Saturday, December 1, 12
  • 13. Facter to see a system’s facts, run $ facter architecture => x86_64 domain => local facterversion => 2.0.0 fqdn => DansLapTop.local hardwareisa => i386 hardwaremodel => x86_64 id => danbode Saturday, December 1, 12
  • 14. Facter Nodes submit their facts as a part of the request for catalog. Available as top scope variables from manifests ie : $::fact_name Creating custom facts is easy. Saturday, December 1, 12
  • 15. A Puppet client/server run Modules Classifier Master Facts Catalog VM1 Saturday, December 1, 12
  • 16. Modules Sharable content composed of classes and defined resource types (configuration interfaces). Saturday, December 1, 12
  • 17. Module Forge http://forge.puppetlabs.com/ http://forge.puppetlabs.com/puppetlabs/apache Saturday, December 1, 12
  • 19. Resources Describe the configuration state of individual system elements. user { ‘dan’: ensure => present, shell => ‘/bin/bash’, } Saturday, December 1, 12
  • 20. Resources Describe the configuration state of individual system elements. user { ‘dan’: # a user named dan ensure => present, # should exist shell => ‘/bin/bash’, # with this shell } Saturday, December 1, 12
  • 21. Resources package { ‘apache2’: # a package named apache2 ensure => present, # should be installed } Saturday, December 1, 12
  • 22. Puppet DSL and resources Saturday, December 1, 12
  • 23. Puppet DSL and Resources The Puppet DSL can be used to compose collections of resources into classes or defined resources. Saturday, December 1, 12
  • 24. Example apache class class apache { package { ‘apache2’: ensure => present, } file { ‘/etc/apache2/apache2.conf’: content => template(‘apache2/apache2.erb’), require => Package[‘apache2’], } service { ‘apache2’: ensure => running subscribe => File[‘/etc/apache2/apache2.conf’] } } Saturday, December 1, 12
  • 25. A Puppet client/server run Classifier Modules Master Facts Catalog VM1 Saturday, December 1, 12
  • 26. Classification Process that determines how Puppet maps a role to a specific instance. Saturday, December 1, 12
  • 27. Site manifest Master /etc/puppet/manifest/site.pp The master utilizes code from its site manifest to figure out how to assign a role to a node. Saturday, December 1, 12
  • 28. Site manifest Node blocks map a host’s certname to content from a module node /^my_node/ { include apache } Saturday, December 1, 12
  • 29. Determine role based on facts deploy me an apache server Self Service APi Apache1 Saturday, December 1, 12
  • 30. Determine role based on facts ‘deployVirtualMachine’ -> userdata -> facts node default { if $::role == ‘apache’ { include apache } else { fail(“Undefine role: ${role}”) } } Saturday, December 1, 12
  • 31. Decouple role assignment from provisioning After provisioning is completed, ssh into a machine, set a custom fact (using facts.d), and trigger a puppet run. pros - you can easily execute a script to install and bootstrap puppet cons - extra step Saturday, December 1, 12
  • 32. facts.d facts.d comes with stdlib (http://forge.puppetlabs.com/puppetlabs/stdlib) it converts any ‘key=value’ pairs listed in /etc/ facts.d/*.txt into facts Saturday, December 1, 12
  • 33. ENC ENC Master The master can call out to arbitrary executables to figure out how a node should be classified. Saturday, December 1, 12
  • 34. ENC You can set the ‘group’ attribute with classification information when instances are created. The ENC can then query the ‘group’ attribute from the VM instance that needs to be classified. Saturday, December 1, 12
  • 35. A Puppet client/server run Classifier Modules Master Facts Catalog VM1 Saturday, December 1, 12
  • 36. Catalog Collection of resources that describe how a node can achieve a specified configuration. Saturday, December 1, 12
  • 37. Catalog Resources Catalog Package Package File File User User Service Dependencies Service Saturday, December 1, 12
  • 38. VM provisioning with Puppet (experimental! use cases appreciated) Saturday, December 1, 12
  • 39. Share Application Stacks as text class my_app_stack { cloudstack_instance { 'foo4': ensure => present, group => 'role=db', } cloudstack_instance { 'foo3': ensure => present, group => 'role=apache', } } Saturday, December 1, 12
  • 40. Use resource defaults for common settings Cloudstack_instance { image => 'CentOS 5.6 key+pass', flavor => 'Small Instance', zone => 'ACS-FMT-001', network => 'puppetlabs-network', keypair => 'dans_keypair4', } cloudstack_instance { 'foo4': ensure => $::ensure, group => 'role=db', } cloudstack_instance { 'foo3': ensure => $::ensure, group => 'role=apache', } Saturday, December 1, 12