Running Crowbar under VMWare Fusion
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.
- Create a vm in Fusion. Then perform the following steps:
- "Continue without disk"
- "Use Operating System disk image file"
- "Linux/Ubuntu 64-bit"
- Uncheck Use Easy Install (VERY IMPORTANT!)
- Customize settings
- Change RAM to 1GB
- Network: Nic 1 - Check "Share this Mac's network connection (NAT)"
- 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:
- edit /opt/dell/barclamps/network/chef/data_bags/crowbar/bc-template-network.json
- Set the admin network's router to 192.168.124.2 (It was 192.168.124.1 - search for it)
- Then, do this:
sudo -s cd /tftpboot/ubuntu_dvd/extra ./install admin.openstack.org
- Note: admin.openstack.org is the hostname of the crowbar server you're building... go ahead and change that to whatever you like.
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.
- Go to Proposals and click on the 'Default' next to IPMI
- Set the "Enable BMC" to "False"
- Remove all nodes ipmi-configure box under Deployment
- Save the proposal
- Apply the proposal
Make a new VM in VMWare Fusion. Use the following selections:
- Continue without disc
- Create a Custom Virtual Machine
- Linux/Ubuntu 64-bit
- Customize Settings
- Now, go in and set up the networking same as the server:
- Nic 1: NAT
- 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:
- Go to the dashboard, and click on your problem node
- Click reinstall, and let that request resolve. One of two things will happen:
- The box gets the signal on its next cycle of the discovery loop, and reboots and starts the discovery process over again
- Nothing happens. If so, reboot the client node.
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:
- http://nefariousdesigns.co.uk/archive/2010/03/controlling-dhcp-for-vmware-fusion-vms/
- http://edvoncken.net/2011/01/how-to-disable-the-dhcp-server-on-vmware-fusion-3/
- http://communities.vmware.com/thread/328439?tstart=0 (How to disable dhcp server on vmware fusion 4)
Crowbar:
- https://github.com/dellcloudedge/crowbar/wiki - build instructions are here. before you run the build, cd into the clone and do a git checkout cf
- https://github.com/dellcloudedge/crowbar/wiki/Release-notes
- https://github.com/dellcloudedge/crowbar/blob/master/change-image/dell/openstack_manager/public/deployment_guide.pdf - worth a read