|
Unsupported Version |
|
Candidate for Deletion |
Introduction
|
This is instruction of Ubuntu 11.10. For Ubuntu 12.04 LTS, please see UbuntuCloudInfrastructure.
Ubuntu Cloud Infrastructure, which is the successor of Ubuntu Enterprise Cloud, is a ready to deploy Infrastructure-as-a-Service (IaaS) based on OpenStack. It is making it's official entry into Ubuntu 11.10.
Installation
There are multiple ways to install Ubuntu Cloud Infrastructure.
- Ubuntu Cloud Live Image: a single node all in one cloud booting from USB
- Ubuntu Cloud Infrastructure with Orchestra and Juju: our recommended method
- Install Ubuntu Cloud Infrastructure from packages: the hard way
Ubuntu Cloud Live Image
Download the image from http://cdimage.ubuntu.com/ubuntu-cloud-live/releases/11.10/
Create a USB stick using USB Creator or some other tools as described here
- Boot from the created USB stick
Your Ubuntu Cloud Infrastructure is ready to be used. See the section Use your cloud for more details.
Ubuntu Cloud Infrastructure with Orchestra and Juju
This install is done in 3 steps:
- Install the Orchestra server
- Install Juju
- Deploy Ubuntu Cloud Infrastructure with Juju
Which are described below.
Requirements
- It should be assumed that the user deploying this setup has all nodes with two network interfaces linked to two seperate physical networks. Deploying with a single network is possible with some hacking and workarounds, see original document for that.
- It's also assumed the user has sufficient number of nodes available in Orchestra. The minimum deployment outlined below requires a minimum of 6 machines including the juju bootstrap node.
Installing the Orchestra server
Follow the usual steps to install Ubuntu Server
- Once done, install the package named "ubuntu-orchestra-server"
sudo apt-get update sudo apt-get install ubuntu-orchestra-server -y
- Answer some questions about your networking setup
Your basic Orchestra setup is now done. To learn more about Orchestra see Dustin Kirland's excellent blog post on the subject.
Install Juju
This can be done on the same server you have deployed Orchestra onto.
1. Installing juju
Starting Oneiric 11.10, juju is available in universe
sudo apt-get install juju
to install a daily build from PPA or to install from source code, check out the juju documentation
2. Configuring the environment
sudo mkdir -p ~/.juju sudo vim ~/.juju/environments.yaml
And we copy the following
juju: environments environments: orchestra: type: orchestra # Specify the orchestra server's IP address orchestra-server: 10.1.2.3 # Specify storage. In this case we are using webdav installed by orchestra. storage-url: http://10.1.2.3/webdav # Specify cobbler's usr/pass orchestra-user: cobbler orchestra-pass: cobbler admin-secret: fooooo # Branch from where we will install ensemble # juju-branch: lp:juju # Mangement classes acquired-mgmt-class: orchestra-juju-acquired available-mgmt-class: orchestra-juju-available
3. Creating SSH keys
Ensemble requires SSH keys to be able to access the deployed nodes. In case those keys do not exist, then we have to create them before we bootstrap our environment:
ssh-keygen -t rsa
4. Bootstrapping the environment
After the configuration done above, we bootstrapped the environment:
juju bootstrap
This process will select any of the machines available to orchestra to be the zookeeper node. In this example, the machine's name is mabolo
ubuntu@orchtrasrvr:~$ juju status 2011-09-08 18:02:22,148 INFO Connecting to environment. machines: 0: {dns-name: mabolo.lan, instance-id: MTMxNDMwNzI0OS40ODkyODE2MzAuODE5ODY}
NOTE: Note that after executing the command we had to manually start/restart the system to PXE boot it. This can be automated if cobbler is configured to power-on the servers
Deploying Ubuntu Cloud Infrastructure with Juju
1. Clone Charms
Create local branches of the following Juju charms in ~/charms
ubuntu@orchestrasrvr:~$ mkdir -p charms/oneiric ubuntu@orchestrasrvr:~$ cd charms/ ubuntu@orchestrasrvr:~/charms$ bzr branch lp:charm/rabbitmq-server oneiric/rabbitmq-server ubuntu@orchestrasrvr:~/charms$ bzr branch lp:charm/mysql oneiric/mysql ubuntu@orchestrasrvr:~/charms$ bzr branch lp:charm/nova-compute oneiric/nova-compute ubuntu@orchestrasrvr:~/charms$ bzr branch lp:charm/nova-cloud-controller oneiric/nova-cloud-controller ubuntu@orchestrasrvr:~/charms$ bzr branch lp:charm/glance oneiric/glance
2. Set Global Configuration
We'll need to set some global configuration for the installation. Create a file /home/ubuntu/charms/openstack.yaml:
nova-cloud-controller: nova-release: distro nova-config: /etc/nova/nova.conf db-user: nova nova-db: nova rabbit-user: nova rabbit-vhost: nova network-manager: FlatDHCPManager bridge-interface: br100 nova-compute: nova-release: distro nova-config: /etc/nova/nova.conf db-user: nova nova-db: nova rabbit-user: nova rabbit-vhost: nova flat-interface: eth1 virt-type: kvm glance: glance-release: distro registry-config: /etc/glance/glance-registry.conf api-config: /etc/glance/glance-api.conf db-user: glance nova-db: nova
Note: Most of these are defaults. The only option specific to our example deployment is 'flat-interface: eth1'. This will configure the virtual network on eth1. Later, nova will create a virtual network on these bridges for instances.
4. Deploy Services
After branching the necessary charms to /home/ubuntu/charms/ and setting our configuration at /home/ubuntu/charms/openstack.yaml, we can begin deploying the services.
MySQL and RabbitMQ
First, deploy the MySQL and RabbitMQ services.
ubuntu@orchestrasrvr:~$ export REPO=~/charms ubuntu@orchestrasrvr:~$ export CONFIG=~/charms/openstack.yaml ubuntu@orchestrasrvr:~$ juju deploy --repository=$REPO local:mysql ubuntu@orchestrasrvr:~$ juju deploy --repository=$REPO local:rabbitmq
Nova and Glance
Deploy nova-cloud-controller, nova-compute and glance to their own nodes:
ubuntu@orchestrasrvr:~$ juju deploy --repository=$REPO --config=$CONFIG local:nova-cloud-controller ubuntu@orchestrasrvr:~$ juju deploy --repository=$REPO --config=$CONFIG local:nova-compute ubuntu@orchestrasrvr:~$ juju deploy --repository=$REPO --config=$CONFIG local:glance
6. Add Relations
Now we can add the necessary relations between the services.
Give nova-cloud-controller, nova-compute and glance access to the database:
ubuntu@orchestrasrvr:~$ juju add-relation mysql nova-cloud-controller ubuntu@orchestrasrvr:~$ juju add-relation mysql nova-compute ubuntu@orchestrasrvr:~$ juju add-relation mysql glance
NOTE: The first of these 3 relations runs the initial database migration. It's a good idea to allow it time to complete entirely before adding the others.
Give the Nova components access to the messaging queue:
ubuntu@orchestrasrvr:~$ juju add-relation rabbitmq nova-compute ubuntu@orchestrasrvr:~$ juju add-relation rabbitmq nova-cloud-controller
Configure the compute node for the network manager specified in our config.
ubuntu@orchestrasrvr:~$ juju add-relation nova-cloud-controller:nova-network nova-compute:nova-network
Let both the cloud controller and the compute nodes know where to fetch virtual machine images:
ubuntu@orchestrasrvr:~$ juju add-relation glance:image-service nova-cloud-controller:image-service ubuntu@orchestrasrvr:~$ juju add-relation glance:image-service nova-compute:image-service
Your Ubuntu Cloud Infrastructure is ready to be used. See the section Use your cloud for more details.
Ubuntu Cloud Infrastructure from packages
This is a more complex process which is described in great details in the OpenStack Beginner’s Guide V2.0 for Ubuntu 11.10 written by CSS Corp.
Use Your Cloud
At this point, the Openstack cloud has been deployed and should be functioning. If you login to the nova-cloud-controller node (as reported by 'juju status'), you can create the first nova users, projects, networks and export credentials to be used with euca-tools or other API tools.
ubuntu@orchestrasrvr:~$ juju ssh 2 ubuntu@marula:~$ sudo nova-manage user admin admin ubuntu@marula:~$ sudo nova-manage project create novaproject admin ubuntu@marula:~$ sudo nova-manage network create \ --label=novanet \ --fixed_range_v4=10.0.0.0/24 \ --num_networks=1 \ --network_size=255 \ --bridge=br100 \ --bridge_interface=eth1 \ --multi_host=T \ --project_id=novaproject ubuntu@marula:~$ sudo nova-manage project zipfile novaproject admin
Now we can unzip our credentials and begin using the cloud.
ubuntu@marula:~$ unzip nova.zip ubuntu@marula:~$ . novarc ubuntu@marula:~$ wget http://uec-images.ubuntu.com/server/server/releases/oneiric/beta-1/ubuntu-11.10-beta1-server-cloudimg-amd64.tar.gz ubuntu@marula:~$ uec-publish-tarball ./ubuntu-11.10-beta1-server-cloudimg-amd64.tar.gz images ubuntu@marula:~$ euca-add-keypair adam >adam.pk ubuntu@marula:~$ euca-run-instances -k adam ami-00000002
We still have 1 extra machine. We can easily be added as a compute node through Juju to increase our resources:
ubuntu@orchestrasrvr:~$ juju add-unit nova-compute