Razor: provision like a boss (Build-a-cloud edition)

3,244 views

Published on

Introduction to the Razor prov

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
3,244
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • About me: Puppet Labs since May
    One of the first contributors to Puppet
    Started Augeas
    Apache Deltacloud, DMTF CIMI, Red Hat for a long time
  • Yes, this is fake data, and the survey never happened
    Started by EMC/VMWare
    Nick Weaver, Tom McSweeney
    EMC World 2012
    PuppetConf 2012
  • Problem: get bits onto hardware or virt machines
    Existing solutions:
    must know each system very well
    track MAC address vs system characteristics outside of provisioning tool
    do too much (or not enough)
  • Hardware discovery
    microkernel + facter
    Classify nodes with tags
    Match with policy
    Apply installer and broker
  • Node
    References policy
    Keeps facts (JSON)
    IP address
    Store userdata via API (JSON)
  • - small DB size
    - 10's of kB per node
  • install iPXE on TFTP
    download bootstrap.ipxe from server
  • Separate MK agent from OS repo
    Build on EL
    well-known hardware support
    formal support offerings
    currently ~ 130MB
  • Node discovery with MK and facter
    Use ipxe to control boot
    Written in Ruby
    Flexible tag/rule-based policy match
    Manage large number of nodes
  • - Module by Chris Hoge
    - Known packaging issue with Openstack (dashboard/django14)
    - Need working DNS !
    - Controller runs keystone, horizon, glance, nova, mysql, rabbitmq
    - Compute runs nova compute; optionally nova network, nova api, nova volume
  • Boot locally
    Boot into MK
    register
    update facts
    Power control (IPMI)
    BIOS/firmware update
    Reinstall OS
    Unbind & run through policy table
  • Razor: provision like a boss (Build-a-cloud edition)

    1. 1. Razor - Provision like a boss David Lutterkort lutter@puppetlabs.com @lutterkort
    2. 2. PXE provisioning – satisfaction rating Rage Atrocious Horrible Meh How satisfied are you with your PXE installation solution ? (representative sample of imaginary users)
    3. 3. 3
    4. 4. 4
    5. 5. Architecture DHCP TFTP Node Server Node Client Node Node 5
    6. 6. Components Server 6
    7. 7. Components Server 7
    8. 8. Setup DHCP TFTP Server 8
    9. 9. Discovery DHCP TFTP Server PXE Node 9
    10. 10. Discovery DHCP TFTP Server P HTT Co s Fact MK Node ands mm 10
    11. 11. Setup DHCP TFTP MK Server REST Client Node Repo Broke r Tags Installer Policy 11
    12. 12. Installation DHCP TFTP MK Server REST Client Repo Broke r Tags Installer Node boot re Policy 12
    13. 13. Installation DHCP TFTP Server REST Client e stall in r Node Repo Broke r Tags Installer Policy 13
    14. 14. Installation DHCP TFTP Server REST Client Repo Broke r Tags Installer plate em t c h t lu e ● fe a ore v sage ● st s g me ni s he d ● lo fi tage ● s Node Policy 14
    15. 15. Installers DHCP TFTP Node Server Node Client Node Node 15
    16. 16. Tags • A named match rule • Rules can have complex logic [“or”, [“in”, [“fact”, “macaddress”], “de:ad:be:ef:00:01”, “de:ad:be:ef:00:02”], [“=”, “2”, [“fact”, “processorcount”]]] 16
    17. 17. Installer example --# redhat.yaml os_version: 6 description: Red Hat EL installer boot_sequence: 1: boot_install default: boot_local 17
    18. 18. Broker example # broker.json { “name”: "puppet", “broker-type”: "puppet", “configuration”: { “server”: "puppet.local.watzmann.net", “certname”: …, “environment”: “production” } } 18
    19. 19. Template example #!ipxe # boot_install.erb kernel <%= repo_url(“/vmlinuz”) %> ks=<%= file_url(“kickstart”) %> # os_boot.erb hostname <%= node.hostname %> yum -y install rubygems facter [ $? -eq 0 ] && curl <%= log_url(“ok”) %> || curl <%= log_url(“fail”, :error) %> 19
    20. 20. Policy example # policy.json { “name”: “centos”, “repo”: { “name”: “centos-6.4” }, “installer”: { “name”: “centos” }, “broker”: { “name”: “puppet” }, “hostname”: “host${id}.example.com”, “root_password”: “secret”, “max_count”: 20, “enabled”: true, “rule_number”: 100, “tags”: [{ “name”: “large-server”, “rule”: [ … ] }] }
    21. 21. 21
    22. 22. The Cloudy Part
    23. 23. ESXi → vCenter DHCP TFTP Node Razor Node vCente r GET /broker collect Node puppetlabs/ vcenter export node details Node
    24. 24. Openstack DHCP TFTP Razor puppetlabs/ openstack Cntrl Comp
    25. 25. Openstack: Controller Policy # controller.json { “name”: “controller”, “repo”: { “name”: “fedora-19” }, “installer”: { “name”: “fedora” }, “broker”: { “name”: “puppet” }, “hostname”: “controller${id}.example.com”, “root_password”: “secret”, “max_count”: 1, “enabled”: true, “rule_number”: 100, “tags”: [{ “name”: “controller”, “rule”: [ … ] }] }
    26. 26. Openstack: Compute Policy # compute.json { “name”: “compute”, “repo”: { “name”: “fedora-19” }, “installer”: { “name”: “fedora” }, “broker”: { “name”: “puppet” }, “hostname”: “compute${id}.example.com”, “root_password”: “secret”, “max_count”: 1, “enabled”: true, “rule_number”: 90, “tags”: [{ “name”: “compute”, “rule”: [ … ] }] }
    27. 27. Openstack: site.pp node /controller/ { class { 'openstack::controller': public_address => '192.168.100.10', public_interface => 'eth0', private_interface => 'eth1', … } } node /compute/ { class { 'openstack::compute': internal_address => $::ipaddress_eth0, … } }
    28. 28. The Future
    29. 29. Command and control DHCP TFTP Node Server Node Commands Client Node Node 29
    30. 30. Events DHCP TFTP Node Events Server Node Client Node Node 30
    31. 31. Don’t be a stranger • Github repos (will change) – Server: https://github.com/puppetlabs/razor-server – Microkernel: https://github.com/puppetlabs/razor-el-mk • Mailing list: http://groups.google.com/group/puppet-razor • IRC: #puppet-razor (freenode) • My email: lutter@puppetlabs.com 31

    ×