Cloud Stack Installation and Configuration on Linux (Centos)

Cloud-Stack Installation.

Objective: To install and configure Apache Cloudstack

Description: Apache Cloudstack is an open-source cloud computing platform similar with both OpenNebula and OpenStack.

The Controller node (Cloudstack-management) is used for unified management of computing nodes, providing resource allocation and task, and providing others services such as API, GUI and database.

Compute nodes (Cloudstack-agent) is used to run a virtual machine.

Requirements:
1. One control node – CentOS 6.5 64 bit
2. One for compute node – CentOS 6.5 64 bit
3. Root credentials or sudo permissions

Installation Steps:

Configuring Network:

Configure bridge network on controller and compute node as shown below. HWADDR, IPADDR, NETMASK, GATEWAY and DNS should match with your requirement

Note : Change IPADDR, HWADDR, NETMASK, GATEWAY and DNS according to your N/W on both Nodes.

1. Edit the below files

# vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
HWADDR=BC:AE:C5:57:C1:25
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
#IPADDR=192.168.1.9
#NETMASK=255.255.250.0
#GATEWAY=192.168.1.1
#DNS2=192.168.1.201
#DNS1=192.168.1.200
BRIDGE=cloudbr0

# vi /etc/sysconfig/network-scripts/ifcfg-cloudbr0

DEVICE=cloudbr0
HWADDR=BC:AE:C5:57:C1:18
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPADDR=192.168.1.9
NETMASK=255.255.250.0
GATEWAY=192.168.1.1
DNS2=192.168.1.201
DNS1=192.168.1.200
TYPE=Bridge
DELAY=0

Note: After editing or creating the above files need to restart network service.

2. Execute below commands in both nodes.
#/etc/init.d/network restart
#brctl show
bridge name bridge id STP enabled interfaces
cloudbr0 8000.50e54946532f no eth0
virbr0 8000.52540004a987 yes virbr0-nic
# chkconfig network on

3. Set the FQDN on both nodes with different host-name as shown below
# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=cloudstack01.jstpl.com

# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain
192.168.1.1 cloudstack01.jstpl.com

4. Disable SELinux on both nodes
#vi /etc/selinux/config
SELINUX=disabled

5. Reboot both the nodes

6. Once the nodes come up after reboot, check below to confirm the changes are applied

# getenforce
Disabled

#hostname –fqdn
cloudstack01.jstpl.com

#brctl show
bridge name bridge id STP enabled interfaces
cloudbr0 8000.50e54946532f no eth0

Controller Node Setup:

Run the below commands on Control Node to setup Cloud-Stack Management server.

1. Perform upgrade
yum update

2. Create repo file as shown below with below entries
#vi /etc/yum.repos.d/cloudstack.repo
[cloudstack]
name=cloudstack
baseurl=http://cloudstack.apt-get.eu/rhel/4.2/
enabled=1
gpgcheck=0

3. Perform below steps
yum update -y
yum -y install ntp
chkconfig ntpd on
service ntpd restart

4. Install NFS and configure NFS server in Controller node as shown below
yum install nfs-utils

5. Edit exports file as below
#vi /etc/exports
/secondary *(rw,async,no_root_squash)
/primary *(rw,async,no_root_squash)

6. Create folders as below
mkdir /secondary
mkdir /primary

9. Edit idmapd.conf file as below
#vi /etc/idmapd.conf
Domain = jstpl.com

10. Now you’ll need uncomment the configuration values in nfs configuration file
#vi /etc/sysconfig/nfs
LOCKD_TCPPORT=32803
LOCKD_UDPPORT=32769
MOUNTD_PORT=892
RQUOTAD_PORT=875
STATD_PORT=662
STATD_OUTGOING_PORT=2020

11. Enable services as below
#service rpcbind restart
# service nfs restart
# chkconfig rpcbind on
# chkconfig nfs on
# exportfs -a

12. Install Mysql server on controller node
yum -y install mysql-server

13. Edit /etc/my.cnf as you need to add the following options to the [mysqld] section:
#vi /etc/my.cnf
innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
max_connections=350
log-bin=mysql-bin
binlog-format = ‘ROW’

14. Start mysql server
# service mysqld start
# chkconfig mysqld on

15. Install Cloudstack components as below
#yum install cloudstack-setup-management
#yum install cloudstack-setup
#yum -y install cloud-client

16. Run below command and set password for mysql (at prompt say Y to everything)
#mysql_secure_installation

17. Run below command
#cloudstack-setup-databases cloud:cloud@localhost –deploy-as=root:<<mysql password>> -i <<controller node IP>>

18. Now that the database has been created, we can take the final step in setting up the management server by issuing the following command:
#cloudstack-setup-management

19. Now download the system VM template and deploy that to the share we just mounted. The management server includes a script to properly manipulate the system VMs images. Using following command download the template for Cloud-Stack.

#/usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt -m /secondary -u http://d21ifhcun6b1t2.cloudfront.net/templates/4.2/systemvmtemplate-2013-06-12-master-kvm.qcow2.bz2 -h kvm -s -F

Compute Node Setup:

Run the below commands on compute node.

1. Follow First 3 steps mentioned in Controller Node Setup section.

2. Install KVM agent on compute node
#yum -y install cloud-agent
#yum install qemu-kvm -y

3. Edit /etc/libvirt/qemu.conf and ensuring the following line is present and uncommented
vnc_listen=0.0.0.0

4. Uncomment below given parameters for libvirtd configuration.
#vi /etc/libvirt/libvirtd.conf
listen_tls = 0
listen_tcp = 1
tcp_port = “16059”
auth_tcp = “none”
mdns_adv = 0

5. Uncomment below parameter in /etc/sysconfig/libvirtd file
#vi /etc/sysconfig/libvirtd
LIBVIRTD_ARGS=”—listen”

6. Restart libvirtd service as below
#service libvirtd restart

7. Stop IP tables on both controller and compute node
/etc/init.d/iptables stop
chkconfig iptables off

8. Reboot both the nodes and this completes your Cloudstack installation

9. Open the browser, access Controller node as http://<<IP Address of Control Node>>:8080/client/ and login as admin/password

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: