Sunday, March 29, 2015

Apache Cloudstack Implementation Step by step Part 1 - Hypervisor installation

      I was thinking of  writing a blog about cloudstack implementation for a long time because the documentation does not includes basic and simplified way of implement. I will cover implementation for production environment instead of testing environment and i will try to describe it simple.

   I am writing this blog for beginners who are finding difficulties for selecting and implementing hypervisor hence i am covering hypervisor introduction and implementation in the first part. Selecting hypervisor for Apache cloud stack is quite tricky and i wrote previously which is available here

     In this post i am selecting Opensource  Xenserver 6.2 as hypervisor and Apache cloudstack 4.3 as cloud orchestration

Opensource Xenserver Installation

What is XenServer?

XenServer is a server virtualization platform that offers near bare-metal virtualization performance for virtualized server and client operating systems.
 XenServer runs directly on server hardware without requiring an underlying operating system, which results in an efficient and scalable system. XenServer works by abstracting elements from the physical machine (such as hard drives, resources and ports) and allocating them to the virtual machines running on it.
 Virtual machine (VM) is a computer composed entirely of software that can run its own operating system and applications as if it were a physical computer. A VM behaves exactly like a physical computer and contains its own virtual (software-based) CPU, RAM, hard disk and network interface card (NIC).
XenServer lets you create VMs take VM disk snapshots and manage VM workloads.

 Benefits of Using XenServer

1.     XenServer reduces costs by:
·         Consolidating multiple VMs onto physical servers
  • Reducing the number of separate disk images that need to be managed
  • Allowing for easy integration with existing networking and storage infrastructures
2.     Using XenServer increases flexibility by:
  • Allowing you to schedule zero downtime maintenance by using XenMotion to live migrate VMs between XenServer hosts
  • Increasing availability of VMs by using High Availability to configure policies that restart VMs on another XenServer host if one fails
  • Increasing portability of VM images, as one VM image will work on a range of deployment infrastructures.
·         Role Based Access Control to enable you to control, at both broad and granular levels, which actions different types of administrators can perform in your virtualized environment.
·         Dynamic Memory Control, allowing you to change the amount of physical memory assigned to a virtual machine without rebooting it.
·         VM snapshot management, including support for snapshots with or without memory, and snapshot rollback for a quick backup and restore mechanism.
·         Full virtual machine installation, configuration and lifecycle management.
·         Access to VM consoles: VNC for installation-time, Xvnc for graphical displays on Linux, and Remote Desktop for Windows.
·          XenSearch: searching, sorting, filtering, and grouping, using folders, tags and custom fields.
·          Complete resource pool management.
·          High availability configuration.
·          Active Directory integration, for user authentication and revocation.
·          Workload Balancing, for pool-wide load balancing recommendations.
·          Workload Reports, giving performance views over time and across the datacenter.
·          Performance metrics display (in XenCenter).

System Requirements

XenServer requires at least two separate physical x86 computers: one to be the XenServer host, and the other to run the XenCenter application. The XenServer host machine is dedicated entirely to the task of hosting VMs and is not used for other applications.

XenServer host system requirements

The XenServer host is a 64-bit x86 server-class machine devoted to hosting multiple VMs. This machine runs a optimized and hardened Linux partition with a Xen-enabled kernel which controls the interaction between the virtualized devices seen by VMs and the physical hardware.
XenServer can make use of:

·         Up to 1TB of RAM
·         Up to 16 NICs
·         Up to 160 logical processors

The following are the system requirements for the XenServer host:

Installation process:

Insert the Xenserver CD and reboot the server, it will display a boot menu.

When the installer initially boots, press F2 to access the advanced installation options.
Type shell and press enter. The installer should begin booting into a pre-installation shell where you can make your adjustments.

Once you’ve booted into the pre-installation shell, type vi /opt/xensource/installer/ and press enter.

Change GPT_SUPPORT = True to GPT_SUPPORT = False to disable GPT and use MBR partition tables. Adjust the value of root_size from 4096 (the default) to a larger number to get a bigger root partition.
Once you press enter, you should see the following:
As most of you who have installed many OS’ would be familiar with, we begin by choosing the keymap.
Now we have a standard disclaimer about data loss. Assuming you have backed up your data or are doing an install to a fresh disk (or just don’t care about what’s on there), we hit OK:
Once you have read the EULA, hit Accept EULA:
Here we choose which disk to install to. In a similar way to ESXi, we don’t have the option of software RAID, so here we choose a single disk or available hardware RAID volume. Press space to select a drive:
Since we are using a NFS datastore on the network to store virtual machines, this is OK. Moving on:
 We have the install media here so we will use the Local Media option.
If you have to ask what a Supplemental Pack is, you don’t have one. Select No. If you select Yes and don’t have one don’t worry, it won’t harm anything.
 You can verify your installation media here if you like.

Pick a root password – you will need this for logging in via the console or via the XenServer client on Windows.
 The motherboard we are installing to has two Ethernet ports, both of which are supported by XenServer 6.2. Choose the one you wish to use for the management network – you can change this later.
  Here we get to choose the networkg settings for our mangaement network. This is the IP address used for logging in to manage the XenServer – it’s advisable not to use DHCP, as you’ll waste time trying to find XenServer on the network if your DHCP server changes the IP address. As you can see above we have selected an IP address for a network
  I am not hiding IP details because it in test environment and this IP details helps to understand more in adding network in cloudstack management 
Next we choose the hostname and the DNS server settings – if you’re at home you likely use your gateway IP address.
This one should be easy – pick your country!
Now choose whether to set your time based on an NTP server or on your manual input.
Click Install Xenserver
 You’ll get a progress bar so you can see where the install is up to. Once it has done, if you said you did have supplemental packs you should see during installation process
 If you are not installing the driver packages during installation, then later you can install it after complete installation from command line 
you can chose manual time entry
 Now you should be able to boot into the new install!
 Now  the installation is finished in first server we have to follow this installation for rest of the Xenservers with same ip subnet. after the xenserver installation we have to configure xenserver with appropriate network configuration.  
   Xenserver provides 2 types of back end network  and we are going to use Open vSwitch(OVS) as backed network. In order to configuration OVS go to the command line and type following command
# xe-switch-network-backend openvswitch

Further configuration of Xenserver is included in Part 2