Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Server locality
with Razor and LLDP
Jonas Rosland
Developer Advocate @EMC
@virtualswede
purevirtual.eu
emccode.github.io
About me
Loves automation
Using Razor and Puppet for 2 years
Spends way too much time playing
with new tools
Retro and ind...
Quick primer on Razor
Awesome provisioning tool
Policy based
No manual labor needed (except racking and cabling)
Not even ...
So what's in a policy?
A few things:
1. The repository to install from (repo)
2. What to install (task)
3. What to hand of...
Something like this
{
"name": "centos",
"repo": { "name": "centos" },
"task": { "name": "centos" },
"broker": { "name": "n...
What happens when you boot up
the server?
It boots up the Razor MicorKernel
Feeds all the HW info back to Razor
Like this
root@razor:~# razor nodes node1 facts
From http://localhost:8080/api/collections/nodes/node1:
<snip>
processorco...
What happens after you boot up
the server?
Razor applies a policy if the HW info matches a tag
A tag might look like:
{
"n...
So what if you have many servers
that look alike?
Razor grabs the next available one out of the "pool"
Works very well if ...
Example 1
You have three racks of servers
They all look alike
You want to install the top 10 with VMware vSphere
The botto...
Example 2
You have three racks of servers
They are not alike
You want to install the top 5 with OpenStack compute
The next...
Or maybe
something like
this?
What to do?
Enter Razor
MicroKernel
extensions
Extend the HW facts
Use a script to collect more facts about a node
Add that into a few defined folders
Zip it up
Point it ...
MK extension folder info
• the directory bin at the root of the zip is added to PATH
• the directory lib is added to LD_LI...
MK extension configuration
/opt/razor/config.yaml:
microkernel:
debug_level: debug
kernel_args:
# If this value is present...
Server locality with Razor and
LLDP
Using openlldp.rb created by Mike Arnold
Adding binaries and libraries for LLDP
Contai...
Result
lldp_neighbor_chassisid_ens2f0: 00:1c:73:28:65:d8
lldp_neighbor_portid_ens2f0: Ethernet17
lldp_neighbor_sysname_ens...
Making a shift
Random pools still exist
Adding control over what goes where
Not an or but an and scenario
Get both and enj...
DEMOTIME
Demo:
1. Show Razor facts without MK extension
2. Add MK extension
3. Show new facts getting in
4. Show tags that use the ...
Questions?
Thank you!
Jonas Rosland
@virtualswede
Upcoming SlideShare
Loading in …5
×

Server Locality Using Razor and LLDP - PuppetConf 2014

1,402 views

Published on

Server Locality Using Razor and LLDP - Jonas Rosland, EMC

Published in: Technology
  • Be the first to comment

Server Locality Using Razor and LLDP - PuppetConf 2014

  1. 1. Server locality with Razor and LLDP Jonas Rosland Developer Advocate @EMC @virtualswede purevirtual.eu emccode.github.io
  2. 2. About me Loves automation Using Razor and Puppet for 2 years Spends way too much time playing with new tools Retro and indie gamer
  3. 3. Quick primer on Razor Awesome provisioning tool Policy based No manual labor needed (except racking and cabling) Not even needing to find the MAC address or anything like that Just create a policy, and boot up your servers
  4. 4. So what's in a policy? A few things: 1. The repository to install from (repo) 2. What to install (task) 3. What to hand off to after deployment (broker) 4. Stuff like root passwords and hostname 5. Node metadata 6. Tags (very important)
  5. 5. Something like this { "name": "centos", "repo": { "name": "centos" }, "task": { "name": "centos" }, "broker": { "name": "noop" }, "enabled": true, "hostname": "host.lab.purevirtual.eu", "root_password": "secret", "max_count": 10, "node-metadata": { "who-is-awesome": "you", "favourite-mst3k-episode": "Pumaman" }, "tags": [{ "name": "small-vm"}] }
  6. 6. What happens when you boot up the server? It boots up the Razor MicorKernel Feeds all the HW info back to Razor
  7. 7. Like this root@razor:~# razor nodes node1 facts From http://localhost:8080/api/collections/nodes/node1: <snip> processorcount: 1 interfaces: enp0s3,lo ipaddress_enp0s3: 192.168.1.148 macaddress_enp0s3: 08:00:27:ad:77:a2 netmask_enp0s3: 255.255.255.0 <snip> is_virtual: true uniqueid: 007f0100 blockdevice_sda_size: 8589934592 uuid: 7935347B-FE5C-4381-82DD-C81093109CCF <snip>
  8. 8. What happens after you boot up the server? Razor applies a policy if the HW info matches a tag A tag might look like: { "name": "small","rule": ["and", ["=", ["num", ["fact", "processorcount"]], 1], ["=", ["fact", "is_virtual"], "true"]] }
  9. 9. So what if you have many servers that look alike? Razor grabs the next available one out of the "pool" Works very well if most of your servers run the same thing Might not apply if you want more control over what actually gets installed where
  10. 10. Example 1 You have three racks of servers They all look alike You want to install the top 10 with VMware vSphere The bottom 10 with Cloudera Hadoop
  11. 11. Example 2 You have three racks of servers They are not alike You want to install the top 5 with OpenStack compute The next 5 with VMware vSphere The next 5 with Cloudera Hadoop And the bottom 5 with EMC ScaleIO And you want each group in a certain order
  12. 12. Or maybe something like this? What to do?
  13. 13. Enter Razor MicroKernel extensions
  14. 14. Extend the HW facts Use a script to collect more facts about a node Add that into a few defined folders Zip it up Point it out in the Razor config file ... Profit!
  15. 15. MK extension folder info • the directory bin at the root of the zip is added to PATH • the directory lib is added to LD_LIBRARY_PATH • the directory lib/ruby is added to RUBYLIB • the directory facts.d is used by Facter to load external facts
  16. 16. MK extension configuration /opt/razor/config.yaml: microkernel: debug_level: debug kernel_args: # If this value is present, and points to a zip file, it will be # downloaded and unpacked by the MK client prior to checkin. This allows # for custom facts and other code to be shipped to the client without # having to rebuild the ISO image. # # If it is not set, no update will be sent, and the ISO will use only the # default facts, etc, available in the default build. # extension-zip: /opt/razor/mk-extension.zip
  17. 17. Server locality with Razor and LLDP Using openlldp.rb created by Mike Arnold Adding binaries and libraries for LLDP Contained in a zip file Pointed it out in the Razor config file ... Result?
  18. 18. Result lldp_neighbor_chassisid_ens2f0: 00:1c:73:28:65:d8 lldp_neighbor_portid_ens2f0: Ethernet17 lldp_neighbor_sysname_ens2f0: razor-switch1 lldp_neighbor_mngaddr_ipv4_ens2f0: lldp_neighbor_mngaddr_ipv6_ens2f0: lldp_neighbor_pvid_ens2f0: 1 lldp_neighbor_mtu_ens2f0: 9236
  19. 19. Making a shift Random pools still exist Adding control over what goes where Not an or but an and scenario Get both and enjoy the benefits!
  20. 20. DEMOTIME
  21. 21. Demo: 1. Show Razor facts without MK extension 2. Add MK extension 3. Show new facts getting in 4. Show tags that use the new facts 5. Show policies using the new tags
  22. 22. Questions?
  23. 23. Thank you! Jonas Rosland @virtualswede

×