Running Crowbar under VMWare Fusion

From DTO Labs Knowledge Base
Jump to: navigation, search

Contents

Prep Work

First, build a crowbar install ISO. Even through we're targeting CloudFoundry, for this tutorial, I recommend building from the Main branch.

Note: the docs for building crowbar aren't up-to-date (as of 9/20/2011). The official barclamps have now been broken out into separate repositories. Before you run build_crowbar.sh, you need to do a 'git submodule init; git submodule update'.

Next, set up VMWare Fusion. VMWare Workstation allows you to do all this through the gui. Fusion is more "user-friendly," which means it hides all its powerful configurations in textfiles. Here's the skinny:

Step 1: Relax the network restrictions on promiscuous network interfaces so Crowbar can be a DHCP server: Back up the config file. You may want to restore it later - this does (slightly) open up a security hole.

sudo cp /etc/authorization /etc/authorization.orig

Now, edit the file. You're looking for this section:

<key>system.privilege.admin</key>
        <dict>
               <key>allow-root</key>
               <true/>
               <key>class</key>
               <string>user</string>
               <key>comment</key>
               <string>Used by AuthorizationExecuteWithPrivileges(...).
               AuthorizationExecuteWithPrivileges() is used by programs requesting
               to run a tool as root (e.g., some installers).</string>
               <key>group</key>
               <string>admin</string>
                         <key>shared</key>
                         <false/>
                         <key>timeout</key>
                         <integer>300</integer>

And change it to:

<key>system.privilege.admin</key>
        <dict>
               <key>allow-root</key>
               <true/>
               <key>class</key>
               <string>allow</string>
               <key>comment</key>
               <string>Used by AuthorizationExecuteWithPrivileges(...).
               AuthorizationExecuteWithPrivileges() is used by programs requesting
               to run a tool as root (e.g., some installers).</string>
               <key>group</key>
               <string>admin</string>
                         <key>shared</key>
                         <false/>
                         <key>timeout</key>
                         <integer>300</integer>

Note: the only thing we're changing is "user" to "allow" in the string tag under the class key. Details on this step are available: http://communities.vmware.com/thread/140960 http://www.jedi.be/blog/2010/12/09/automated-vmware-esx-installation-even-in-vmware-fusion/#admin_privilege

Next, let's configure your vmnet8 internal network for the subnet Crowbar wants by default: First, more backups:

sudo cp "/Library/Application Support/VMware Fusion/networking" "/Library/Application Support/VMware Fusion/networking.orig"

Note: in VMWare Fusion 4.0.x, the location has changed to "/Library/Preferences/VMware Fusion/", so execute this:

sudo cp "/Library/Preferences/VMware Fusion/networking" "/Library/Preferences/VMware Fusion/networking.orig"


Now, edit that file (/Library/Application Support/VMware Fusion) and make it look EXACTLY like this:

VERSION=1,0
answer VNET_1_DHCP no
answer VNET_1_DHCP_CFG_HASH 4AF2FA4242F092401A3262077B10B01835BCB7D1
answer VNET_1_HOSTONLY_NETMASK 255.255.255.0
answer VNET_1_HOSTONLY_SUBNET 192.168.208.0
answer VNET_1_VIRTUAL_ADAPTER yes
answer VNET_8_DHCP no
answer VNET_8_DHCP_CFG_HASH E699649DBE2A075E9319C1BE406F8E1D7431294B
answer VNET_8_HOSTONLY_NETMASK 255.255.255.0
answer VNET_8_HOSTONLY_SUBNET 192.168.124.0
answer VNET_8_NAT yes
answer VNET_8_VIRTUAL_ADAPTER yes

You will need root privileges, so use sudo vi or give your text editor your admin password when you save it.

Once that's done, restart your networking:

sudo /Library/Application\ Support/VMware\ Fusion/boot.sh --restart

For VMWare Fusion 4.0.x, there is no boot.sh. You may have to shutdown and restart your VMWare.


You're ready to install Crowbar!

Installation

Make your VM first.

  1. Create a vm in Fusion. Then perform the following steps:
  2. "Continue without disk"
  3. "Use Operating System disk image file"
  4. "Linux/Ubuntu 64-bit"
  5. Uncheck Use Easy Install (VERY IMPORTANT!)
  6. Customize settings
  7. Change RAM to 1GB
  8. Network: Nic 1 - Check "Share this Mac's network connection (NAT)"
  9. Add a second NIC and set it like this: "Create a private network available only to the Mac"

Start your vm.

Once the vm is up, log in as openstack/openstack crowbar/crowbar and perform the following steps:

  1. edit /opt/dell/barclamps/network/chef/data_bags/crowbar/bc-template-network.json
    1. Set the admin network's router to 192.168.124.2 (It was 192.168.124.1 - search for it)
  2. Then, do this:
sudo -s
cd /tftpboot/ubuntu_dvd/extra
./install admin.openstack.org

Launching your first VM

Before you start the VM, log into Crowbar. It's default config is to have two networks set up, one for IPMI, which our virtual machines don't have.

  1. Go to Proposals and click on the 'Default' next to IPMI
  2. Set the "Enable BMC" to "False"
  3. Remove all nodes ipmi-configure box under Deployment
  4. Save the proposal
  5. Apply the proposal


Make a new VM in VMWare Fusion. Use the following selections:

  1. Continue without disc
  2. Create a Custom Virtual Machine
  3. Linux/Ubuntu 64-bit
  4. Customize Settings
  5. Now, go in and set up the networking same as the server:
    1. Nic 1: NAT
    2. Nic 2: Host-Only

Once that's done, launch the vm. Log into your crowbar server at http://192.168.124.10:3000/ using crowbar/crowbar as the password.

The new VM should PXE boot from crowbar and settle into a discovery state. At this point, you can apply barclamps to it.

Problems

If you run into the situation where your client VM (or server) doesn't roll over into Ubuntu after applying a proposal, you'll need to troubleshoot.

First, try this:

  1. Click reinstall, and let that request resolve. One of two things will happen:

If this step doesn't work, then you'll need to dive deeper. Log into the crowbar server and perform the following:

sudo -s
cd /tftpboot/ubuntu_dvd/dell/
./blocking_chef_client.sh

If that last script runs cleanly, then things should run. If it doesn't, check the output. You'll see some Ruby stacktraces. Inside that mess you'll get a clue into which cookbooks are giving you trouble.

If you get a vm hanging stable in the config loop, then you can proceed onward to Deploying the cloudfoundry barclamp

Setting up your Crowbar server for development

References

VMWare Fusion:

Crowbar:

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
Print/export