Wednesday, September 4, 2013

openstack cloud in the cloud

from: http://devstack.org/guides/single-vm.html works fine with ubuntu 12 lts on vmware esx 5.1
Running a Cloud in a VM
Use the cloud to build the cloud! Use your cloud to launch new versions of OpenStack in about 5 minutes. When you break it, start over! The VMs launched in the cloud will be slow as they are running in QEMU (emulation), but their primary use is testing OpenStack development and operation. Speed not required.

Prerequisites Cloud & Image
Virtual Machine
DevStack should run in any virtual machine running a supported Linux release. It will perform best with 2Gb or more of RAM.

OpenStack Deployment & cloud-init
If the cloud service has an image with cloud-init pre-installed, use it. You can get one from Ubuntu's Daily Build site if necessary. This will enable you to launch VMs with userdata that installs everything at boot time.

If you are directly using a hypervisor like Xen, kvm or VirtualBox you can manually kick off the script below in a bare-bones server installation.

Installation shake and bake
Launching with using Userdata
The userdata script grabs the latest version of DevStack via git, creates a minimal localrc file and kicks off stack.sh.

#!/bin/sh
apt-get update || yum update -y
apt-get install -qqy git || yum install -y git
git clone https://github.com/openstack-dev/devstack.git
cd devstack
echo ADMIN_PASSWORD=password > localrc
echo MYSQL_PASSWORD=password >> localrc
echo RABBIT_PASSWORD=password >> localrc
echo SERVICE_PASSWORD=password >> localrc
echo SERVICE_TOKEN=tokentoken >> localrc
./stack.sh
Launching By Hand
Using a hypervisor directly, launch the VM and either manually perform the steps in the script above or copy it into the VM.

Using OpenStack
At this point you should be able to access the dashboard. Launch VMs and if you give them floating IPs access those VMs from other machines on your network.

One interesting use case is for developers working on a VM on their laptop. Once stack.sh has completed once, all of the pre-requisite packages are installed in the VM and the source trees checked out. Setting OFFLINE=True in localrc enables stack.sh to run multiple times without an Internet connection. DevStack, making hacking at the lake possible since 2012!

No comments: