Upgrade to Pro — share decks privately, control downloads, hide ads and more …

ChefConf 2013 - Harnessing the Power of Bare Metal with Razor and Chef Server

ChefConf 2013 - Harnessing the Power of Bare Metal with Razor and Chef Server

Policy-based, metadata-driven provisioning of bare metal and virtual servers, with a RESTful API -- what's not to love? Razor is a tool that takes raw netbooted servers, installs an operating system on them and will optionally pass those servers to a Chef or Puppet server for configuration management (CM). This talk will give an overview of Razor, its key concepts, and why you want to use it. I'll cover the CM extension API, known as Razor Brokers, and how the Chef Broker can be configured to work with any Chef Server. The flexibility in Chef and Razor allows for many possibilities, so I'll walk you through some deployment architectures as well.

9891e8299426fb9b6e361b84b3155a2d?s=128

Fletcher Nichol

April 28, 2013
Tweet

More Decks by Fletcher Nichol

Other Decks in Programming

Transcript

  1. Harnessing the Power of Bare Metal with Razor and Chef

    Server Fletcher Nichol April 26, 2013 ChefConf 2013
  2. > whoami

  3. Fletcher Nichol

  4. https://bluebox.net

  5. fnichol

  6. fnichol@bluebox.net

  7. @fnichol

  8. github.com/fnichol

  9. None
  10. None
  11. Part 1: Razor

  12. ?

  13. Why do I care?

  14. Jason Stowe Cycle Computing

  15. “Treat your hardware like software”

  16. ?

  17. PXE booting

  18. +

  19. Policy (rules)

  20. …with an API

  21. “New” server

  22. Minimal OS installation

  23. (Optional) pass off to DevOps tool

  24. (Optional) pass off to DevOps tool

  25. (Optional) pass off to DevOps tool CM system

  26. Bingo!

  27. Small tool

  28. One job

  29. Well defined scope

  30. Oh yeah, and

  31. Written in Ruby

  32. …and a bit of Node.js

  33. Components

  34. Nodes Hi, I’m a server

  35. Images Your distro ISO here

  36. Models OS installation tunables

  37. Tags Give me a name

  38. Tag Matchers Match me up

  39. Policy Tell me what to be when I grow up

  40. Active Model I am me (right now)

  41. Honorable Mention

  42. BMC (IPMI) Power cycle me, please

  43. Node Lifecycle

  44. Node “check in”

  45. New node

  46. Razor server says

  47. “Go boot into this OS”

  48. Razor MicroKernel

  49. (…it’s a super fancy Tiny Core Linux distro)

  50. Puppet facter gem!

  51. Node says

  52. “Hey there, here’s a bunch of stuff about me”

  53. Posted to Razor Server

  54. Razor has rules (policies)

  55. Razor says:

  56. “Can I match this node against a rule?”

  57. “Yes!”

  58. Node + Policy

  59. Node + Policy = Active Model

  60. The active model…

  61. …has a state machine

  62. So Razor says:

  63. “Reboot, you have marching orders!”

  64. Node is led through a state machine

  65. …then “Razoring” is done

  66. …or

  67. “Can I match this node against a rule?”

  68. “No” :’(

  69. So Razor says:

  70. “That’s cool, check back with me in while”

  71. Bonus Round Are you done with me yet?

  72. If we remove the active model…

  73. Node is new once again

  74. Part 2: Razor + Chef

  75. Components, Take 2

  76. Brokers The missing link

  77. Installed node

  78. Configuration Management

  79. Existing Brokers?

  80. Puppet? Yep

  81. Simple Shell? Uh huh

  82. This is #ChefConf

  83. Chef? Totally!

  84. Configuration Set me up

  85. Chef Server URL

  86. Chef Client version

  87. validation.pem

  88. Validation client name

  89. Chef environment

  90. Omnibus Chef Installer URL

  91. [insert hackables here]

  92. Path to chef-client

  93. Optional base run list

  94. Multiple brokers possible

  95. Bonus Round Razor Chefness

  96. Create special Chef run list tags

  97. role__web_server

  98. recipe__apache2

  99. Broker Base + Run List Tags

  100. Razor metadata

  101. Razor node attributes

  102. https://gist.github.com/ fnichol/5469998

  103. Razor metadata, now in Chef search

  104. Boom.

  105. Part 3: Deployment

  106. “Fully Managed” Actively managed bare metal

  107. PXE boot. Forever.

  108. “Bake ‘n Ship” Provision and deploy bare metal

  109. Eject node from Razor VLAN

  110. Involves some orchestration

  111. Static Policy Rule-by-MAC

  112. Predetermined fate of all nodes

  113. “Dynamic Policy” Provisioning with some math

  114. Policies can have a bound limit

  115. Nodes can match multiple policies

  116. 10 Identical Nodes

  117. You say:

  118. “I need 1 load balancer node”

  119. “I need 2 database nodes”

  120. “The rest can be app nodes”

  121. Related Projects

  122. Razor Project https://github.com/puppetlabs/Razor

  123. Razor Wiki https://github.com/puppetlabs/Razor/wiki

  124. Razor Puppet Module https://github.com/puppetlabs/Razor/wiki/Installation#puppet

  125. Razor Chef Cookbook https://github.com/bbg-cookbooks/razor http://community.opscode.com/cookbooks/razor

  126. razor-vagrant-lab https://github.com/blueboxgroup/razor-vagrant-lab

  127. “Provisioning with Razor and Chef – An Interactive Demo” https://www.bluebox.net/about/blog/2013/01/provisioning-with-razor-

    and-chef-an-interactive-demo/
  128. And again…

  129. “Treat your hardware like software”

  130. Questions? Fletcher Nichol fnichol@bluebox.net @fnichol github.com/fnichol

  131. Questions? Fletcher Nichol fnichol@bluebox.net @fnichol github.com/fnichol

  132. Image Credits http://www.flickr.com/photos/droth http://www.flickr.com/photos/seattlemunicipalarchives/ 8425176934//2514631535/ http://www.flickr.com/photos/matthewgriff/4112899269/ http://www.flickr.com/photos/cooks-and-kitchens/5022997932/ http://www.flickr.com/photos/anthonycramp/4428561177/