Sunday, September 27, 2015

Relational Database scalability options in cloud

   Web-scale infrastructure gives us the edge of scaling the infrastructure (private or public cloud) and auto scaling of cloud instance shows us the new era of application scalability.  I have mentioned AWS auto scaling in my previous post and few best practice and application architecture requirement for horizontal scaling. Its little bit fuzzy when it come database horizontal scaling.

   Today we have multiple Database as a service options in different private and public cloud options like openstack trove and AWS RDS. Bitter truth is underneath is,  DBaaS is a cloud instance and it also does not solve the scalability issue.

   In order to simplify the description i will provide database scalability options as bellow.
   1) Vertical scaling:
            Scaling of compute and storage resource of master database when database request starts increasing.
             -> advantage: Easy
             -> disadvantage: Its very costly  and everyone will hit the ceiling eventually.

   2) Horizontal scaling (sharding):
          It kind of tricky business when it comes to horizontal scaling and in order to achieve the same. one need to analyze the the scalability requirement based on the application nature.

    Determine the sharding size based on constraints

  • Write IO
  • Read IO
  • Replication limit
  • Tolerance to large nos of systems
  • Budget

   Step 1: analyze the application read and write requirement on each module bases.

Read Replicas
After analysis of above resource requirement we can tell that database is read intensive and we need to horizontally scale by creating more read replica to distribute the read resource load to different database instances

The given solution solves our problem but what about if application is write intensive. can we create a replica to write database?
NO!! Database does not work that way. so now we need to logically segregate different modules to different databases and create their own read replicas.

But now the question is how we can distribute read and write SQL query requests to all these different databases?


Here the application architecture and developer has to work harder to implement the application logic to switch the query to different databases and/or use different database options like MySQL fabric for such cluster management. as described in billow diagram

    Before i conclude the post i have to mention that described architecture option is applicable in both the options (DBaaS and manual database deployment option in cloud instance).

     To make long story short i Horizontal scaling of database is ultimate destination for all the wen-scale applications only the horizontal scaling of DB and application can help us achieve capacity elastic and automated along with availability and resiliency scale.

     I hope the it was a helpful and simplified description. feel free to comment for your any valuable suggestions.

Thursday, July 9, 2015

Private cloud adoption and leadership 2015 Q1

   Just recently the Private cloud adoption research has been released and i thought of writing the technical reason behind that adoption. There are multiple reason behind the adoption of these private cloud, it can be because of stability, the cost, flexibility of hypervisor support, supported features, available support and innovation behind the technology.


 Licensed Cloud:
        VMware is in the leader and it has the highest adoption rate. of cause because the VMware hypervisor adoption rate is also high and now vCAC can manage multiple hypervisor. if i am not wrong then still the downside of vCAC is if you are managing multiple hypervisor the virtual networking (virtual router, Loadbalancer, Firewall, VPN, etc.) can not be implemented  in different hypervisor managed by vCAC. We hope that this limitation will be removed soon by NSX.
 Also Cisco UCS and VMware comes under fulfillment and most promising tool because of their stability and support.

    Adoption of Microsoft CloudOS is less because i bereave that the underneath technology is still young and there are many things are on the way.

Opensource Cloud:
         I love all the opensource stuff and i was surprised when i show Apache Cloudstack is ahead of Openstack despite or recent features addition in Juno. Maybe the reason behind the Cloudstack being more promising and fulfilling with higher adoption ratio is because simpler deployment and recent feature addition in 4.4 and 4.5 version (eg. autoscaling). I am also curious to see the adoption on VMware distribution of openstack adoption in near future.


Saturday, June 27, 2015

VMware Distro of Openstack for production deployment!!! YES

   Previously i mentioned few posts about cloudstack and openstack with fare comparison. I have received multiple request of openstack deployment over cloudstack because of few unique features.

  I am a big fan of VMware and in 2014 VMware announced beta version of VMware integrated openstack. and within a short span of time in 1 year VMware has released production grade Opestack (icehouce) and already tested with 2000 VMs.

 A quick view of Openstack before we start the deployment of openstack.

  -> Nova is a compute component of openstack and it will talk to vCenter and spin-up VMs. Nova will understand vCenter clusters instead of ESXi hosts.
  -> Cinder is a storage component which will talk to block storage (VMDK) and in vmware integrated openstack it will use VMFS file system only. Its also responsible to spin up disk and attach it to VMs.
  -> Glance will provide the image catalog repository or catalog service. It will also talk to shared storage to understand VM and publish as catalog template.
  ->  Neutron provides networking component in openstack, it can integrate with NSX and provides security groups (micro segmentation of security) and it can also integrate with vSphere Distributed switch. I would personally suggest NSX because it will provide security group but for the test we can use DVS.
   In order to deploy Openstack you gonna need separate management cluster for the openstack component deployment and rest of the clusters can be used as compute fleet.

  All these mentioned features are already available in icehouse but VMware integrated openstack provides management and installation of openstack in completely GUI in Web Client as a plugin.
