Sunday, March 29, 2015

Apache Cloudstack Implementation Step by step Part 3 - Cloudstack Installation with advanced network configuration

Installation of Cloudstack

Apache Cloudstack:

CloudStack is an open source software platform that pools computing resources to build public, private, and hybrid Infrastructure as a Service (IaaS) clouds. CloudStack manages the network, storage, and compute nodes that make up a cloud infrastructure. Use CloudStack to deploy, manage, and configure cloud computing environments.

The Cloudstack management Server system can be a physical machine or virtual machine with access to a supported database.
Minimum Requirements for cloudstack management server

  • CPU – one 64-bit CPUs or one 64-bit processor.
  • Processor – 2.0GHz or faster Intel or AMD processor. Processor requirements might be higher if the
  • database runs on the same machine.
  • Memory – 1GB RAM. Memory requirements might be higher if the database runs on the same machine.
  • Disk storage – 2GB. Disk requirements might be higher if the database runs on the same machine.
  • MySQL disk requirements  depends on the size of infrastructure.
  • Networking – Gigabit connection recommended.

Cloudstack service Requirements

  • Make sure that your operating system supported in installation version of cloudstack. cloudstack management Server recommended to run on 64-bit operating
  • For a list of supported operating systems, see the Cloudstack installation guide on
  • documentation Web site
Before we begin with the instalation a CentOS 6.x or RHEL 6.x need to be ready with basic pachage installaed.
Architecture of cloudstack management nodes:
Cloudstack Management server installation
1) To add the CloudStack repository, create /etc/yum.repos.d/cloudstack.repo and insert the following information.



baseurl=file:/// media

(go to the installation path and type ./install )
2) Check the host name fully qualified domain name configuration settings
# hostname --fqdn
3) Install NTP service to synchronize time between all management servers
# yum install ntp
4) Check the connectivity with internet to verify the download capabilities 
# ping
5) Start the nfs client and rpcbind service and configure to start on every startup
    # service nfs start
    # service rpcbind start
    # chkconfig nfs on
    # chkconfig rpcbind on
5) Type following command in root previledge to start he installation of cloudstack-management server. 
# yum install cloudstack-management
6) Type following command to install usage server.
# yum install cloudstack-usage
7) Install MySQL client in management server to establish connection between management server and database server
 #yum install mysql
8)Login to seprate database server using putty and perform following steps 
#yum install mysql-server
9) Login to MySQL database using #MySQL -u root -p and enter following command to provide root privilege to database.
mysql> UPDATE mysql.user SET Grant_priv='Y', Super_priv='Y' WHERE User='root';
mysql>GRANT ALL ON *.* TO 'root'@'';
10) Once the database core configuration finised we can proceed with cloudstack database setup.
# cloudstack-setup-databases cloud:@localhost --deploy-as=root
11) Open the MySQL configuration file. The configuration file     is /etc/my.cnf or /etc/mysql/my.cnf, depending on OS and  Insert the following lines in the [mysqld] section.
binlog-format = 'ROW'
9) Start the MySQL daemon using follwoing command in MySQL server
 #service mysqld start
10) In order to provide security to database server MySQL security configuration need to be enabled 
11) Enable SELINUX and set it with permissive mode 
#vi /etc/selinux/config
 # setenforce permissive
13 )For Xenserver download vhd-util 
#cd /usr/share/cloudstack-common/scripts/vm/hypervisor/xenserver
14) In order to setup the database with cloudstack management server execute following command
15) Once the cloudstack Management server deployed with 3.0 we can upgrade the server by stopping the management service as follows
# Service cloudstack-management stop
# service cloudstack-usage stop
16) Upgrade the management server.
#yum upgrade cloudstack-management
#yum upgrade cloudstack-usage               
17) Start the cloudstack management daemons using following command
# service cloudstack-management start
# service cloudstack-usage start
15) Once the deployment of cloudstack management server daemon completes we will require to mount NFS secondary storage and deploy System VM template for respective hypervisor
Mount NFS:
# mkdir /mnt/secondary
# mount -t nfs  -o vers=3 :/share /mnt/secondary
16) System template configuration
/usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt -m /mnt/secondary -u -h kvm -F
# /usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt -m /mnt/secondary -u -h vmware  -F
• For Hyper-V
# /usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt -m /mnt/secondary -u -h hyperv -F
• For XenServer:
# /usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt -m /mnt/secondary -u -h xenserver -F
 NOTE: If the template is downloaded separately with updated version follwoing command can be used to deploy template from local path 
 #/usr/share/cloudstack-common/scripts/storage/secondary/ cloud-install-sys-tmplt -m /mnt/secondary -f / -h xenserver -F

