My personal views, thoughts and opinions.

Saturday, November 26, 2011

Running Virgo on Cloud Foundry

In this post I provided a VM with Virgo and Cloud Foundry. Now I'll explains how to set up such VM on your own and to use updated (2011-11-27) Cloud Foundry version forked in GitHub.

Installation steps:

1. Download VirtualBox and install it.
2. Download VirtualBox's Extension Pack and install this as well. 

You may double click on the Extension Pack for Windows. Also note that the extensions are not needed if you want to setup Ubuntu on your own.

3. Download Ubuntu image and write down the user/password. 

I've tested with Ubuntu 11.04. Ubuntu Server is the best choice for productive systems, and in case you like developing with VI. 

Note that the recommended version is Ubuntu Server 10.04-2 LTS.

4. Start the image 

Some of the archives contain only HDD image, so you may need to configure the VM and attach the downloaded HDD image.

Other images come preconfigured. For those you may need to change the network adapter settings in VirtualBox.  Simply clicking on Network section and saving the auto-detected changes did the trick for me.

In general ensure the VM has at least 2GB memory. If you want to try every Cloud Foundry service and framework (or simply run the tests) you will need at least 3GB of memory.

The image may have keyboard layout you are not used to (Italy as was in my case), so it's a good idea to change this. For the Server (no GUI) you can do this with:
   sudo dpkg-reconfigure console-setup

Installing Guest Additions is definitely a good idea since it allows you to copy/paste install commands in the next steps, and what's more important allows hardware and host OS acceleration.

5. Install libtool using:
    sudo apt-get install libtool

6. Install CloudFoundry on the image as explained in this GitHub vcap repository fork

You may need to reboot the VM to allow RVM (Ruby Version Manager) to pick up the configuration in vcap folder and switch Ruby versions. Sourcing the configurations did not work for me.

7. Update Cloud Foundry with the Virgo modifications

The Cloud Controller uses vcap_staging gem that does not support Virgo, so we have to update the gem with the Virgo specific code. To do this execute: 
   cd ~/cloudfoundry/vcap
   cp -r staging/lib/* ~/.rvm/gems/ruby-1.9.2-p180/gems/vcap_staging-0.1.25/lib/

Finally restart the Cloud Foundry:
   bin/vcap restart 

To be able to use the automatic discovery of Virgo applications in VMC we need to update the client:
   cd ~/cloudfoundry/
   git clone
   cp vmc/lib/cli/frameworks.rb ~/.rvm/gems/ruby-1.9.2-p180/gems/vmc-0.3.13/lib/cli

How to install Virgo's Admin Console

1. Download and extract the archived console
2. In the directory where you extracted the archive, run:
   vmc push virgo
3. Request and you should see the Splash Screen with link to the Admin Console in the upper right corner.

How to update to the latest Virgo version:
2. Go to vcap-java/virgo-setup
3. Edit virgo_manifest.yml to specify the exact version you want
4. Run rake virgo:prepare
5. Find the new version in 
   /tmp/virgo-<your version>/
6. Replace the ZIP in  

The last two steps should be automated with the virgo:install task, but I haven't tested if this works.
    Post a Comment

    Google+ Followers