The best thing i love about ova is it will deploy all the openstack component in HA mode with dual components.

    I will try to summaries deployment of openstack in brief. The deployment of VMware integrated openstack is quite straight forward. You can download OVA from here. Once you deploy OVA you will get openstack plugin in VMware web client.
    The OVA will not contain openstack component but its a deployment manager it will deploy memcahce, rabitmq, dhcp agent, database services etc.

         After clicking on Openstack icon you can start deployment of openstack by clicking on Deploy openstack hyperlink.
It will open wizard where you have to enter the vCenter connectivity information.

 Then in the next screen you have to select in which cluster you wants to deploy openstack components.

screenshot taken from Amr Abdelrazik's vmware post

  In the next screen you have to provide two networks one for the users will connect in using horizon dashboard and another one for the management traffic between openstack components and vsphere.

                                                                            screenshot taken from Amr Abdelrazik's vmware post

The next screen will ask for loadbalancer's external IP. This loadbalancer will provide load balancing of openstack's dual components.

 Then in the next screen you can add your compute fleet by adding second cluster (Nova cluster) and as the process follows you can add Cinder storage (VM storage), Glance storage (Template storage).

screenshot taken from Amr Abdelrazik's vmware post

      In the Neutron  network settings we will select VMware VDS and at last openstack admin authentication and syslog server configuration.

  And yes our Openstack deployment is completed. I will be posting the next post soon for the openstack usage instruction also until then happy clouding...

Saturday, April 25, 2015

DNS entry confusion for AWS ELB backed by Cloudfront with SNI

   I was not able to find any interactive and useful article on Internet for DNS entry modification when we use Cloudfront and AWS Elastic load balancer therefore i decided to write little bit about it for new amazonian administrators.

    Hear is the scenario, I have deployed a web-server with an elastic IP address (Public IP) and i have created A Record in GoDaddy for Webserver IP address (A Record: = Everything works well and users can access my website through HTTP port 80.

Now 2 new business requirement has been raised:
   1) Website Communication should be through HTTPS only
   2) Because of high web traffic autoscaling and load balancing need to be implemented
   3) Content delivery should be faster irrespective of user's location/

In order to fulfill above requirement i have created an autoscaling group for webserver with Load balancer .  To implement HTTPS in web traffic i have purchased SSL certificate from GoDaddy with * and installed certificate in Load balancer.

   In order to to provide fast content delivery I have implemented Cloudfront CDN for my web application. and i have configured ELB's DNS as CDN origin.

   Everything seems to be A OK...So whats the issue??
Well  AWS ELB and cloudfront does not provide Public IP address because it has multiple instance running in back end (no IP means no A RECORD). we will get domain name for ELB and cloudfront(ELB domain name:, Cloudfront domain name:

     The issue is we can not create A RECORD in DNS service with domain name we need IP address. so now the solution is we have to create CNAME of cloudfront in Godaddy.

  eg.:CNAME in Godaddy: =

    Now all the Internet users will be directed to CDN edge for faster web content access instead of slow and far webserver.
In order to fulfill 1st requirement (HTTPS communication only) we have to configure default web behavior to redirect HTTP to HTTPS

    Now Every thing seems to be fine....Really!!! NO. Still when i open site ( it shows SSL certificate validation error
   It shows this error because i purchased this certificate for * domain but when i installed this certificate in AWS ELB. ELB gave me its random domain name ( therefore certificate is showing above mentioned error.

  To resolve this issue we have to create one more CNAME for loadbalancer (CNAME: = and then add as origin in Cloudfront settings.

   Now the DNS entry with architecture looks like follows.

Now the flow of user request for as follows for first time request
   1) user request for DNS resolution to DNS server
   2) DNS server response to user
   3) user request to for website request.
   4) cloudfront response to user (SNI) for http ot https redirection.
   5) user request as to cloudfront.
   6) cloudfront will forward HTTPS request to ELB
   7) ELB will convert request from 443 to 80 and forward to Webserver
   8) webserver page response to cloudfront
   9) cloudfront cache will deliver webpage to user.

       Any next requests for the same page will be delivered directly from cloudfront.

Mission completed!!!!!!

Wednesday, April 1, 2015

HPC (Grid Computing) deployment process on AWS cloud

           Few months back i published a post where i mentioned why hpc on cloud. available here since then i  am doing  researching on HPC on cloud. 
       So i am writing this post  and I have found that there are many ways we can deploy HPC on cloud, each deployment can be different and the complexity is based on the platform we choose and the HPC requirement.  

      In my earlier post i have mentioned about IBM softlayer and other cloud service provider but I am focusing on AWS because of the detailed documentation is available for the same.In order to Kickstart with HPC the easiest way is to us automated deployment which everyone loves it.
      MIT has developed easy and powerful script to deploy hpc cluster (grid computing) on aws cloud. StarCluster  is the Simplest way to deploy HPC cluster(grid computing) on AWS Cloud.  You can watch the video for more technical detail.

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.