6 Uec Program
6 Uec Program
6 Uec Program
Preparation
For our installation we will be using two servers, one as a cloud controller and the other as a
cloud node. Cloud instances will be running on the node, so unless the systems are identical
we will choose the system with more CPU cores and memory as our node controller. This
allows us more room for growth in the cloud as we add instances.
1
OSCONAfter making the appropriate language, country and keyboard selections, we will be prompted
2010 to configure the network. For this lab we will be using eth0 for both the cloud and node
controllers.
Next we will assign a hostname. We have chosen the name “cc” for our cloud controller:
2
OSCON
2010 Because we don’t already have a cloud controller installed on this network, we’ll select
continue at this screen:
Here we must choose the role this server will play in our cloud. In larger and/or more
complex installations, each of the functions shown in this menu may be divided onto separate
physical servers. Eucalyptus private clouds will have a single cloud controller, but there may
be multiple cluster controllers within the cloud, and multiple node controllers reporting to
each cluster controller. Walrus is the data storage component of Eucalyptus, which is similar
to Amazon’s Simple Storage Service (S3). For our simplified demonstration, we will use a
single-cluster installation and accept the default cloud installation mode of Cloud controller,
Walrus storage service, cluster controller, and storage controller.
3
OSCON
In our lab we will use the eth0 interface to connect to the public network and to communicate
2010 withthe node.
The next several screens show us accepting the default proposal for partitioning the disks:
4
OSCON
2010 We have one diskto present to the Ubuntu installer, which is a RAID 1+0 array we built
using the HP smart array bios:
11
OSCON
2010 Here we will accept the default partitioning and configure Linux Volume Manager (LVM):
In our Lab we will keep it simple and use the entire volume group for guided partitioning:
12
OSCON
2010 Here we will write the new changes to disk:
Next, the installer will format the partitions and install the base system:
13
OSCON
2010 Herewe are prompted to create a user account which will have sudo privileges. We chose
“cladmin” as our username, with a password of “cloud9”:
14
OSCON
2010 After answering several email-related questions, we configure the name of the cluster:
Here we provide a pool of addresses that will be automatically assigned to VMs as they are
instantiated. These addresses will be automatically assigned to cloud instances to make them
accessible from outside the cloud:
15
OSCON
2010 Next we install the Grand Unified Boot loader, GRUB:
21
Building the Node Controller
OSCONNow that our cloud controller (and cluster controller, walrus, storage controller) has been
2010
built, we will move on to the next server. To begin build our node controller we will boot
from the Ubuntu 10.04 Server cdrom and select “Install Ubuntu Enterprise Cloud” from the
menu:
After making the appropriate language, country, keyboard selections and network interface,
we will be prompted for the hostname. We entered “nc” as the hostname of our node
controller.
22
OSCON
2010 The installer will detect the cluster controller already running on our network, and default to a
cloud installation mode of “Node Controller” which we will accept:
After selecting the cloud installation mode, you might see a screen similar to this one if there
is more than one cluster controller on the subnet:
A word of caution: we ran into some issues when installing more than one cloud on the same
subnet, so beware!
23
OSCON
2010 The next several installation screens will present us with disk partitioning options, and we
will use the same settings that were used for the cloud controller, then the installation will
finish the node will be rebooted.
Now that our cloud controller and node controller have been installed, we are ready to
configure administrative access to the cloud.
Please note that from here on, we may use the hostnames “cc” and “nc” in commands. If
DNS is not configured on your network, you will need to specify the IP address instead of the
hostname.
Step 1:
Here we will set a temporary password for the eucalyptus account. Login to the node
controller as user “cladmin” password “cloud9”: cladmin@nc:~$ sudo passwd eucalyptus
Type “cloud9” for the temporary password.
Step 2:
Here we will login to the cloud controller and copy the ssh public key for the eucalyptus user
to the node controller:
Step 3:
Now, from our node controller we’ll remove the temporary password:
Before we can use the Amazon EC2 command-line utilities to interact with the cloud, we will
need to install credentials which consist of x.509 certificates and environment variables.
Step 1:
Browse to the URL https://cc:8443
24
OSCON
2010
Step 2:
Set a new password for the admin account and supply an email address. The cloud host IP is
automatically filled in and is the public facing IP for the cloud controller:
25
OSCONStep 3:
2010 Now we will download our credentials. The web front end of Eucalyptus is currently limited,
so after the initial configuration much of the administration will be done from the command
line using the Amazon EC2 tools. On Ubuntu the name of the package is “euca2ools” and is
conveniently installed by default on our cloud controller, so we’ll be using the cloud
controller as our command-line headquarters for managing the cloud later in this guide.
To download credentials, click the “Credentials” tab and click “Download Credentials” :
Step 4:
Copy the downloaded file euca2-admin-x509.zip to /home/cladmin folder on the cloud
controller. You can use scp, ftp, sftp, or any other preferred method.
Step 5:
Now we will create a hidden folder on the cloud controller and extract the zip file to this
folder:
Step 6:
Because the credentials file contains information allowing administrative access to the cloud,
it is recommended to remove the zip file and apply permissions to the .euca folder and its
contents:
26
OSCONcladmin@cc:~/.euca$ rm ~/euca2-admin-x509.zip cladmin@cc:~/.euca$ chmod 0700 ~/.euca
2010 cladmin@cc:~/.euca$ chmod 0600 ~/.euca/*
Step 7:
Next we will add a line to the ~/.bashrc file on the cloud controller to ensure the necessary
environment variables are initialized upon login:
Step 8:
Next we will source the .bashrc file to ensure our settings take effect:
You can log off and back on in order to ensure these settings are active.
Step 1:
While it is possible to build custom images and bundle, upload and register them with the
cloud, for the sake of time we will install an image from Canonical’s online cloud image
store.
Clicking the “Store” tab in the web interface will show us the images that are available from
Canonical over the internet. For our lab we will install the MediaWiki Demo Appliance
image, which after downloading the image from Canonical it will be installed to the cloud:
27
OSCON
2010
Step 2:
After the image has been installed, we can click on the images tab to confirm it has been
registered with the cloud:
Make a note of the emi-xxxxxx under the Id column as it will be the identifier we use to run
an instance. An emi file is the Eucalyptus equivalent of an Amazon Machine Image (AMI)
file from Amazon web services, which consists of a raw disk image and a pointer to a kernel
28
and optionally a ramdisk.
OSCONRunning an Instance
2010 Before we run an instance, we need to make sure there are sufficient resources available in
the cloud (e.g. the nodes). We’ll use the euca-describe-availability-zones to show us all the
available resources on our cloud nodes:
cladmin@cc:~$ euca-describe-images
Security groups are basically sets of iptables firewall rules that control connection requests
originating from hosts outside the cloud and destined towards virtual instances running inside
the cloud.
We can view the security groups within Eucalyptus by issuing the following command:
cladmin@cc:~$ euca-describe-groups
29
Because the security group “default” does not by default contain any rules allowing external
OSCONaccess to cloud instances, we’ll need to either modify the default security group or create a
2010 new group and use it instead of the default group, and for this exercise we chose the latter,
Running the euca-describe-groups command again should now show our newly built group.
We’ll need to build a keypair that will be injected into the instance allowing us to access it via
ssh:
Now we are finally ready to begin running instances. We’ll start by creating an instance of
our Mediawiki appliance and we’ll assign it to the wiki security group we built earlier so that
inbound connections will be allowed on ports ssh and http:
Note that if a smaller availability zone was selected for our image, it would automatically
terminate because of insufficient space. Checking the /var/log/eucalyptus/nc.log file on the
node can provide useful clues in these cases.
It may be useful at times to see the console output of an instance. We can use the euca-get-
console- output command for this task, where i-xxxxxx corresponds to the image ID listed by
the “euca-describe- instances” command:
Using the public IP, we should also browse to the URL of the instance to ensure the wiki is
available:
http://w.x.y.z/mediawiki
31we can visit the URL of any of the new instances to see that the instance is up and
Again,
running and responding to external connections.
OSCON
2010
Notes
The transient nature of cloud instances:
Once an instance is terminated, all data is lost. One way around this limitation is to configure
Elastic Block Storage (EBS) and install the OS of the image inside a chroot environment on
the EBS volume.
High Availability:
There isn’t much in the way of HA in a default installation of Eucalyptus, although the
developers are almost certainly working on something in this department due to the demand.
In the meantime there are probably a few Eucalyptus users out there who have either written
scripts to detect an instance is no longer running and launch it on another node, or who are
investigating something along those lines.
32