Making your own barclamp
Contents |
How to make your own Barclamp for Crowbar
There will be some automated tools coming up shortly for some of these steps, but in the short term, here's what to do:
Start with a working, new build of Crowbar and get that running
Easiest way is to pull Rob Hirschfeld's build and run it in a VM. You can find his builds at: [1]
If you don't know how to run crowbar, look at our tutorial at: Running Crowbar under VMWare Fusion
Alternatively, you can build crowbar from scratch to get the latest build. Look at the instructions at the official Crowbar wiki on Github for that: [2]
Make your barclamp directory structure
I'm assuming you have a recent build of crowbar.
On your running crowbar server, run these commands:
sudo -s mkdir /barclamps chown crowbar.crowbar /barclamps /opt/dell/bin/barclamp_create.rb newbarclampname “My Name” /barclamps
Now, the skeleton's there. You're ready to start writing your chef recipes.
Barclamp functionality is 80% chef work. The rest is wrapping the chef cookbook(s) in the barclamp descriptions and code so that Crowbar knows what to do with it.
I'd consider doing a git init on your barclamp project at this point.
General Resources and Links
Chef:
- http://wiki.opscode.com/display/chef/Home -- General Chef documentation and information
"'Crowbar:'"
- http://robhirschfeld.com/ -- Rob is a member of the core crowbar team. His blog has a lot of good documentation on how to get started.
- https://github.com/dellcloudedge/crowbar/wiki/ -- Main wiki on github for the crowbar project
ROUGH NOTES
This is my work area for serializing the steps involved. Feel free to use this information. I'll polish it as we go:
- Each cookbook *MUST* be self contained: every node attribute you refer to in your cookbook should be represented with at least a default attribute in the local cookbook's attributes file
- Have multiple roles if you need them, but the mappings for those roles lives in ~/databags/crowbar/bc-template-your-barclamp-name.json in element-order, see below:
{
"id": "bc-template-==BC-MODEL==",
"description": "Cloud Foundry service (OpenPaaS) for the cloud",
"attributes": {
"==BC-MODEL==": {
"foo": "bar"
}
},
"deployment": {
"==BC-MODEL==": {
"crowbar-revision": 0,
"elements": {},
"element_order": [
[ "your_role_here", "other_role_here" ]
],
"config": {
"environment": "==BC-MODEL==-base-config",
"mode": "full",
"transitions": false,
"transition_list": [
]
}
}
}
}
Hint: when working on gui components, flip your crowbar app into development mode:
sudo -s cd /opt/dell/crowbar_framework ps auxw | grep rainbows kill first_pid /var/lib/gems/1.8/bin/rainbows -D -E development -c rainbows.cfg