Build and Deploy a Private Cloud using OpenNebula Cloud Computing by krabah

VIEWS: 5,030 PAGES: 20

More Info
									Global Open Versity, Cloud Computing Labs                   Building a Private OpenNebula Cloud Computing v.1.2




                             Global Open Versity
                Cloud Computing Hands-on Labs Training Manual

         Build & Deploy a Private cloud using OpenNebula Cloud
                               Computing
                                         Kefa Rabah
                            Global Open Versity, Vancouver Canada
                                     krabah@globalopenversity.org
                                      www.globalopenversity.org


Table of Contents                                                                                  Page No.


BUILD & DEPLOY A PRIVATE CLOUD USING OPENNEBULA CLOUD COMPUTING                                               3

Introduction                                                                                                  3

Hands-On Labs Session                                                                                         3

Part 1: Pre-Requisite                                                                                         4
  Step 1: Check OpenNebula Package                                                                            4
  Step 2: Configure Network Interfaces and Hostnames                                                          4

Part 2: Install OpenNebula Cloud                                                                              5
  Step 1: Front-end installation                                                                              5
  Step 2: install the Cluster Nodes                                                                           5
  Step 3: Copy Oneadmin SSH Keys                                                                              6
  Step 4: Create Directory to Store Images on the Front-End                                                   7
  Step 5: Configuration                                                                                       7
  Step 6: Start & Stop OpenNebula                                                                             9
  Step 7: Sequence for Stopping/Starting OpenNebula Cloud System                                             10
    1. Stopping OpenNebula Cloud System                                                                      10
    2. Starting OpenNebula Cloud System                                                                      10
  Step 8: OpenNebula Users                                                                                   10
    1. Adding and Deleting Users                                                                             11

Part 3: How to launch a VM                                                                                   11
  Step 1: Configure VM                                                                                       11
    1. Create the Virtual Network                                                                            11
    2. Create the Virtual Machine                                                                            13

Part 4: A VM with Context & Network                                                                          15
  1. Step 1: Downloading the pre-configured VM                                                               15
  Step 2: Preparing the Network                                                                              16
  Step 3: Modifying the template                                                                             16
  Step 3: Running the ttylinux VM                                                                            18

Part 5: Need More Training on Windows                                                                        18
  OpenNebula Cloud Computing Training                                                                        18
                                                                                                              1
   April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada

www.globalopenversity.org           VCC301 – Building a Private Cloud using OpenNebula Cloud Computing
Global Open Versity, Cloud Computing Labs                 Building a Private OpenNebula Cloud Computing v.1.2



Linux Administration Training                                                                              19

Part 6: Hands-on Labs Assignments                                                                          19




A GOV Open Access Technical Academic Publications
Enhancing education & empowering people worldwide through eLearning in the 21st Century

                                                                                                            2
   April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada

www.globalopenversity.org        VCC301 – Building a Private Cloud using OpenNebula Cloud Computing
Global Open Versity, Cloud Computing Labs                  Building a Private OpenNebula Cloud Computing v.1.2




                             Global Open Versity
                Cloud Computing Hands-on Labs Training Manual

  Build & Deploy a Private Cloud using OpenNebula Cloud Computing
By Kefa Rabah, krabah@globalopenversity.org                 Aug 05, 2010                      GTI Institute



Introduction
OpenNebula is currently the leading and most advanced framework for cloud computing. It’s extremely
easy to set setup be running. Furthermore, its flexible, extensible and with excellent performance and
scalability to manage tens of thousands of VMs: Private cloud with Xen, KVM and VMware; Hybrid cloud
with Amazon EC2 and ElasticHosts, and other providers through Deltacloud (from ecosystem); Public
cloud supporting EC2 Query, OGF OCCI and vCloud (from ecosystem) APIs,… and much more.

Cloud computing comes into focus only when you think about what IT always needs: a way to increase
capacity or add capabilities on the fly without investing in new infrastructure, training new personnel, or
licensing new software. Cloud computing encompasses any subscription-based or pay-per-use service
that, in real time over the Internet, extends IT's existing capabilities.

Cloud computing is a general term for anything that involves delivering hosted services over the Internet.
These services are broadly divided into three categories: Infrastructure-as-a-Service (IaaS), Platform-as-
a-Service (PaaS) and Software-as-a-Service (SaaS). The name cloud computing was inspired by the
cloud symbol that's often used to represent the Internet in flowcharts and diagrams.

A cloud service has three distinct characteristics that differentiate it from traditional hosting. It is sold on
demand, typically by the minute or the hour; it is elastic -- a user can have as much or as little of a service
as they want at any given time; and the service is fully managed by the provider (the consumer needs
nothing but a personal computer and Internet access). Significant innovations in virtualization and
distributed computing, as well as improved access to high-speed Internet and a weak economy, have
accelerated interest in cloud computing.


