📜 ⬆️ ⬇️

Eucalyptus - "cloud" with his own hands

Existing cloud computing technologies allow not only using public services like Amazon, but also independently deploying cloud infrastructures, both on the basis of enterprises and at home. There are freeware systems for such private clouds. These systems are available to everyone, but installing them can be a daunting task. This article is devoted to the experience of installing one of the most famous such systems.

Eucalyptus is a development of University of California, Santa Barbara employees, distributed under the GPL v3 license. Architecturally, Eucalyptus consists of several basic elements:


image
')

To deploy your own "cloud", two machines were allocated with the following configuration:

A computer that performs the functions of a cloud controller, cluster controller, and network storage:

The computer that performs the functions of the node controller:

To begin with, before installing Eucalyptus, the preferred hypervisor ( Xen or KVM ) must be installed on each host machine. Installing them has no features and is done according to the administrator’s manual

Let's start installing Eucalyptus version 1.5.2. In general, the installation guide is given on the developer's site , but, as the installation practice has shown, it does not describe some of the pitfalls.
In particular, in order to exclude possible problems in the future operation of the system, before installing, several basic actions must be performed:

After that, the installation of the Eucalyptus system is performed by the standard installer without problems. To start the system run the commands:

Services started, in the error logs are not visible. Now let's register our cluster on the cloud controller:
$ $EUCALYPTUS/usr/sbin/euca_conf -addcluster <clustername> <clusterhost>
Add node nodes to our cluster:
$ $EUCALYPTUS/usr/sbin/euca_conf -addnode "<nodehost1> ... <nodehostN>"

At this stage, we will need an established passwordless access via ssh. Otherwise, we will see a message offering to perform a series of operations in order to arrange such access.

Next, go to the address <clusterhost> : 8443 and specify all the necessary information on the web portal to manage the "cloud".
The main part of the work is done - the “cloud” infrastructure is deployed. It now remains to add images of virtual machines to the storage and launch them.

We will simulate a custom host using a virtual machine with a Debian lenny on board. Download and install Euca2ools . From the site of our “cloud”, download the X.509 certificate and add the necessary information to the system:
$ mkdir ~/.euca
$ cd ~/.euca
$ unzip name-of-the-key-zip.zip
$ chmod 0700 ~/.euca
$ chmod 0600 ~/.euca/*
$ . ~/.euca/euca2-*/eucarc


Now you can check the performance of the "cloud". Check whether the cluster and machine node are visible:
$ euca-describe-availability-zones verbose
AVAILABILITYZONE MyCluster 192.168.0.1
AVAILABILITYZONE |- vm types free / max cpu ram disk
AVAILABILITYZONE |- m1.small 0002 / 0002 1 128 10
AVAILABILITYZONE |- c1.medium 0002 / 0002 1 256 10
AVAILABILITYZONE |- m1.large 0001 / 0001 2 512 10
AVAILABILITYZONE |- m1.xlarge 0000 / 0000 2 1024 20
AVAILABILITYZONE |- c1.xlarge 0000 / 0000 4 2048 20
AVAILABILITYZONE |- 192.168.0.2
certs[cc=true,nc=true] @ Mon Apr 05 15:13:30 PST 2010


Remarkably, the cluster, the machine-node and the resources available on it are visible.
Now you can upload a pre-prepared virtual machine image for the Xen hypervisor to the storage. Instructions for this operation are also available on the Eucalyptus website.

We perform the required actions, but an error appears in the middle of the download:
500 Unable to parse date

The problem is that the date on the virtual machine is lost. Forgot about the main rule - time synchronization. Synchronize our virtual machine, repeat the boot process - all without errors.
Checking what happened:
$ euca-describe-images
IMAGE eki-747416B3 debian-kernel-bucket/vmlinuz-2.6.26-2-xen-686.manifest.xml admin available public x86_64 kernel

IMAGE eri-DA6317EF debian-ramdisk-bucket/initrd.img-2.6.26-2-xen-686.manifest.xml admin available public x86_64 ramdisk

IMAGE emi-076811AA debian-image-bucket/deb.img.manifest.xml admin available public x86_64 machine


We start the virtual machine:
$ euca-run-instances –t c1.medium --kernel eki-747416B3 --ramdisk eri-DA6317EF emi-076811AA

Unfortunately, the image is copied from the repository to the host machine, but it drops when it starts. The problem lies in the interaction of the host controller and the hypervisor. We are looking for a file on the host machine responsible for this interaction - / usr / share / eucalyptus / gen_libvirt_xml . In the line responsible for the additional settings for running the virtual machine, add another parameter xencons = tty so that the line takes the form:
root=/dev/sda1 xencons=tty

Repeat the startup procedure:
$ euca-run-instances –t c1.medium --kernel eki-747416B3 --ramdisk eri-DA6317EF emi-076811AA
INSTANCE i-3E190649 emi-076811AA 192.168.0.5 192.168.0.5 running c1.medium 2010-04-05T15:43:37.916Z

The desired result was obtained - a “cloud” infrastructure was created, a virtual machine image was loaded and launched. The resulting platform can be used for the provision of both internal and public services.
It is worth noting that all components can be installed on a single physical host. This imposes some restrictions on the functionality, but it is convenient enough to study the Eucalyptus system. Equally important is the fact that Eucalyptus is fully compatible with Amazon services. Thus, this system can also be used as a test platform for debugging images planned for use on Amazon servers. In this example, we created Linux-based virtual machines, however, the capabilities of modern “cloud” systems allow you to run virtual machines running Windows. This question is left outside the scope of this article.

Source: https://habr.com/ru/post/93830/


All Articles