Apidays New York 2024 - The value of a flexible API Management solution for O...
Server Locality Using Razor and LLDP - PuppetConf 2014
1. Server locality
with Razor and LLDP
Jonas Rosland
Developer Advocate @EMC
@virtualswede
purevirtual.eu
emccode.github.io
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. 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. 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)
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. 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. 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. 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
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. 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. 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. 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?
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