星期日, 11月 28, 2010

Run your own Ubuntu Enterprise Cloud, part 1


Important update: This howto was targeted at 9.10. The 10.04 release of UEC introduces plenty of simplification (autoregistration of components, uec-publish-tarball automatically registering cloud images…) that makes some of this guide obsolete. Please seehttps://help.ubuntu.com/community/UEC/ which is kept much more up to date. As an alternative, see http://testcases.qa.ubuntu.com/Install/ServerUECTopology1, which details the testcase we run to validate UEC internally.

Ubuntu Enterprise Cloud is the product, powered by Eucalyptus, that allows you to easily run your own Amazon-EC2-like private cloud. It’s a lot simpler than you’d think. With the recent Ubuntu Server 9.10 beta release, you are now able to easily deploy that infrastructure from the CD installer.

Prerequisites

To deploy a minimal cloud infrastructure, you’ll need at least two dedicated systems. One will hold the cloud controller (clc), the cluster controller (cc), walrus (the S3-like storage service) and the storage controller (sc). This one needs fast disks and a reasonably fast processor. The other system(s) are node controllers (nc) that will actually run the instances. These ones need CPUs with VT extensions, lots of CPU cores, lots of RAM, and fast disks. For both, 64-bit support is highly recommended.

Installing the cloud/cluster controller

Download the 9.10 Server beta ISO. When you boot, select “Ubuntu Enterprise Cloud install”. When asked whether you want a “Cluster” or a “Node” install, select “Cluster”. It will ask two other cloud-specific questions during the course of the install:

  1. Name of your cluster: pick any name you want :)
  2. List of IP addresses on the LAN that the cloud can allocate to instances: enter a list of space-separated unused IP addresses on your LAN.

When it reboots, run the following to get the latest eucalyptus package and reboot:

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo reboot

Installing node controllers

The node controller install is even simpler. Just make sure that you are connected to the network on which the cloud/cluster controller is already running. Take the same ISO, select “Ubuntu Enterprise Cloud install”. It should detect the Cluster and preselect “Node” install for you. That’s all.

It is also recommended to update to the latest 9.10 status:

$ sudo apt-get update
$ sudo apt-get upgrade

Connect your node controllers to the cloud

After all nodes are installed, you need to return to the cloud/controller and run the following command to make it “discover” your newly-installed nodes.

$ sudo euca_conf --no-rsync --discover-nodes 

Confirm all the nodes it finds, and you are done. To check that your private cloud infrastructure is ready to serve, you need to retrieve admin credentials and run euca-describe-availability-zones command. Run the following on your cloud/cluster controller:

$ sudo euca_conf --get-credentials mycreds.zip
$ unzip mycreds.zip
$ . eucarc
$ euca-describe-availability-zones verbose

This last command returns a description of the capabilities of your cloud cluster, how many instances of each type you could run on it, for example:

AVAILABILITYZONE   myowncloud                 192.168.1.1
AVAILABILITYZONE |- vm types free / max cpu ram disk
AVAILABILITYZONE |- m1.small 0004 / 0004 1 128 2
AVAILABILITYZONE |- c1.medium 0004 / 0004 1 256 5
AVAILABILITYZONE |- m1.large 0002 / 0002 2 512 10
AVAILABILITYZONE |- m1.xlarge 0002 / 0002 2 1024 20
AVAILABILITYZONE |- c1.xlarge 0001 / 0001 4 2048 20

In part 2 of this series, we’ll cover bundling your first EMI (Eucalyptus Machine Image), based on Ubuntu Server 9.10 Beta. We’ll test it by starting an instance of it. Stay tuned !

 

沒有留言: