Diff for "UEC"


Differences between revisions 44 and 45
Revision 44 as of 2009-10-20 21:13:46
Size: 3668
Editor: cpe-66-69-232-158
Comment:
Revision 45 as of 2009-10-20 21:18:44
Size: 3603
Editor: cpe-66-69-232-158
Comment: use includes, instead of links
Deletions are marked like this. Additions are marked like this.
Line 29: Line 29:
Refer to the [[UEC/SystemRequirements|System Requirements]] tables for the detailed hardware requirements of these physical systems. <<Include(UEC/SystemRequirements)>>
Line 54: Line 54:
 * [[UEC/RegisteringNodes]]
<<Include(
UEC/RegisteringNodes)>>
Line 57: Line 58:
Retrieve your UEC credentials:
 * [[UEC/Credentials]]
Retrieve your UEC credentials.

<<Include(
UEC/Credentials)>>
Line 61: Line 63:
Next, register a new image with your Cloud Controller:
 * [[UEC/BundlingImages]]
Next, register a new image with your Cloud Controller.

<<Include(
UEC/BundlingImages)>>
Line 65: Line 68:
Finally, run an image in a virtual machine in your Cloud:
 * [[UEC/RunningImages]]
Finally, run an image in a virtual machine in your Cloud.

<<Include(
UEC/RunningImages)>>

Note: Please see Eucalyptus-Jaunty for documentation covering UEC on Ubuntu 9.04.

Getting Started with Ubuntu Enterprise Cloud

Overview

The Ubuntu Enterprise Cloud (UEC), powered by Eucalyptus, is highly configurable and customizable to a variety of environments. This tutorial covers UEC installation from the Ubuntu 9.10 Server Edition CD, and assumes a basic network topology, with a single system serving as the "all-in-one controller", and one or more nodes attached.

Another tutorial exists describing how to deploy UEC on already installed Ubuntu servers, or if you want to deploy a more complex network topology, with multiple clusters, or running the required cloud services from separate physical machines.

Terminology

You should be familiar with the Glossary. These terms are used throughout the documentation.

Objective

From this Tutorial you will learn how to install, configure, register and perform several operations on a basic UEC setup that results in a cloud with a one controller "front-end" and one or several node(s) for running Virtual Machine (VM) instances. You will also use examples to help get you started using your own private compute cloud.

Tutorial

STEP 1: Prerequisites

To deploy a minimal cloud infrastructure, you’ll need at least two dedicated systems:

  • a front end
  • one or more node(s)

The following are recommendations, rather than fixed requirements. However, our experience in developing this documentation indicated the following suggestions.

Front End

Use the following table for a system that will run one or more of:

  • the cloud controller (clc)
  • the cluster controller (cc)
  • walrus (the S3-like storage service)
  • the storage controller (sc)

Hardware

Minimum

Suggested

Notes

CPU

1GHz

2 x 2GHz

for an all-in-one front end, it helps to have at least a dual core processor

Memory

2GB

4GB

the Java web front end benefits from lots of available memory

Disk

5400rpm IDE

7200rpm SATA

slower disks will work, but will yield much longer instance startup times

Disk Space

40GB

200GB

40GB is only enough space for only a single image, cache, etc., Eucalyptus does not like to run out of disk space

Networking

100Mbps

1000Mbps

machine images are hundreds of MB, and need to be copied over the network to nodes

Node(s)

The other system(s) are nodes, which will run:

  • the node controller (nc)

These systems will actually run the instances. You will need one or more systems with:

Hardware

Minimum

Suggested

Notes

CPU

VT extensions

VT, 64-bit, Multicore

64-bit can run both i386, and amd64 instances; by default, Eucalyptus will only run 1 VM per CPU core on a Node

Memory

1GB

4GB

additional memory means more, and larger guests

Disk

5400rpm IDE

7200rpm SATA or SCSI

Eucalyptus nodes are disk-intensive; I/O wait will likely be the performance bottleneck

Disk Space

40GB

100GB

images will be cached locally, Eucalyptus does not like to run out of disk space

Networking

100Mbps

1000Mbps

machine images are hundreds of MB, and need to be copied over the network to nodes

STEP 2: Install the Cloud/Cluster controller

  1. Download the 9.10 Server ISO
  2. When you boot, select “Install Ubuntu Enterprise Cloud”.
    private1-cr.png

  3. When asked whether you want a “Cluster” or a “Node” install, select “Cluster”.
    cluster-node-cr.png

  4. It will ask two other cloud-specific questions during the course of the install:
    1. Name of your cluster
      • e.g. cluster1

    2. A range of public IP addresses on the LAN that the cloud can allocate to instances
      • e.g. 192.168.1.200-192.168.1.249

STEP 3: Install the Node controller(s)

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.

  1. Boot from the same ISO on the node(s)
  2. Select “Install Ubuntu Enterprise Cloud”
  3. It should detect the Cluster and preselect “Node” install for you
  4. Confirm the partitioning scheme
  5. The rest of the installation should proceed uninterrupted; complete the installation and reboot the node

