Size: 19954
Comment:
|
Size: 3603
Comment: use includes, instead of links
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
## page was copied from UEC | |
Line 3: | Line 4: |
'''Note:''' Please see [[Eucalyptus-Jaunty]] for documentation covering UEC on Ubuntu 9.04. | |
Line 4: | Line 6: |
= Getting Started with Ubuntu Enterprise Cloud powered by Eucalyptus = '''Note:''' Please see [[Eucalyptus-Jaunty]] for documentation covering Eucalyptus on Ubuntu 9.04. |
= Getting Started with Ubuntu Enterprise Cloud = |
Line 10: | Line 10: |
The Eucalyptus Cloud Computing system is highly configurable, allowing it to be customized to fit a wide variety of environments. This installation tutorial covers setting up a Eucalyptus private cloud. |
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. [[UEC/PackageInstall|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 [[UEC/Glossary|Glossary]]. These terms are used throughout the documentation. |
Line 16: | Line 20: |
From this Tutorial you will learn how to install, configure, register and perform several operations on a basic Eucalyptus setup that results in a cloud with a one controller "front-end" and one node for running Virtual Machine (VM) instances (steps 1, 2, and 3). You will also use examples to help get you started using your own private compute cloud and, optionally, how to register your private cloud with the RightScale Cloud Management Platform (steps 4, 5, and 6). 1. Prerequisites 2. Installation and Configuration 3. Registering Eucalyptus components 4. Initial Login and optional Cloud Registration 5. Creating a Virtual Machine (VM) image 6. Running your image |
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. |
Line 34: | Line 25: |
A Eucalyptus system includes the following high level packages: | To deploy a minimal cloud infrastructure, you’ll need at least two dedicated systems: * a front end * one or more node(s) |
Line 36: | Line 29: |
1. eucalyptus-cc - includes the Cluster Controller that provides support for the virtual network overlay 2. eucalyptus-cloud - includes the front-end services (Cloud Controller) as well as the Walrus storage system. 3. eucalyptus-nc - includes the Node Controller that interacts with [[KVM]] to manage individual VMs |
<<Include(UEC/SystemRequirements)>> |
Line 40: | Line 31: |
In a basic Eucalyptus setup, the system is composed of two machines (a front-end and a node). The front end runs both `eucalyptus-cloud` and `eucalyptus-cc` in this configuration. The node runs the node controller, `eucalyptus-nc`. It is possible to separate the clound controller and cluster controller in a more complex multi-host setup. The following diagram depicts a simple setup: |
=== STEP 2: Install the Cloud/Cluster controller === |
Line 43: | Line 33: |
{{http://pompone.cs.ucsb.edu/~nurmi/images/euca-topo-nonet.png}} | 1. Download the 9.10 Server ISO 1. When you boot, select “Install Ubuntu Enterprise Cloud”. <<BR>> {{attachment:private1-cr.png}} 1. When asked whether you want a “Cluster” or a “Node” install, select “Cluster”. <<BR>> {{attachment:cluster-node-cr.png}} 1. It will ask two other cloud-specific questions during the course of the install: 1. Name of your cluster * e.g. ''cluster1'' 1. 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'' |
Line 45: | Line 42: |
Before you install the packages (or shortly thereafter), there are some prerequisites that should be satisfied to end up with a fully functioning Eucalyptus system. |
=== STEP 3: Install the Node controller(s) === |
Line 49: | Line 44: |
* The Eucalyptus administrator tools will use email to send verification requests to the cloud administrator when users request credentials. The cloud controller will send mail through the host `mailhost`. <<BR>> The simplest way to enable these tools to send mail is to install the 'postfix' package and make sure that the host `mailhost` resolves to `localhost` (e.g. by adding an entry to `/etc/hosts`). On the cloud controller system: {{{ $ sudo apt-get install postfix # Answer questions (suggest 'Internet Site') $ sudo vi /etc/hosts # add 'mailhost' to the localhost line $ grep mailhost /etc/hosts 127.0.0.1 localhost mailhost }}} * On each node, configure the system's primary ethernet interface as a bridge. (See the [[http://doc.ubuntu.com/ubuntu/serverguide/C/network-configuration.html#bridging|Ubuntu Server Guide Bridging]] for details). The node controller will attach virtual network interfaces to this bridge for VM that is started before it to enable network connectivity. <<BR>> ''Note:'' Remember the name of your node's bridge device (we assume the name of your bridge device is "`br0`" for the rest of this document). * The default Eucalyptus configuration assumes that there is a DHCP server in your environment that is handing out dynamic IP addresses. Since VMs will be bridged to your local network, they can run a DHCP client to get an IP address. * From any host that you wish to use as a Eucalyptus client, you should install the `euca2ools` package from universe: {{{ $ sudo apt-get install euca2ools }}} Also, other tools that can interact with the EC2 and S3 APIs should work with Eucalyptus. * If you wish to access Eucalyptus from behind a firewall (i.e. the `euca2ools` tools and the cloud controller will be on different sides of a firewall) then port `8773` ''must'' be open on the cloud controller. Additionally, if you plan to register your Eucalyptus installation with a cloud management platform, `8773` and `8443` must be open. |
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. |
Line 64: | Line 46: |
=== STEP 2: System Installation and Configuration === | 1. Boot from the same ISO on the node(s) 1. Select “Install Ubuntu Enterprise Cloud” 1. It should detect the Cluster and preselect “Node” install for you 1. Confirm the partitioning scheme 1. The rest of the installation should proceed uninterrupted; complete the installation and reboot the node |
Line 66: | Line 52: |
Install the eucalyptus-cloud and eucalyptus-cc packages on the front-end machine: {{{ $ sudo apt-get install eucalyptus-cloud eucalyptus-cc }}} |
=== STEP 4: Register the Node with the Cloud Controller === Register each node with the Cloud Controller: |
Line 72: | Line 55: |
Next, install the eucalyptus-nc package on each node: {{{ $ sudo apt-get install eucalyptus-nc }}} |
<<Include(UEC/RegisteringNodes)>> |
Line 77: | Line 57: |
Finally, on the node, bring down the eucalyptus-nc service and modify `/etc/eucalyptus/eucalyptus.conf` with the name of the bridge that you set up as the node's primary interface. | === STEP 5: Credentials setup === Retrieve your UEC credentials. |
Line 79: | Line 60: |
Note that there are several ways to configure a node to have a bridge as its primary interface, depending on the configuration of your machine. We show an example set of steps [[Eucalyptus+bridge|here]] but you will need to take care to ensure that this example configuration does not conflict with your local configuration if you wish to use it. | <<Include(UEC/Credentials)>> |
Line 81: | Line 62: |
However you have arranged for the bridge to be configured, you need to specify that bridge name ("`br0`" in our examples) in the node controller's configuration. To do so, type {{{ $ sudo /etc/init.d/eucalyptus-nc stop $ sudo vi /etc/eucalyptus/eucalyptus.conf # set VNET_BRIDGE="br0" $ sudo /etc/init.d/eucalyptus-nc start }}} |
=== STEP 6: Bundle a UEC Image === Next, register a new image with your Cloud Controller. |
Line 89: | Line 65: |
The following diagram depicts what your setup should now resemble: | <<Include(UEC/BundlingImages)>> |
Line 91: | Line 67: |
{{http://pompone.cs.ucsb.edu/~nurmi/images/euca-topo.png}} | === STEP 7: Running an Image === Finally, run an image in a virtual machine in your Cloud. |
Line 93: | Line 70: |
You will also need to change your networking configuration to make it so that IPv4 traffic is passed to IPv6 ports since the Eucalyptus web frontend runs by default only on IPv6. To do so, type {{{ $ sudo vi /etc/sysctl.conf # uncomment net.ipv4.ip_forward=1 # (it may not be commented out) $ sudo sysctl -p }}} Also, you may have noticed a message such as: {{{ apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName }}} Eucalyptus has it's own Apache config, you can add your ServerName statement there to make that go away, just edit ''/etc/eucalpytus/httpd.conf'' to begin somewhat like this: {{{ # # This is the apache config for eucalyptus: we use it only to load the # axis2c module which will take care of the WebServices # ServerTokens OS ServerName WHATEVER_YOUR_HOSTNAME_IS_HERE ServerRoot "/tmp" Listen 8774 KeepAliveTimeout 30 }}} You can verify that this resolved the issue by running {{{ sudo dpkg-reconfigure eucalyptus-nc }}} === STEP 3: Registering Eucalyptus Components === Eucalyptus assumes that each node in the system belongs to a cluster and that each cluster belongs to a cloud. Each node (there is only one node in this example) runs a copy of eucalyptus-nc. Similarly, each cluster (again, there is only one cluster in this example) must run a copy of eucalytpus-cc. For simplicity, the eucalyptus-cc in this example runs on the same machine as the cloud controller (eucalyptus-clc). These components must be registered with each other before the system starts. To register a cluster, execute the following on the cloud controller: {{{ $ sudo euca_conf -addcluster <clustername> localhost }}} where <clustername> is the name that you would like this cluster to appear as to your users. Note that this name is logical and local only to Eucalyptus. It will correspond to an availability zone in the output of the client tools. Next, register your node with the cluster by running the following command on the clound controller: {{{ $ sudo euca_conf -addnode <node_hostname> }}} Later, you can add more nodes by repeating the above command for each node running a copy of eucalyptus-nc. At this point, your Eucalyptus system should be up and running, ready for first time use. === STEP 4: Initial Login === The first time the cloud controller boots, you are required to go through some configuration steps that set up the administrative environment for the cloud. From your web browser (either remotely or on your Ubuntu server) access the following URL: {{{ https://<cloud-controller-ip-address>:8443/ }}} Use username 'admin' and password 'admin' for the first time login (you will be prompted to change your password). You can use "localhost" instead of your front-end's IP address if you are on that server. Now follow the on-screen instructions. When you finish the first time configuration process, click the 'credentials' tab located in the top-left portion of the screen. Click the 'Download Certificate' button to get your credentials. {{http://pompone.cs.ucsb.edu/~nurmi/images/euca-admin-cred.png}} ''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. Now you will need to setup EC2 API and AMI tools on your server using X.509 certificates. Unzip the downloaded zipfile into a safe location (~/.euca), and source the included "eucarc" file to set up your Eucalyptus environment. You may additionally wish to add this command to your ~/.bashrc file so that your Eucalyptus environment is set up automatically when you log in. Eucalyptus treats this set of credentials as 'administrator' credentials that allow the holder global privileges across the cloud. As such, they should be protected in the same way that other elevated-priority access is protected (e.g. should not be made visible to the general user population). Alternatively, you can script the installation using [[Eucalyptus+environment | these instructions]]. ==== Optional Registration With RightScale ==== !RightScale offers a Cloud Management Platform for use with Eucalyptus, both as a ''free'' services and through paid subscriptions. This cloud management software runs as a service within Amazon's AWS so it must be able to communicate with the Eucalyptus cloud controller (eucalyptus-clc) through any firewalls that separate the public Internet from where eucalyptus-clc is running. Thus ports 8443 and 8773 must be open to the public Internet for !RightScale to be able to communicate with your Eucalyptus cloud. To register your Eucalyptus cloud with !RightScale's service, see [[http://wiki.rightscale.com/2._References/02-Cloud_Infrastructures/Eucalyptus/03-Administration_Guide/Register_with_RightScale?ls=Referral&sd=%3EPartner_Ubuntu_Partnerpage&campaign=70170000000KyOn | Register my cloud with RightScale ]] === STEP 5: Obtain a Virtual Machine (VM) Image === There is more than one way to obtain a virtual image. The easiest way is to simply download one of the [[http://uec-images.ubuntu.com/releases/karmic/|Official Ubuntu UEC Images]]. Alternatively, if you would want to author your own image, you can use the [[https://help.ubuntu.com/community/Eucalyptus#Using%20vmbuilder | vmbuilder procedure below]] to create an image. {{{ $ wget http://uec-images.ubuntu.com/releases/karmic/<release>/ubuntu-uec-karmic-i386.img.gz }}} Next, you will need to bundle, upload and register a kernel, ramdisk and finally your image. Using the EC2 API tools, perform the following steps: {{{ # bundle and upload the systems kernel $ mkdir kernel $ euca-bundle-image --image /boot/vmlinuz-$(uname -r) \ --destination ./kernel --kernel true $ euca-upload-bundle --bucket kernel \ --manifest ./kernel/vmlinuz-$(uname -r).manifest.xml $ EKI=`euca-register kernel/vmlinuz-$(uname -r).manifest.xml | awk '{print $2}'` $ echo $EKI # create a ramdisk with acpiphp, bundle and upload $ mkdir ramdisk $ sudo sh -c 'grep -q acpiphp /etc/initramfs-tools/modules || printf "#acpiphp needed for ebs\nacpiphp\n" > /etc/initramfs-tools/modules' $ sudo mkinitramfs -o ./ramdisk/initrd.img-$(uname -r) $ euca-bundle-image --image ./ramdisk/initrd.img-$(uname -r) \ --destination ./ramdisk --ramdisk true $ euca-upload-bundle --bucket ramdisk \ --manifest ramdisk/initrd.img-$(uname -r).manifest.xml $ ERI=`euca-register ramdisk/initrd.img-$(uname -r).manifest.xml | awk '{print $2}'` $ echo $ERI # uncompress, bundle the image $ mkdir image $ zcat ubuntu-uec-karmic-i386.img.gz | cp --sparse=always /dev/stdin ubuntu-uec-karmic-i386.img $ euca-bundle-image --image ubuntu-uec-karmic-i386.img \ --destination ./image --kernel $EKI --ramdisk $ERI $ euca-upload-bundle --bucket image --manifest ./image/root.img.manifest.xml $ EMI=`euca-register image/root.img.manifest.xml | awk '{print $2}'` $ echo $EMI }}} ''Note'' the shell variables that have been set in the above code snippets. They will be used to test the installation in the steps below. Now, your kernel, ramdisk and image will have been uploaded into Eucalyptus and should be ready to run. To confirm, run the following command: {{{ $ euca-describe-images }}} You should see a registered kernel, ramdisk and image and they should be marked as 'available'. ||<style="background-color: #FAAFBA;">Please note: if you are preparing the bundle on a machine that uses encrypted filesystems be aware that you cannot bundle the machine ramdisk for your AMI. This is because your local ramdisk includes routines to decrypt your local encrypted filesystem and these will make the instance crash at boot (as the encrypted filesystem does not exist).|| === STEP 6: Running an Image === 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: {{{ $ euca-add-keypair mykey > ~/.euca/mykey.priv $ chmod 0600 ~/.euca/mykey.priv }}} ''Note:'' that 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. Next, you can create instances of your registered image: {{{ $ euca-run-instances $EMI -k mykey }}} 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: {{{ $ 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'. As soon as the instance is started, the state will become 'running'. As soon as the instance acquires an IP address from DHCP, you will see the public and private address fields change from '0.0.0.0' to a usable IP. When this happens, you can log into your new instance using the previously generated ssh key: {{{ $ ssh -i ~/.euca/mykey.priv ubuntu@<ip_of_instance> }}} Your Eucalyptus cloud should now look similar to the following logical diagram: {{http://pompone.cs.ucsb.edu/~nurmi/images/euca-topo-withinst.png}} |
<<Include(UEC/RunningImages)>> |
Line 266: | Line 74: |
* '''Log files:''' /var/log/eucalyptus * '''Configuration files:''' /etc/eucalyptus * '''Init Scripts:''' /etc/init.d/eucalyptus-cc, /etc/init.d/eucalytpus-cloud and /etc/init.d/eucalytpus-nc * '''Database:''' /var/lib/eucalyptus/db * Reboot note: If you reboot your machine Eucalyptus may not start up and function automatically. You may need to restart the services manually. * Environment note: Don't forget to source your ~/.euca/eucarc before running the client tools. == Next Steps and Links == * [[http://eucalyptus.cs.ucsb.edu | Eucalyptus Project Site (forums, documentation, downloads)]] * [[http://www.launchpad.net/eucalyptus/ | Eucalyptus on Launchpad (bugs, code)]] * [[http://eucalyptus.cs.ucsb.edu/wiki/EucalyptusTroubleshooting_v1.5 | Eucalyptus Troubleshooting]] * [[ http://wiki.rightscale.com/2._References/02-Cloud_Infrastructures/Eucalyptus/03-Administration_Guide/Register_with_RightScale?ls=Referral&sd=%3EPartner_Ubuntu_Partnerpage&campaign=70170000000KyOn | Register your cloud with RightScale ]] == Optional procedure to create images == === Eucalyptus procedure === The Eucalyptus project is proposing an [[http://open.eucalyptus.com/wiki/EucalyptusUserImageCreatorGuide_v1.5|alternate guide to create images]] === Using vmbuilder === If you would want to author your own image, you can use the [[https://help.ubuntu.com/8.04/serverguide/C/ubuntu-vm-builder.html | vmbuilder utility]] utility to create an image that will run in Eucalyptus. First, create a partition description file called 'part'. The contents describe the size, types, and mount points of your VM disk partitions: {{{ $ cat > part <<EOF root 400 /mnt/ephemeral 0 /dev/sda2 swap 1 /dev/sda3 EOF }}} Next, create a simple script called 'firstboot' that will be executed the first time your image boots inside Eucalyptus to install an ssh daemon. In a file called 'firstboot' create the shell script: {{{ $ cat >firstboot <<EOF #!/bin/sh apt-get -y install openssh-server EOF }}} Then, create the image with vmbuilder passing the name of the script file as an argument so that it can be installed. Note that even though we are asking vmbuilder to create a 'xen' image (this simply just means that the output format of the image is a disk partition), the resulting image will boot in Eucalyptus using KVM. {{{ $ sudo vmbuilder xen ubuntu --part ./part --firstboot ./firstboot }}} Next, you will need to bundle, upload and register a kernel, ramdisk and finally your image. Using the EC2 API tools, perform the following steps: {{{ $ mkdir kernel $ euca-bundle-image --image /boot/vmlinuz-$(uname -r) \ --destination ./kernel --kernel true $ euca-upload-bundle --bucket kernel \ --manifest ./kernel/vmlinuz-$(uname -r).manifest.xml $ EKI=`euca-register kernel/vmlinuz-$(uname -r).manifest.xml | awk '{print $2}'` $ echo $EKI $ mkdir ramdisk $ sudo sh -c 'grep -q acpiphp || printf "#acpiphp needed for ebs\nacpiphp\n" > /etc/initramfs-tools/modules' $ sudo mkinitramfs -o ./ramdisk/initrd.img-$(uname -r) $ euca-bundle-image --image ./ramdisk/initrd.img-$(uname -r) \ --destination ./ramdisk --ramdisk true $ euca-upload-bundle --bucket ramdisk \ --manifest ramdisk/initrd.img-$(uname -r).manifest.xml $ ERI=`euca-register ramdisk/initrd.img-$(uname -r).manifest.xml | awk '{print $2}'` $ echo $ERI $ mkdir image $ euca-bundle-image --image ubuntu-xen/root.img \ --destination ./image --kernel $EKI --ramdisk $ERI $ euca-upload-bundle --bucket image --manifest ./image/root.img.manifest.xml $ EMI=`euca-register image/root.img.manifest.xml | awk '{print $2}'` $ echo $EMI }}} Note the shell variables that have been set in the above code snippets. They will be used to test the installation in the steps below. Now, your kernel, ramdisk and image will have been uploaded into Eucalyptus and should be ready to run. To confirm, run the following command: {{{ $ euca-describe-images }}} You should see a registered kernel, ramdisk and image and they should be marked as 'available'. ||<style="background-color: #FAAFBA;">Please note: if you are preparing the bundle on a machine that uses encrypted filesystems be aware that you cannot bundle the machine ramdisk for your AMI. This is because your local ramdisk includes routines to decrypt your local encrypted filesystem and these will make the instance crash at boot (as the encrypted filesystem does not exist).|| |
* '''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. |
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
- Download the 9.10 Server ISO
When you boot, select “Install Ubuntu Enterprise Cloud”.
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:
- Name of your cluster
e.g. cluster1
- 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
- Name of your cluster
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.
- Boot from the same ISO on the node(s)
- Select “Install Ubuntu Enterprise Cloud”
- It should detect the Cluster and preselect “Node” install for you
- Confirm the partitioning scheme
- 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:
- Public SSH keys have been exchanged properly
- The services are configured properly
- The services are publishing their existence
- The appropriate uec-component-listener is running
- 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
- 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.
- Use username 'admin' and password 'admin' for the first time login (you will be prompted to change your password).
- Then follow the on-screen instructions to update the admin password and email address.
Once the first time configuration process is completed, click the 'credentials' tab located in the top-left portion of the screen.
- Click the 'Download Credentials' button to get your certificates
Save them to ~/.euca
- Unzip the downloaded zipfile into a safe location (~/.euca)
unzip -d ~/.euca mycreds.zip
From a Command Line
- 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.
- Install the required cloud user tools:
sudo apt-get install euca2ools
- 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. |
- 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
- 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:
- 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.
- 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.
- You must also allow access to port 22 in your instances:
euca-authorize default -P tcp -p 22 -s 0.0.0.0/0
- 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.
- 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'. - 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
- 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.