Hands-On Labs Session
In this Hands-on manual, you will learn to setup your own private cloud with Ubuntu 10.04 LTS and
OpenNebula . We assume that your infrastructure follows a classical cluster-like architecture, with a front-
end (cluster controller cluster01, and a set of cluster nodes (node01, node02 etc). The entire hands-on
lab was done using VMware, however, you can also use any other virtual machines like MS VirtualPC,
Linux Xen, or VirtualBox from Oracle. Upon completion of this hands-on lab session you should have
gained expertise and skills to plan design implement and deploy your own private cloud using
OpenNebula Cloud computing on Linux Ubuntu 10.04 LTS server.




                                                                                                              3
   April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada

www.globalopenversity.org         VCC301 – Building a Private Cloud using OpenNebula Cloud Computing
Global Open Versity, Cloud Computing Labs                 Building a Private OpenNebula Cloud Computing v.1.2



Assumptions:
1. It’s assumed that you have a good understanding of Linux operating system and its working
   environment. It’s also assumed that you know how to install and configure Ubuntu Linux server, if not
   go ahead and pop over to scribd.com and check out a good hands-on manual entitled “Step-By-Step
   Install Guide Ubuntu 10.04 LTS (Lucid Lynx) Server” to get you started.


Part 1: Pre-Requisite

Step 1: Check OpenNebula Package
1. First you’ll need to check if the OpenNebula packages exist in your Ubuntu distro.

2. If everything is set up correctly you could see the OpenNebula packages:

    $ apt-cache search opennebula
    libopennebula-dev - OpenNebula client library - Development
    libopennebula1 - OpenNebula client library - Runtime
    opennebula - OpenNebula controller
    opennebula-common - OpenNebula common files
    opennebula-node - OpenNebula node

3. If all is OK, then we are good to go!




Step 2: Configure Network Interfaces and Hostnames
On each machine, set network interfaces with static IP address and hostnames.

1. On cluster controller and nodes, set hostname & IP address as follows (change as desired!)

    192.168.83.20           cluster01.govoncloud.com cluster01
    192.168.83.21           node01.govoncloud.com node01
    192.168.83.22           node02.govoncloud.com node02
    ...

2. Ensure you have tested your connectivity between machines using ping command via IP address and
   hostnames, e.g., from cluster01, ping node01 and vise versa:

    krabah@cluster01: ~$ ping 192.168.83.21
    krabah@cluster01: ~$ ping node01.govoncloud.com

3. You’re done with this section.




                                                                                                            4
   April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada

www.globalopenversity.org         VCC301 – Building a Private Cloud using OpenNebula Cloud Computing
Global Open Versity, Cloud Computing Labs                 Building a Private OpenNebula Cloud Computing v.1.2



Part 2: Install OpenNebula Cloud

Step 1: Front-end installation
[Front-end (cluster01)] Install the opennebula package. During installation the apt-get command
performs several configuration steps: creates a oneadmin account, generates a rsa key pair, and starts
the OpenNebula daemon:

1. To install opennebula package, issue the following command:

    $ sudo apt-get install opennebula

    Note: In order to copy SSH keys, the oneadmin user will need to have a password, therefore, issue
    the command set the password:

    sudo passwd oneadmin

2. You’re done with this section.




Step 2: install the Cluster Nodes
1. [Cluster Nodes (node01,node02 etc.)] On each computer install the OpenNebula Node package:

    sudo apt-get install opennebula-node

3. When done you should see the info as shown in Fig. 1.




                                                                          Fig. 1


    Note: In order to copy SSH keys, the oneadmin user will need to have a password. On each machine
    execute:

    sudo passwd oneadmin

2. You’re done with this section.


                                                                                                            5
   April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada

www.globalopenversity.org        VCC301 – Building a Private Cloud using OpenNebula Cloud Computing
Global Open Versity, Cloud Computing Labs                  Building a Private OpenNebula Cloud Computing v.1.2




Step 3: Copy Oneadmin SSH Keys
1. From the Front-End: Now, copy the oneadmin user's SSH key to the Compute Nodes, and to the
   Front-End's authorized_keys file:

sudo scp /var/lib/one/.ssh/id_rsa.pub oneadmin@node01:/var/lib/one/.ssh/authorized_keys
sudo scp /var/lib/one/.ssh/id_rsa.pub oneadmin@node02:/var/lib/one/.ssh/authorized_keys
sudo sh -c "cat /var/lib/one/.ssh/id_rsa.pub >> /var/lib/one/.ssh/authorized_keys"


2. The SSH key for the Computer Nodes needs to be added to the /etc/ssh/ssh_known_hosts file
   on the Front-End host. To accomplish this ssh to each Computer Node as a user other than
   oneadmin:

    For example, let’s ssh to cluster node01 with username krabah, as shown in Fig. 2:

    sudo –u krabah ssh node01




   
								
To top