STEP 4: Register the Node with the Cloud Controller

Register each node with the Cloud Controller:

As of Ubuntu 10.04 LTS, all component registration should be automatic, assuming:

  1. Public SSH keys have been exchanged properly
  2. The services are configured properly
  3. The services are publishing their existence
  4. The appropriate uec-component-listener is running
  5. Verify Registration.

Steps a to e should only be required if you're using the UEC/PackageInstall method. Otherwise, if you are following the UEC/CDInstall method, these steps should already be completed automatically for you, and therefore you can skip a to e.

a.

Exchange Public SSH Keys

The Cloud Controller's eucalyptus user needs to have SSH access to the Walrus Controller, Cluster Controller, and Storage Controller as the eucalyptus user.

Install the Cloud Controller's eucalyptus user's public ssh key by:

  • On the target controller, temporarily set a password for the eucalyptus user:

    sudo passwd eucalyptus
  • Then, on the Cloud Controller:
    sudo -u eucalyptus ssh-copy-id -i /var/lib/eucalyptus/.ssh/id_rsa.pub eucalyptus@<IP_OF_NODE>
  • You can now remove the password of the eucalyptus account on the target controller, if you wish:

  • sudo passwd -d eucalyptus

b.

Configure the Services

On the Cloud Controller:

  • For the Cluster Controller Registration:

    • Define the shell variable CC_NAME in /etc/eucalyptus/eucalyptus-cc.conf

    • Define the shell variable CC_IP_ADDR in /etc/eucalyptus/eucalyptus-ipaddr.conf, as a space separated list of one or more IP addresses.

  • For the Walrus Controller Registration:

    • Define the shell variable WALRUS_IP_ADDR in /etc/eucalyptus/eucalyptus-ipaddr.conf, as a single IP address.

On the Cluster Controller:

  • For Storage Controller Registration:

    • Define the cluster name in the shell variable CC_NAME in /etc/eucalyptus/eucalyptus-cc.conf

    • Define the shell variable SC_IP_ADDR in /etc/eucalyptus/eucalyptus-ipaddr.conf, as a space separated list of one or more IP addresses.

c.

Publish

Now start the publication services.

  • Walrus Controller:

    sudo start eucalyptus-walrus-publication
  • Cluster Controller:

    sudo start eucalyptus-cc-publication
  • Storage Controller:

    sudo start eucalyptus-sc-publication
  • Node Controller

    sudo start eucalyptus-nc-publication

d.

Start the Listener

On the Cloud Controller and the Cluster Controller(s), run:

sudo start uec-component-listener

e.

Verify Registration

cat /var/log/eucalyptus/registration.log
2010-04-08 15:46:36-05:00 | 24243 -> Calling node cluster1 node 10.1.1.75
2010-04-08 15:46:36-05:00 | 24243 -> euca_conf --register-nodes returned 0
2010-04-08 15:48:47-05:00 | 25858 -> Calling walrus Walrus 10.1.1.71
2010-04-08 15:48:51-05:00 | 25858 -> euca_conf --register-walrus returned 0
2010-04-08 15:49:04-05:00 | 26237 -> Calling cluster cluster1 10.1.1.71
2010-04-08 15:49:08-05:00 | 26237 -> euca_conf --register-cluster returned 0
2010-04-08 15:49:17-05:00 | 26644 -> Calling storage cluster1 storage 10.1.1.71
2010-04-08 15:49:18-05:00 | 26644 -> euca_conf --register-sc returned 0

STEP 5: Credentials setup

Retrieve your UEC credentials.

After installing and booting the Cloud Controller, users of the cloud will need to retrieve their credentials. This can be done either through a web browser, or at the command line.

From a Web Browser

  1. From your web browser (either remotely or on your Ubuntu server) access the following URL:
    https://<cloud-controller-ip-address>:8443/

    Important! You must use a secure connection, so make sure you use "https" not "http" in your URL. You will get a security certificate warning. You will have to add an exception to view the page. If you do not accept it you will not be able to view the Eucalyptus configuration page.

  2. Use username 'admin' and password 'admin' for the first time login (you will be prompted to change your password).
  3. Then follow the on-screen instructions to update the admin password and email address.
  4. Once the first time configuration process is completed, click the 'credentials' tab located in the top-left portion of the screen.

  5. Click the 'Download Credentials' button to get your certificates
  6. Save them to ~/.euca

  7. Unzip the downloaded zipfile into a safe location (~/.euca)
    unzip -d ~/.euca mycreds.zip

From a Command Line

  1. Alternatively, if you are on the command line of the Cloud Controller, you can run:
    mkdir -p ~/.euca
    chmod 700 ~/.euca
    cd ~/.euca
    sudo euca_conf --get-credentials mycreds.zip
    unzip mycreds.zip
    ln -s ~/.euca/eucarc ~/.eucarc
    cd -

Extracting and Using Your Credentials

Now you will need to setup EC2 API and AMI tools on your server using X.509 certificates.

  1. Install the required cloud user tools:
    sudo apt-get install euca2ools
  2. To validate that everything is working correctly, get the local cluster availability details:
    . ~/.euca/eucarc
    euca-describe-availability-zones verbose
    AVAILABILITYZONE   myowncloud                 192.168.1.1
    AVAILABILITYZONE   |- vm types                free / max   cpu   ram  disk
    AVAILABILITYZONE   |- m1.small                0004 / 0004   1    192     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

STEP 6: Bundle a UEC Image

Next, register a new image with your Cloud Controller.

Using UEC consists of creating and registering images with the Cloud Controller.

This page describes the process for Ubuntu 10.04 LTS.

There is more than one way to obtain a virtual image:

  • Download an image from the network, bundle and upload it
  • Create a custom image using VMBuilder
  • Use the Image store to download and install and image

Here we will describe the process of downloading one of the daily builds that are built and published automatically. The process is similar for Official Released Images

Note: the shell variables that are set in the below code snippets are very useful for scripts or to reuse them when typing commands.

  1. Download the UEC image for the architecture you want. You can do it from your browser or from the command line:
    TIMESTAMP=$(date +%Y%m%d%H%M%S)
    RELEASE=lucid
    ARCH=amd64    # Or this might be i386
    [ $ARCH = "amd64" ] && IARCH=x86_64 || IARCH=i386
    UEC_IMG=$RELEASE-server-uec-$ARCH
    URL=http://uec-images.ubuntu.com/$RELEASE/current/
    [ ! -e $UEC_IMG.tar.gz ] &&  wget $URL/$UEC_IMG.tar.gz
    uec-publish-tarball $UEC_IMG.tar.gz $RELEASE-$TIMESTAMP
  2. Now, your kernel and image will have been uploaded into Eucalyptus and should be ready to run. To confirm, run the following command:
    euca-describe-images
    EMI=$(euca-describe-images | grep emi- | head -n1 | awk '{print $2}')
    You should see a registered kernel and image and they should be marked as 'available'.

STEP 7: Running an Image

Finally, run an image in a virtual machine in your Cloud.

There are multiple ways to instantiate an image in UEC:

  • Use the command line
  • Use one of the UEC compatible management tools such as Landscape
  • Use the ElasticFox extension to Firefox

Here we will describe the process from the command line:

  1. Before running an instance of your image, you should first create a keypair (ssh key) that you can use to log into your instance as root, once it boots. The key is stored, so you will only have to do this once. Run the following command:
    if [ ! -e ~/.euca/mykey.priv ]; then
        mkdir -p -m 700 ~/.euca
        touch ~/.euca/mykey.priv
        chmod 0600 ~/.euca/mykey.priv
        euca-add-keypair mykey > ~/.euca/mykey.priv
    fi

    Note: You can call your key whatever you like (in this example, the key is called 'mykey'), but remember what it is called. If you forget, you can always run euca-describe-keypairs to get a list of created keys stored in the system.

  2. You must make sure to source ~/.euca/eucarc before you run any of the eucatools. It is probably best to add this to the bottom of your .bashrc script.
  3. You must also allow access to port 22 in your instances:
    euca-authorize default -P tcp -p 22 -s 0.0.0.0/0
  4. Next, you can create instances of your registered image:
    euca-run-instances $EMI -k mykey -t m1.small

    Note: If you receive an error regarding image_id, you may find it by viewing Images page or click "How to Run" on the Store page to see the sample command.

  5. The first time you run an instance, the system will be setting up caches for the image from which it will be created. This can often take some time the first time an instance is run given that VM images are usually quite large. To monitor the state of your instance, run:
    watch -n5 euca-describe-instances
    In the output, you should see information about the instance, including its state. While first-time caching is being performed, the instance's state will be 'pending'.
  6. When the instance is fully started, the above state will become 'running'. Look at the IP address assigned to your instance in the output, then connect to it:
    IPADDR=$(euca-describe-instances | grep $EMI | grep running | tail -n1 | awk '{print $4}')
    ssh -i ~/.euca/mykey.priv ubuntu@$IPADDR
  7. And when you are done with this instance, exit your SSH connection, then terminate your instance:
    INSTANCEID=$(euca-describe-instances | grep $EMI | grep running | tail -n1 | awk '{print $2}')
    euca-terminate-instances $INSTANCEID

More Information

  • Log files: /var/log/eucalyptus

  • Configuration files: /etc/eucalyptus

  • Database: /var/lib/eucalyptus/db

  • Environment note: Don't forget to source your ~/.euca/eucarc before running the client tools.

UEC (last edited 2011-11-15 07:07:50 by mx)