Climbing into the cloud with Apache CloudStack

Enabling the Graphical User Interface

I am now ready to start the management server. The server is initialized by the cloudstack-setup-management command, which also handles the firewall setup and other things:

cloudstack-setup-management
Starting to configure CloudStack Management Server:
Configure sudoers ... [OK]
Configure Firewall ... [OK]
Configure CloudStack Management Server ... [OK]
CloudStack Management Server setup is Done!
/etc/init.d/cloudstack-management start

CloudStack provides a management front end that you can access via http://Management-Server-IP:8080/client/. The combination for the initial login is admin/password. Unfortunately, initialization will take up to 10 minutes – even on a fast machine. Check the logfile in /var/log/cloudstack/management/management-server.log if you experience problems logging in.

Using Hardware Virtualization

Hardware virtualization is tricky – and not only on Unix. System integrators have the unpleasant tendency to deliver workstations with the VT feature disabled. Fortunately, you can check virtualization support by typing kvm-ok – the script identifies any errors in the system configuration:

~$kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used

Following the initial login, the management server offers an installation wizard. The wizard is particularly useful for people moving from other systems, because it complains about CloudStack configuration errors occurring in the scope of setting up the zone. In this case, the setup fails because CloudStack was unable to create a host, which is only logical because I have not enabled KVM yet.

Granting External Access to KVM

By default, KVM does not accept any external commands. To change this behavior, open the /etc/libvirt/libvirtd.conf file and add the following five properties:

listen_tls = 0
listen_tcp = 1
tcp_port = "16509"
mdns_adv = 0
auth_tcp = "none"

On the newly installed version of Ubuntu, these attributes are disabled by #. Add the properties in a block below the "Network Connectivity controls" header to save yourself some work. The daemon responsible for monitoring the virtualization service does not listen for sockets arriving via TCP by default. I can change this in the /etc/default/libvirt-bin file by adding the -l parameter:

# options passed to libvirtd, add "-l" to listen on tcp
libvirtd_opts="-d -l"

After completing this work, you need to restart libvirt and get rid of AppArmor. You can reboot by entering service libvirt-bin restart at the command line.

The interaction between the management server and the KVM host can be facilitated if the management server logs in to the KVM host as root using SSH. Ubuntu makes this difficult because it does not support root logins and does not automatically launch an SSH server:

sudo apt-get install openssh-server

You need to modify /etc/ssh/sshd_config to support root logins. Then restart the server as follows:

sudo /etc/init.d/ssh restart:
PermitRootLogin yes

Finally, assign a password to the root user:

/usr/share/cloudstack-management/webapps/client/WEB-INF# passwd
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

Now click on Infrastructure | Hosts | Add Host in the management window to add new worker machines to the system. If the host cannot log in, you can start looking for an error in the network infrastructure. KVM and CloudStack assume a specific bridge exists in /etc/network/interfaces. If this is not the case, the cloud management agent prevents the deployment. You can check this out by running the cloud-stack-setup-agent command on the system acting as the virtual machine server. If the Python script returns errors, see the online documentation and commentary for more details [4].

The management server dumps the commands coming from the host in its logfile. In case of hard-to-solve problems, it makes sense to track logfile entries with tail -f.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus

Direct Download

Read full article as PDF:

Price $2.95

News