Single System Test Cloud, Take 2
Testing Eucalyptus should be easy. In Single System Test Cloud, testing a cloud was made easier by removing the requirement of having at least two systems. But, it still adds unnecessary complexity by adding a VM to run the front-end system. After learning from the experience of the first single system test cloud, it became apparent that there should be an easy way to run Eucalyptus without the use of a VM. And yes there is!
First, start off with a CentOS 6 installation. This installation can either be with or without a GUI environment though a GUI will help on a system such as a laptop.
After CentOS 6 is installed setup a bridge. This bridge does will not be attached to any of the physical devices of the system. This bridge will be used by the NC for the instances as well as for communication between the CC and the NC. We will need an free subnet and IP address that may be use. This subnet can be very small but a /24 will be used in the example. The bridge will be setup to use the IP address
172.16.0.1 and a netmask of
To setup the bridge on
br0 with the above information, place the below into
DEVICE=br0 ONBOOT=yes TYPE=Bridge BOOTPROTO=none IPADDR=172.16.0.1 NETMASK=255.255.255.0 NETWORK=172.16.0.0
Note: If a laptop or another system that may get a different IP address is used, it could be a good idea to use a sub-interface. This way if the IP address changes on the system, the configuration will not need to change and the cloud should still function. Eucalyptus does not deal well with changing IP addresses on components.
To prevent a possible issue with the Eucalyptus meta-data service, turn off Zeroconf by adding the following to
To have the two new settings setup above take effect, restart the networking process:
service network restart
Note: If a GUI was installed with the CentOS installation there might be issues caused by Network Manager. To get around these I suggest that you add
NM_CONTROLLED="no" to the interface that Eucalyptus will use for the its IP.
Next disable the system firewall and either place SELinux in permissive mode or disabled. To turn off the firewall use the following command:
Deselect the firewall entry. Next edit
/etc/selinux/config and change the
SELINUX entry to either
disabled. Finish the SELinux configuration by running the following:
Now install and configure the NTP service. The NTP service will be set to start at boot and the resulting updated time will be synced to the hardware clock of the system. Run the following commands:
yum -y install ntp chkconfig ntpd on service ntpd start ntpdate -u pool.ntp.org hwclock --systohc
Eucalyptus is a difficult product to install the first time so I heavily recommend taking some time to read the Eucalyptus Installation Guide. Please take the time to carefully read the Installation Guide as it will make the steps below much easier to understand. Really.
To begin the Eucalyptus installation, install and setup the needed repositories.
yum -y install http://downloads.eucalyptus.com/software/eucalyptus/3.1/centos/6/x86_64/eucalyptus-release-3.1.1.noarch.rpm yum -y install http://downloads.eucalyptus.com/software/eucalyptus/3.1/centos/6/x86_64/eucalyptus-release-3.1-1.el6.noarch.rpm yum -y install http://downloads.eucalyptus.com/software/euca2ools/2.1/centos/6/x86_64/euca2ools-release-2.1-2.el6.noarch.rpm yum -y install http://downloads.eucalyptus.com/software/eucalyptus/3.1/centos/6/x86_64/epel-release-6-7.noarch.rpm yum -y install http://downloads.eucalyptus.com/software/eucalyptus/3.1/centos/6/x86_64/elrepo-release-6-4.el6.elrepo.noarch.rpm
Now install the Eucalyptus Cloud Controller (clc), Cluster Controller (cc), Storage Controller (sc), Walrus, and Node Controller (nc) on the system.
yum -y groupinstall eucalyptus-cloud-controller yum -y install eucalyptus-nc eucalyptus-cc eucalyptus-sc eucalyptus-walrus
Since all of the Eucalyptus components are now installed, it is time to configure the system. Before the changes can be made to the configuration file there is some information that needs to be gathered.
Eucalyptus requires a list of public IP addresses that can be given to instances that are started. For this type of a cloud five should be sufficient but one IP will be needed for each instance that is run. These public IPs do not need to be publicly routed or even routed on your network. In the example below, the range “10.104.5.55-10.104.5.60″ will be used for the list of public IPs.
Eucalyptus will create a private network that will be used for instance communication. This network subnet should be one that is not currently utilized on the local network. This network subnet should have at least 256 addresses in it (this is a /24 or a netmask of
255.255.255.0). In this example, the subnet that will be used is
172.31.0.0 with the netmask
Eucalyptus will give each instance a DNS server to use when it boots. For this example we will use Google’s Public DNS server at
/etc/eucalyptus/eucalyptus.conf and change the following settings. Make sure that if any of the example settings conflict in the local network that values are swapped with some that will work. Also make sure to remove any “#” characters that might be at the beginning of these settings.
CREATE_SC_LOOP_DEVICES=256 USE_VIRTIO_NET="1" VNET_MODE="MANAGED-NOVLAN" VNET_PRIVINTERFACE="br0" VNET_PUBINTERFACE="eth0" VNET_BRIDGE="br0" VNET_PUBLICIPS="10.104.5.55-10.104.5.60" VNET_SUBNET=172.31.0.0 VNET_NETMASK=255.255.255.0 VNET_ADDRSPERNET="16" VNET_DNS=188.8.131.52
When the Eucalyptus NC service was installed Libvirtd was also installed. DNSMasq comes with Libvirtd but causes issues with Eucalyptus. So, we’re going to turn off DNSMasq and disable it from starting at boot.
service dnsmasq stop chkconfig dnsmasq off
Now it is time to initialize the Eucalyptus DB and to start the components. Run the following command:
If the output of the above command includs the word “succeeded” then the database was successfully setup. Next, start the services.
service eucalyptus-cloud start service eucalyptus-cc start service eucalyptus-nc start
Check to see if the services are running by looking for the following ports in the output of
netstat -ntplu: 8443, 8773, 8774, 8775. If all of these ports are found in the output then the services are running.
Registration of the components can now take place. Register all of the components, except for the NC, on the same IP. The NC should be registered on the IP given to the
br0 interface above. For this example, the system has been setup with the IP 10.104.5.1 so all components, except for the NC, will be registered to that IP.
/usr/sbin/euca_conf --register-walrus --partition walrus --host 10.104.5.1 --component walrus-single /usr/sbin/euca_conf --register-cluster --partition cluster01 --host 10.104.5.1 --component cc-single /usr/sbin/euca_conf --register-sc --partition cluster01 --host 10.104.5.1 --component sc-single /usr/sbin/euca_conf --register-nodes "172.16.0.1"
Note: If the IP of the system that this is being setup on is not
10.104.5.1 then please replace the IP above with the correct IP.
Finally, the cloud should be running and registered so that credentials can now be downloaded. Run the following to get the cloud administrator’s credentials:
euca_conf --get-credentials admin.zip
Unzip the resulting
admin.zip file into a directory. Next, run the following command inside of the directory where the
admin.zip file was unzipped.
To see if the cloud has been able to find resources on the system run the following command:
If the output does not contain
000 / 000 on every line then the cloud is successfully operating. Now an image should be uploaded to the cloud so that an instance may be run. I will leave this as activity to the user. Information on images can be found in the Eucalyptus Administration Guide.