Following command provides full access to management server to access the system vm template file
#find /mnt/sec/template -type d -exec chmod 777 {} \;
# umount /mnt/secondary

Configuration of cloudstack

               Once the installation of cloudstack completes we can start configuration of cloudstack environment from web console.
Open a browser and type the management server ip address followed by cloudstack port number

  When cloudstack is being configured first time daemon shows follwoing welcome screen for initial configuration setup
Click on I have used cloudstack before, skip this guide. Cloudstack will navigate to follwoing deshboard screen.

Click on Infrastructure Tab to proceed with initial configuration.

Click On Zones View All button and then click on Add Zone button in top right cornor.

New Zone creation Wizard will open. Select Advanced zone.

NOTE: Do not select Security group option. This option will eliminate many of the advanced zone features.
 Enter follwoing details for new zone.
1) Name of the zone
2) DNS ip address for cloud management nodes
3) Internal DNS ip address for cloud virtual machines.
4) Select Xenserver as hypervisor for selected zone for different hypervisor select respective hypervisor (eg. VMware)

5) Enter Network Domain of existing infrastructure.
6) Enter default CIDR network for cloud internal ip addresses

            Leave Dedicated and local storage enabled option unchecked.
Drage the Guest and public traffic to seprate port for management and cloud traffic segrigation.
Click on Edit and edit the network lebal of xenserver network lable in traffic type.

NOTE: above configuration is case sensitive therefore all the characters should be same as xenserver network label charecters.

Enter the Actual LAN ip details with start and end ips for network pool through which cloud private ip will be NATed. Click Next.
Enter the pod name which will be acting as a container for both the clusters.

Reserved system gateway followed by subnet mask is the management traffic gateway and it will be assigned to all system vms
start and end system reserved ip defines the pool of ip which will be assigned to cloud management servers (eg. System VM, virtual router etc.).
Click Next

Cloudstack advanced zone provides software defined network hence each account will be assigned with VLANs and each virtual private cloud will be segregated using their respective VLANS.
Enter the VLAN range for cloudstack virtual private cloud. Click Next

Enter the first xenserver cluster name. Click Next
NOTE: The name is case sensitive

Enter the host name or ip address of master host in selected cluster.
Enter root credentials of master host followed by optional host tag. Click Next

Enter the details of primary storage.
Name is the primary storage name which will be displayed in cloudstack console.
Select the cluster option in Storage menu.
If we are using FC configured storage then select PreSetup option in protocol parameter.
provide the SR Name-Label of primary storage (Case Sensitive)
Click Next.

Cloudstack requires secondary storage to store static instance data such as template, iso, snapshots etc.
Select NFS in provider attribute followed by name of secondary storage.
Enter the nfs share server IP address followed by the share path.
Click Next.

verify the entered parameter for creating zone and click finish.
Once the wizard completed a zone will be created with single cluster.
NOTE: Do not enable the zone after the wizard is completed.
Management Network architecture

Cloud Guest Instance architecture.
After the zone is enabled, cloudstack will create Secondary storage virtual machine (SSVM) and console proxy virtual machine.
To verify the status of both system virtual machine go to Infrastructure->System VMs

After the initial configuration we need to customize few global system variable to customize the cloudstack default behaviour.

Global Settings

Click on the left navigation bar and select global settings.
1) change VM cleanup time:
in the top right side search box type: expunge and change the value of expunge interval and expunge delay to 600 and click on save icon.
->expunge.delay = 600
->expunge.interval = 600

2) ISO liberary http access:
            In order to upload iso and template cloudstack requires HTTP supported web service repository. and to provide access to specific repository modify following global settings parameter.
secstorage.allowed.internal.sites =
3) Allowed rate of Over provisioning configuration:
               Apache best practice is to allow virtual machine to over provision the memory and cpu resources 2 time then original hardware resource.
-> mem.overprovisioning.factor=2

4) virtual machine dynamic scaling:
            In order to configure dynamic scaling of cpu and memory offerings change following parameters.

5) Network Throttling rate configuration
            By default 100 Mbps speed will be allowed to each cloud talent virtual machine to increase the speed to 1000 Mbps modify following parameter.
network.throttling.rate = 1000

Feel free to comment if  advanced configuration details and description required for cloudstack.