Deploying the cloudfoundry barclamp

From DTO Labs Knowledge Base
Jump to: navigation, search

Contents

Pre-work warning

This page assumes you've got a working crowbar server. If you haven't yet, please refer to our instructions at http://kb.dtosolutions.com/wiki/Running_Crowbar_under_VMWare_Fusion

Package repo workaround

Crowbar needs all of the .deb packages you're working with on your crowbar server before you get the barclamp working. Normally, this is done when you build your crowbar iso image, but since we're still in testing, you need a way to get the packages on your server.

This is a horribly hacky workaround, but it does the job:

On your running barclamp server, edit /etc/apt/sources.list and uncomment the following lines:

deb http://us.archive.ubuntu.com/ubuntu/ maverick main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ maverick main restricted

deb http://us.archive.ubuntu.com/ubuntu/ maverick-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ maverick-updates main restricted

deb http://us.archive.ubuntu.com/ubuntu/ maverick universe
deb-src http://us.archive.ubuntu.com/ubuntu/ maverick universe
deb http://us.archive.ubuntu.com/ubuntu/ maverick-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ maverick-updates universe

deb http://archive.canonical.com/ubuntu maverick partner
deb-src http://archive.canonical.com/ubuntu maverick partner

Then, run the following commands:

sudo apt-get update
sudo apt-get -y install apt-utils wget curl libcurl3 bison build-essential zlib1g-dev libssl-dev libreadline5-dev libxml2 libxml2-dev libxslt1.1 libxslt1-dev git-core sqlite3 libsqlite3-ruby libsqlite3-dev unzip zip ruby-dev libmysql-ruby libmysqlclient-dev libcurl4-openssl-dev libpq-dev python-software-properties mysql-client mysql-server build-essential libssl-dev zlib1g-dev libreadline5-dev libxml2-dev libpq-dev postgresql erlang-nox libreadline5-dev
sudo cp /var/cache/apt/archives/*.deb /tftpboot/ubuntu_dvd/extra/pkgs/

The internal chef run seems to work without the required gems, so this should work. (It has for me, so far)

Check out the crowbar repo from Github

On the machine hosting your crowbar virtual instance (or any machine that can ssh into your crowbar server, really), make a working directory to stay neat & tidy. Then, execute the following:

cd working_directory
git clone http://github.com/dellcloudedge/crowbar.git
cd crowbar
git checkout cf
cd change-image/dell/barclamps
scp -r cloudfoundry/ openstack@192.168.124.10:~/

Now, you've got the barclamp on the server. The next step is to log into the server and install it into crowbar:

What we're doing here is removing the old cloudfoundry stub (note: if you built your crowbar install iso from the Main branch instead of the CF branch of the github project, you may not have an existing stub to delete) and installing the complete (as far as I've tested it) in place.

ssh openstack@192.168.124.10
sudo -s
cd /tftpboot/ubuntu_dvd/dell/barclamps
rm -rf cloudfoundry
cp -R /home/openstack/cloudfoundry .
cd ..
./install_barclamp.sh barclamps/cloudfoundry

Let it run for a bit. When the installer completes, you'll see the barclamp in the crowbarweb ui at http://192.168.124.10:3000

So, let's apply this sucker.

  1. Go to the web ui, and click on Barclamps.
  2. Click on Cloudfoundry, and look at the proposal... if you've followed along, you only have one available node. Adjust and give your proposal a name.
  3. Save the proposal
  4. apply the proposal.

If you're lucky, you'll get a cloudfoundry box. (Assuming the recipes run completely. Your cloudfoundry VM should have a lot of ram)

If you're not, you'll get a constantly rebooting vm. See the Problems section on our Crowbar installation tutorial.

Making your own Barclamp

Making your own barclamp

Test a sample application

 vmc target api.vcap.me
 vmc register --email foo@bar.com --passwd password
 mkdir env && cd env

Create a env.rb files in the new "env" directory

 
 require 'rubygems'
  require 'sinatra'

  get '/' do
    host = ENV['VMC_APP_HOST']
    port = ENV['VMC_APP_PORT']
    "<h1>XXXXX Hello from the Cloud! via: #{host}:#{port}</h1>"
  end

  get '/env' do
    res = ''
    ENV.each do |k, v|
      res << "#{k}: #{v}<br/>"
    end
    res
  end
 vmc push env --instances 4 --mem 64M --url env.vcap.me -n
 curl http://env.vcap.me
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
Print/export