SlideShare une entreprise Scribd logo
1  sur  86
Télécharger pour lire hors ligne
January 2010, CESGA Santiago de Compostela, Spain




Building Clouds with OpenNebula 1.4

                  Ruben S.Montero
              (rubensm@dacya.ucm.es)
           University Complutense of Madrid
Course Overview
 ●   Day one (January 18th, Moorning)
       ●   Introduction to Cloud Computing (FAST!!!)
       ●   Installing OpenNebula 1.4
       ●   Configure OpenNebula 1.4 (storage, hypervisor and network)
       ●   Administration of an OpenNebula Cloud (hosts, users)
 ●   Day one (January 18th, Afternoon)
       ●   Basic usage (networks, VMs)
       ●   More on usage (VMs, context and scheduling)               Private Cloud
       ●   Configuring an Hybrid Cloud with Amazon EC2               Hybrid Cloud
 ●   Day two (January 19th, Moorning)
       ●   Public Cloud interfaces: The EC2 Query API                Public Cloud

       ●   Advance Topics: Adapt OpenNebula 1.4 to your datacenter




Building Clouds with OpenNebula 1.4                                     Ruben S. Montero
Course Overview
 ●   In this course you will learn to:
       ●   Describe the benefits and characteristics of virtual infrastructures
           and IaaS clouds
       ●   Describe the characteristics and architecture of the different
           clouds that can be deployed with OpenNebula 1.4
       ●   Plan and architect a private cloud
       ●   Design, Use                and   Manage   Virtual   infrastructures   (cloud
           applications)
       ●   Build public and hybrid clouds
       ●   Adapt OpenNebula 1.4 to your datacenter

      This box contains interesting messages


This is a console output, for hands on, checking configuration files...
# This is the root prompt
$ This is oneadmin prompt



Building Clouds with OpenNebula 1.4                                                Ruben S. Montero
January 2010, CESGA Santiago de Compostela, Spain




PART I: Building your Private Cloud

                  Ruben S.Montero
              (rubensm@dacya.ucm.es)
           University Complutense of Madrid
Cloud Computing in a Nutshell
                                               What                         Who
              Software as a Service    On-demand access        End-user
                                       to any application      (does not care about hw or sw)




               Platform as a Service   Platform for building   Developer
                                       and delivering web      (no managing of the underlying hw
                                       applications            & swlayers)




                Infrastructure as a
                Service ᄎ              Delivery of a raw       System Administrator
                                       computer                (complete management of the
                                       infrastructure          computer infrastructure)

 In this course


             Physical Infrastructure


Building Clouds with OpenNebula 1.4                                                 Ruben S. Montero
The IaaS Clouds a Four Point Check List

                    ●
                          Simple Interface
                    ●     Raw Infrastructure Resources
                          ●     Total control of the resources
                          ●    Capacity leased in the form of
                               VMs
                          ●    Complete Service-HW
                               decoupling
                    ●     Pay-as-you-go
                          ●     A single user can not get all the
                               resources
                    ●     Elastic & “infinite” Capacity


Building Clouds with OpenNebula 1.4                                 Ruben S. Montero
The Anatomy of an IaaS Cloud




                                      VM     VM      VM     VM      VM     VM
                      Cloud API
                        (web)              Service               Service

                           Virtual Infrastructure Manager (VIM)

                                           Network

                   Image
                Repositories
                 (Storage)
                                              Physical Infrastructure




Building Clouds with OpenNebula 1.4                                             Ruben S. Montero
Why Virtual Infrastructure Manager
      a Virtual Infrastructure Manager?
 ●
      VMs are great!!...but something more is needed
       ●    Where did/do I put my VM? (scheduling & monitoring)
       ●    How do I provision a new cluster node? (clone & context)
       ●    What MAC addresses are available? (networking)
 ●    Provides a uniform view of the resource pool
 ●    Life-cycle management and monitoring of VM
 ●    The VIM integrates Image, Network and Virtualization


                                 VM          VM           VM           VM


                                          OpenNebula (VIM)

                             hypervisor   hypervisor   hypervisor   hypervisor



Building Clouds with OpenNebula 1.4                                              Ruben S. Montero
Planning the Installation: System Overview

                                           ● Executes the OpenNebula Services
                                           ● Usually acts as a classical cluster front-end




                                                      ● Repository of VM images
                                                      ● Multiple backends (LVM, iSCSI..)




● Modular components to interact
  with the cluster services
● Types:
           storage, monitoring,
  virtualization and network




                                       ● Provides physical resources to VMs
       The same host can be can be a   ● Must have a hypervisor installed
    the front-end and a node

Building Clouds with OpenNebula 1.4                                             Ruben S. Montero
Planning the Installation: Working in the Front-End ...
 ●   Choose your installation mode: system wide (/usr, /etc...) or self-
     contained (under $ONE_LOCATION)
 ●   Install software dependencies
       ●   Runtime (also ssh and openssl)
# apt-get install ruby
# apt-get install sqlite3
# apt-get install libxmlrpc-c3
       ●   Development libraries and tools (only needed to build OpenNebula)
# apt-get install libxmlrpc-c3-dev libsqlite3-dev libssl-dev
# apt-get install g++ scons
# apt-get install ruby-dev rubygems rake

The following will give you a faster XML parser (faster CLI)

# apt-get install libxml-parser-ruby1.8 libxslt1-dev libxml2-dev
# gem install nokogiri

SET SYSTEM LOCALES TO ENGLISH (oneadmin should be enough...)

# cat /etc/default/locale
LANG="en_US.UTF-8"
Building Clouds with OpenNebula 1.4                                    Ruben S. Montero
Planning the Installation: Working in the Front-End ...
 ●     The Users of the private cloud:
        ●   oneadmin: Account to run the daemons, manage the system and do all
            the low-level operations (e.g. start VMs, move images...).
        ●   Users: create and manage their own VMs and networks. Need to be
            defined in OpenNebula
 ●     Installation layout
        ●   We will use the /srv/cloud directory to place the OpenNebula software
        ●   /srv/cloud/one will hold the OpenNebula installation
        ●   /srv/cloud/images will do our image repository in the course
# tree /srv
/srv/
`-- cloud
    |-- images
    `-- one
        |-- SRC

       The oneadmin account must be created system wide (i.e. front-end and all the nodes) you
     can use NIS, or a local account with the same ID's in all the hosts. Users do not need a UNIX
     account in the nodes, nor in the front-end.
Building Clouds with OpenNebula 1.4                                                     Ruben S. Montero
Planning the Installation: Working in the Front-End ...
 ●   Hands on...
# groupadd -g 3000 cloud

# mkdir /srv/cloud
# chmod g+ws cloud /srv/cloud
# mkdir /srv/cloud/images

# useradd -d /srv/cloud/one -g cloud -u 3000 -s /bin/bash -m oneadmin

Create the file-system hierarchy with the oneadmin account

$ id
uid=3000(oneadmin) gid=3000(cloud) grupos=3000(cloud)

$ mkdir /srv/cloud/images
$ mkdir SRC

We will place the OpenNebula source code in SRC




Building Clouds with OpenNebula 1.4                           Ruben S. Montero
Planning the Installation: Working in the Front-End ...
  ●   Preparing the storage for the private cloud...
        ●   Image Repository: Any storage medium for the VM images (usually a
            high performing SAN)
              –   OpenNebula supports multiple back-ends (e.g. LVM for fast cloning)
              –   The front-end must have access to the repository
        ●   VM Directory: The home of the VM in the cluster node
              –   Stores checkpoints, description files and VM disks
              –   Actual operations over the VM directory depends on the storage medium
              –   Should be shared for live-migrations
              –   You can go on without a shared FS and use the SSH back-end
              –   Defaults to $ONE_LOCATION/var/$VM_ID



     Dimensioning the Storage... Example: A 64 core cluster will typically run around 80VMs,
  each VM will require an average of 10GB of disk space. So you will need ~800GB for
  /srv/cloud/one, you will also want to store 10-15 master images so ~200GB for
  /srv/cloud/images. A 1TB /srv/cloud will be enough for this example setup.

Building Clouds with OpenNebula 1.4                                                Ruben S. Montero
Planning the Installation: Working in the Front-End ...
   ●   In this course we will use NFS to share the VM directories
   ●   The Image Repository is /srv/cloud/images




Building Clouds with OpenNebula 1.4                                 Ruben S. Montero
Planning the Installation: Working in the Front-End ...
 ●   Hands on...

# apt-get install nfs-kernel-server

Export /srv/cloud to your nodes
  - only need /srv/cloud/one/var
  - we also export $HOME of oneadmin for easy SSH key configuration
  - No really need to export /srv/cloud/images

# vi more /etc/exports
/srv/cloud 84.21.XX.YY(rw,async,no_subtree_check,no_root_squash)

# /etc/init.d/nfs-kernel-server stop
# /etc/init.d/nfs-kernel-server start




Building Clouds with OpenNebula 1.4                           Ruben S. Montero
Planning the Installation: Working in the Front-End ...
 ●   Networking for the private cloud
       ●   OpenNebula management operations uses a ssh
           connections, it does not require a performing NIC
       ●   Image traffic, may require the movement of heavy
           files (VM images, checkpoints). Dedicated storage
           links may be a good idea
       ●   VM demands, consider the typical requirements of
           your VMs. Several NICs to support the VM traffic
           may be a good idea
       ●   OpenNebula relies on bridge networking for the
           VMs




Building Clouds with OpenNebula 1.4                            Ruben S. Montero
Planning the Installation: Working in the Nodes ...
 ●   Install software dependencies
       ●   We need SSH daemon running in the cluster nodes (check it!)
       ●   Runtime dependencies:
# apt-get install ruby
 ●   Users
       ●   Create the oneadmin account (use same UID and GID)
# groupadd -g 3000 cloud
# useradd -d /srv/cloud/one -g cloud -u 3000 -s /bin/bash oneadmin

 ●   Storage
       ●   Recreate the installation layout and configure NFS to mount the VM dirs
# mkdir /srv/cloud
# chmod g+ws cloud /srv/cloud

# apt-get install nfs-common
# vi /etc/fstab
x.y.z.w:/srv/cloud /srv/cloud nfs soft,intr,rsize=32768,wsize=32768,rw
0 0
Building Clouds with OpenNebula 1.4                                      Ruben S. Montero
Planning the Installation: SSH Configuration
 ●    Enable password-less SSH access to cluster nodes for the
      oneadmin account:
DO NOT PROTECT PRIVATE KEY WITH A PASSWORD
$ ssh-keygen
Generating public/private rsa key pair.
...
Enter passphrase (empty for no passphrase):
Enter same passphrase again:

$ cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys

Tell ssh client not to ask to add hosts to known_hosts (optional)

$ cat /srv/cloud/one/.ssh/config
Host *
    StrictHostKeyChecking no

TEST!
$ ssh localhost
$ ssh 84.21.xx.yy


       You may need to exchange keys with the nodes (not here as we share /srv/cloud/one the
     oneadmin home, and so the ~/.ssh directory
Building Clouds with OpenNebula 1.4                                                Ruben S. Montero
Planning the Installation: The Hypervisor ...
 ●   Installing the Hypervisor
       ●   OpenNebula supports KVM, Xen and Vmware (even simultaneously).
           This course applies to KVM and Xen
       ●   Refer to the hypervisor documentation for additional (and better
           information) on setting up them.
 ●   Setting up KVM and libvirt (Ubuntu Karmic)
       ●   Install the packages

#apt-get install qemu libvirt-bin kvm

       ●   The network set up in this course
                                                                peth0, the physical NIC

                                      Physical Host     eth0 (bridge)
                                                        eth0 (bridge)
                                                         84.21.xx.yy
                                                         84.21.xx.yy


                                            VM
                                             VM                              VM
                                                                              VM
                                       192.168.170.xx
                                       192.168.170.xx                   192.168.169.xx
                                                                        192.168.169.xx

Building Clouds with OpenNebula 1.4                                                       Ruben S. Montero
Planning the Installation: The Hypervisor ...
 ●   Hands on...
Remove the default bridge in Ubuntu
#rm /etc/libvirt/qemu/networks/autostart/default.xml
#ifconfig virbr0 down
#brctl delbr virbr0

Set up the network for the course (equivalent to a Xen setup)
  - bridge.sh will create the bridge at boot time (see next slide)
  - Execute it in the libvirt-bin start script

#vim /etc/libvirt/bridge.sh
#chmod +x /etc/libvirt/bridge.sh

#vi /etc/init.d/libvirt-bin
...
case "$1" in
  start)
         if check_start_libvirtd_option; then
                 log_daemon_msg "Starting $DESC" "$NAME"
                 /etc/libvirt/set_up_bridge.sh
...




Building Clouds with OpenNebula 1.4                           Ruben S. Montero
Planning the Installation: The Hypervisor ...
#!/bin/sh
create_bridge () {
  ip link show p$1 > /dev/null 2>&1
  if [ $? -ne 0 ] ; then
    ifdown $1

         ip   link     set     $1 down
         ip   link     set     $1 name p$1
         ip   link     set     promisc on dev p$1
         ip   addr     add     0.0.0.0 dev p$1

         brctl addbr $1
         brctl stp $1 off
         brctl addif $1 p$1

         ip link set dev p$1 up
         ip link set dev $1 up

         echo "1" > /proc/sys/net/ipv4/ip_forward
    fi
}

create_bridge eth0
route del -net 84.21.xx.0/24 dev peth0
ifup eth0
Building Clouds with OpenNebula 1.4                 Ruben S. Montero
Planning the Installation: The Hypervisor ...
 ●   Check the network configuration
root@formiga-5:/srv# ifconfig
eth0      Link encap:Ethernet HWaddr 00:1e:4f:e0:5e:9f
...
lo        Link encap:Bucle local
...
peth0     Link encap:Ethernet HWaddr 00:1e:4f:e0:5e:9f
...
# brctl show
bridge name     bridge id              STP enabled     interfaces
eth0            8000.001e4fe05e9f      no              peth0


 ●   Add oneadmin to the libvirt group
# usermod -G kvm,libvirtd oneadmin

 ●   Test the installation for the oneadmin account
$ virsh list
Connecting to uri: qemu:///system
 Id Name               State
----------------------------------


Building Clouds with OpenNebula 1.4                          Ruben S. Montero
Planning the Installation: Checklist




Building Clouds with OpenNebula 1.4      Ruben S. Montero
Installing OpenNebula 1.4
 ●   Grab the source code and compile it!
~/SRC$ wget http://dev.opennebula.org/attachments/download/103/one-
1.4.0.tar.gz
~/SRC$ tar xzvf one-1.4.0.tar.gz
~/SRC$ cd one-1.4/
~/SRC$ scons

 ●   Install the software in /srv/cloud/one (ONE_LOCATION)
$ export ONE_LOCATION=/srv/cloud/one/
$ ./install.sh -d $ONE_LOCATION

Check install.sh -h for other options


 ●   Check and explore the installation tree
~$ ls -F
bin/ etc/              examples.desktop   include/   lib/   share/   SRC/   var/




Building Clouds with OpenNebula 1.4                                           Ruben S. Montero
Configuring OpenNebula: The configuration interface
                                      ● $ONE_LOCATION/etc/oned.conf
                                      ● General configuration

                                      ● Defines the drivers used in the private cloud




                                                            ● Match-making scheduler (default)
                                                            ● Placement policies configured per VM




                                                       $ONE_LOCATION/etc/im_*/im_*.conf
                                                       ●

                                                     ● Defines monitoring probes


                ● $ONE_LOCATION/etc/vmm_*/vmm_*.conf

                ● Defaults values for the hypervisor




                                                ● $ONE_LOCATION/etc/tm_*/tm_*.conf
                                                ● Defines action for generic storage operations




Building Clouds with OpenNebula 1.4                                                      Ruben S. Montero
Configuring OpenNebula: The oned.conf file
 ●   General configuration attributes
       ●   Monitoring intervals, HOST_MONITORING_INTERVAL
           VM_POLLING_INTERVAL
       ●   VM_DIR: Path to the VM directory for all the cluster nodes.
       ●   Network parameters, MAC_PREFIX, NETWORK_SIZE
       ●   PORT : Port where oned will listen for xml-rpc calls
       ●   DEBUG_LEVEL

HOST_MONITORING_INTERVAL = 60
VM_POLLING_INTERVAL      = 60

#VM_DIR                  = /srv/cloud/one/var

MAC_PREFIX   = "00:01"
NETWORK_SIZE = 254

PORT                     = 2633
DEBUG_LEVEL              = 3



Building Clouds with OpenNebula 1.4                                      Ruben S. Montero
Configuring OpenNebula: The oned.conf file
 ●   Information Drivers, to monitor cluster nodes
       ●   name: identifies the driver
       ●   executable: absolute or relative to $ONE_LOCATION/lib/mads
       ●   arguments: a probe configuration file
IM_MAD = [
      name       = "im_kvm",
      executable = "one_im_ssh",
      arguments = "im_kvm/im_kvm.conf" ]

 ●   Transfer Drivers, to interface with the storage
       ●   name: identifies the driver
       ●   executable: path to driver executable
       ●   arguments: storage commands configuration file
TM_MAD = [
    name       = "tm_nfs",
    executable = "one_tm",
    arguments = "tm_nfs/tm_nfs.conf" ]

Building Clouds with OpenNebula 1.4                              Ruben S. Montero
Configuring OpenNebula: The oned.conf file
 ●   Virtualization Drivers, to interface the hypervisors
       ●   name: identifies the driver
       ●   executable: absolute or relative to $ONE_LOCATION/lib/mads
       ●   arguments: (not needed for the distribution drivers)
       ●   default: default values for the hypervisor
       ●   type: format of the VM description file to be passed to the driver: xen, kvm
           or xml

VM_MAD = [
    name                     =   "vmm_kvm",
    executable               =   "one_vmm_kvm",
    default                  =   "vmm_kvm/vmm_kvm.conf",
    type                     =   "kvm" ]


 ●   Hooks, custom programs that are executed on specific events, e.g. VM
     creation.
 ●   Hands on... Check and adjust the values of oned.conf for your cloud
Building Clouds with OpenNebula 1.4                                         Ruben S. Montero
Configuring OpenNebula: Accounts
 ●   Accounts in OpenNebula
       ●   oneadmin, has enough privileges to perform any operation on any
           object. It is created the first time OpenNebula is started using the
           ONE_AUTH data
       ●   Regular user accounts must be created by oneadmin and they can only
           manage their own objects.
 ●   Configuring the oneadmin account
       ●   Environment variables: ONE_AUTH, ONE_LOCATION and ONE_XMLRPC
$ tail        .bashrc
export        ONE_LOCATION=/srv/cloud/one
export        ONE_AUTH=$HOME/.one/one_auth
export        PATH=$PATH:$ONE_LOCATION/bin

       ●   Create the password file
$ mkdir .one
$ cd .one
$ cat one_auth
oneadmin:onecloud

Building Clouds with OpenNebula 1.4                                        Ruben S. Montero
Configuring OpenNebula: Start & Stop
 ●    Use the one script
$ source .bashrc
$ echo $ONE_AUTH
/srv/cloud/one/.one/one_auth

$one start
oned and scheduler started

$ more $ONE_LOCATION/var/oned.log
Thu Jan 14 18:03:11 2010 [ONE][I]:               Init OpenNebula Log system
Thu Jan 14 18:03:11 2010 [ONE][I]:               Log Level: 3
[0=ERROR,1=WARNING,2=INFO,3=DEBUG]
Thu Jan 14 18:03:11 2010 [ONE][I]:               ------------------------------------
Thu Jan 14 18:03:11 2010 [ONE][I]:                    OpenNebula Configuration File
Thu Jan 14 18:03:11 2010 [ONE][I]:               ------------------------------------




        Be sure to configure the oneadmin account (specially, create the ONE_AUTH file) before
     starting OpenNebula for the first time.
Building Clouds with OpenNebula 1.4                                                  Ruben S. Montero
Configuring OpenNebula: Hosts
 ●   Cluster nodes are defined with
       ●   Hostname of the cluster node or IP
       ●   Information Driver to be used to monitor the host
       ●   Storage Driver to clone, delete, move or copy images into the host
       ●   Virtualization Driver to boot, stop, resume VMs in the host
 ●   Cluster nodes are managed with the onehost utility
       ●   Create & delete hosts
       ●   List the hosts in the cluster
       ●   Show detailed information from a host
       ●   Enable/Disable a host




Building Clouds with OpenNebula 1.4                                      Ruben S. Montero
Configuring OpenNebula: Hosts
 ●   Hands on... configure the hosts of your private cloud
$ onehost create 84.21.xx.yy im_kvm vmm_kvm tm_nfs
$ onehost create 84.21.xx.yy im_kvm vmm_kvm tm_nfs

$ onehost list
  ID NAME                             RVM   TCPU   FCPU   ACPU    TMEM    FMEM STAT
   0 84.21.xx.yy                        0      0      0    100       0       0   on
   1 84.21.xx.zz                        0      0      0    100       0       0   on

$ tail -f $ONE_LOCATION/var/oned.log
Thu Jan 14 18:07:39 2010 [InM][I]: Monitoring host 84.21.xx.yy (0)
Thu Jan 14 18:07:39 2010 [InM][I]: Monitoring host 84.21.xx.zz (1)
Thu Jan 14 18:07:43 2010 [InM][D]: Host 0 successfully monitored.
Thu Jan 14 18:07:44 2010 [InM][D]: Host 1 successfully monitored.

$ onehost list
  ID NAME                             RVM   TCPU   FCPU   ACPU    TMEM    FMEM STAT
   0 84.21.xx.yy                        0    200    184    184 2017004 1848172   on
   1 84.21.yy.zz                        0    200    200    200 2017004 1857172   on

$ onehost show 0


 ●   Hands on... Explore and test the onehost command in your cloud
Building Clouds with OpenNebula 1.4                                        Ruben S. Montero
Configuring OpenNebula: Users
 ●   Users are defined within OpenNebula by:
       ●   ID unique identifier for the user
       ●   Name of the user, used for authentication
       ●   Password used for authentication
 ●   Users are managed with the oneuser utility
       ●   Create & delete users
       ●   List the users in the cluster
 ●   Hands on... create new users in your private cloud and configure the
     “user” UNIX account
$ oneuser create helen mypass
User “Helen” should put helen:mypass in $ONE_AUTH

$ oneuser list
 UID NAME      PASSWORD                                          ENABLE
   0 oneadmin c24783ba96a35464632a624d9f829136edc0175e             True
   2 helen     34a91f713808846ade4a71577dc7963631ebae14            True

$ oneuser delete helen

Building Clouds with OpenNebula 1.4                              Ruben S. Montero
Configuring OpenNebula: Log Files
 ●   The operations of the OpenNebula daemon and scheduler are
     logged in:
       ●   oned: $ONE_LOCATION/var/oned.log, Its verbosity is set by
           DEBUG_LEVEL in $ONE_LOCATION/etc/oned.conf.
       ●   Scheduler (mm_sched): All the scheduler information is collected
           into the $ONE_LOCATION/var/sched.log file.
 ●   VM logs and files are in $ONE_LOCATION/var/<VM_ID>,
     more in a few slides...
 ●   Drivers can activate ONE_MAD_DEBUG in the associated RC file
     (or in $ONE_LOCATION/etc/defaultrc)




Building Clouds with OpenNebula 1.4                                      Ruben S. Montero
January 2010, CESGA Santiago de Compostela, Spain




  PART II: Using your Private Cloud

                  Ruben S.Montero
              (rubensm@dacya.ucm.es)
           University Complutense of Madrid
Using the Private Cloud: Virtual Networks
 ●   A Virtual Network in OpenNebula
       ●   Defines a separated MAC/IP address space to be used by VMs
       ●   Each virtual network is associated with a physical network through
           a bridge
       ●   Virtual Networks can be isolated (at layer 2 level) with ebtables
           and hooks
 ●   Virtual Network definition
       ●   Name, of the network
       ●   Type
             –   Fixed, a set of IP/MAC leases
             –   Ranged, defines a network range
       ●   Bridge, name of the physical bridge in the physical host where
           the VM should connect its network interface.
 ●   Virtual Networks are managed with the onevnet utility
       Networks created by oneadmin are public, i.e. can be used by VMs of any other user

Building Clouds with OpenNebula 1.4                                                  Ruben S. Montero
Using the Private Cloud: Virtual Networks
 ●   Hands on...
$ vi red.net
NAME = "Red LAN"
TYPE = RANGED
BRIDGE = eth0
NETWORK_SIZE     = C
NETWORK_ADDRESS = 192.168.169.0

$ vi blue.net
NAME = "Blue LAN"
TYPE = FIXED
BRIDGE = eth0
LEASES = [IP=192.168.170.5]
LEASES = [IP=192.168.170.10]
LEASES = [IP=192.168.170.15]
LEASES = [IP=192.168.170.20]
LEASES = [IP=192.168.170.25]

$ onevnet -v create blue.net
$ onevnet -v create red.net


 ●   Hands on... explore the use of onevnet list, show, delete

Building Clouds with OpenNebula 1.4                              Ruben S. Montero
Using the Private Cloud: Virtual Networks
 ●   Using a Virtual Network with your VMs
       ●   Define NICs attached to a given virtual network. The VM will get a
           NIC with a free MAC in the network and attached to the
           corresponding bridge
#A VM with two interfaces each one in a different vlan
NIC=[NETWORK="Blue LAN"]
NIC=[NETWORK="Red LAN"]

#Ask for a specific IP/MAC of the Red vlan
NIC=[NETWORK="Red LAN", IP=192.168.0.3]

       ●   Prepare the VM to use the IP. Sample scripts to set the IP based
           on the MAC are provided for several Linux distributions.
                                      IP-MAC address correspondence

                                      I P:               10. 0. 1. 2

                                      MAC: 02: 01: 0A: 00: 01: 02

                                             oned.conf      IP Address

Building Clouds with OpenNebula 1.4                                       Ruben S. Montero
Using the Private Cloud: Virtual Machines
 ●   Preparing a VM to be used with OpenNebula
       ●   You can use any VM prepared for the target hypervisor
       ●   Hint I: Place the vmcontext.sh script in the boot process to make
           better use of vlans
       ●   Hint II: Do not pack useless information in the VM images:
             –   swap. OpenNebula can create swap partitions on-the-fly in the target
                 host
             –   Scratch or volatile storage. OpenNebula can create plain FS on-the-
                 fly in the target host
       ●   Hint III: Install once and deploy many; prepare master images
       ●   Hint IV: Do not put private information (e.g. ssh keys) in the
           master images, use the CONTEXT
       ●   Hint V: Pass arbitrary data to a master image using CONTEXT




Building Clouds with OpenNebula 1.4                                              Ruben S. Montero
Using the Private Cloud: Virtual Machines
 ●   Virtual Machine Life-cycle




Building Clouds with OpenNebula 1.4           Ruben S. Montero
Using the Private Cloud: Virtual Machines
 ●   A Virtual Machine in OpenNebula
       ●   A capacity in terms memory and CPU
       ●   A set of NICs attached to one or more virtual networks
       ●   A set of disk images, to be “transfered” to/from the execution host.
       ●   A state file (optional) or recovery file, with the memory image of a
           running VM plus some hypervisor specific information.
 ●   Virutal Machines are defined in a VM template
 ●   Each VM has an unique ID in OpenNebula the VM_ID
 ●   All the files (logs, images, state files...) are stored in
     $ONE_LOCATION/var/<VM_ID>




Building Clouds with OpenNebula 1.4                                         Ruben S. Montero
Using the Private Cloud: Virtual Machines
 ●   Virtual Machine Definition File (VM templates)
#---------------------------------------
# Name of the VM
#---------------------------------------
NAME = "vm-example" # Optional, Default: one-$VMID

#---------------------------------------
#               Capacity
#---------------------------------------
CPU    = "amount_of_requested_CPU"
MEMORY = "amount_of_requested_MEM"
VCPU   = "number of virtual cpus"

#---------------------------------------
#         OS and boot options
#---------------------------------------
OS = [
  kernel     = "path_to_os_kernel",      # para-virtualization
  initrd     = "path_to_initrd_image", # para-virtualization
  kernel_cmd = "kernel_command_line",
  root       = "device to be mounted as root"
  bootloader = "path to the boot loader exec”
  boot       = "device to boot from" ]


Building Clouds with OpenNebula 1.4                              Ruben S. Montero
Using the Private Cloud: Virtual Machines
 ●   Virtual Machine Definition File (VM templates)
#---------------------------------------
#      Features of the hypervisor
#---------------------------------------

FEATURES = [
  pae = "yes|no",                     # Optional, KVM
  acpi = "yes|no" ]                   # Optional, KVM

#---------------------------------------
#                VM Disks
#---------------------------------------

DISK = [
  type               =   "floppy|disk|cdrom|swap|fs|block",
  source             =   "path_to_disk_image_file|physical_dev",
  format             =   “type for fs disks”,
  size               =   "size_in_GB",
  target             =   "device_to_map_disk",
  bus                =   "ide|scsi|virtio|xen",
  readonly           =   "yes|no",
  clone              =   "yes|no",
  save               =   "yes|no" ]


Building Clouds with OpenNebula 1.4                                Ruben S. Montero
Using the Private Cloud: Virtual Machines
 ●   Virtual Machine Definition File (VM templates)
#---------------------------------------
#           Network Interfaces
#---------------------------------------

NIC = [
  network          =   "name_of_the_virtual_network",
  ip               =   "ip_address",
  bridge           =   "name_of_bridge_to_bind_if",
  target           =   "device_name_to_map_if",
  mac              =   "HW_address",
  script           =   "path_to_script_to_bring_up_if",
  Model            =   "NIC model"]

#---------------------------------------
# I/O Interfaces
#---------------------------------------

INPUT = [
  type = "mouse|tablet",
  bus = "usb|ps2|xen" ]




Building Clouds with OpenNebula 1.4                       Ruben S. Montero
Using the Private Cloud: Virtual Machines
 ●    Virtual Machine Definition File (VM templates)
#---------------------------------------
# I/O Interfaces
#---------------------------------------

GRAPHICS         =   [
  type           =   "vnc|sdl",
  listen         =   "IP-to-listen-on",
  port           =   "port_for_VNC_server",
  passwd         =   "passwor_for_VNC_server" ]

#---------------------------------------
# Raw Hypervisor attributes
#---------------------------------------

RAW = [
  type = "xen|kvm",
  data = "raw_domain_configutarion"]



        Not all the parameters are supported for each hypervisor. Complete reference and
     examples for all sections in
     http://www.opennebula.org/doku.php?id=documentation:rel1.4:template

Building Clouds with OpenNebula 1.4                                             Ruben S. Montero
Using the Private Cloud: Virtual Machines
 ●   Hands on... define a ttylinux VM
NAME   = ttylinux
CPU    = 0.1
MEMORY = 64

DISK   = [
  source   = "/srv/cloud/images/ttylinux/ttylinux.img",
  target   = "hda",
  readonly = "no" ]

NIC              = [ NETWORK = "Red LAN" ]

FEATURES = [ acpi="no" ]

#This may be useful to debug your VMs (can use also console)

GRAPHICS = [
  type = "vnc",
  listen = "loclahost",
  port = "5902",
  keymap="es"]




Building Clouds with OpenNebula 1.4                            Ruben S. Montero
Using the Private Cloud: Virtual Machines
 ●   Fix the apparmor libvirt issue for the cluster nodes (bug in 9.10)

# tail /etc/apparmor.d/abstractions/libvirt-qemu
  # https://launchpad.net/bugs/457716
  #include <abstractions/private-files-strict>
  owner @{HOME}/ r,
  owner @{HOME}/** rw,
  /srv/cloud/one/var/** rw,

# /etc/init.d/apparmor restart




Building Clouds with OpenNebula 1.4                                 Ruben S. Montero
Using the Private Cloud: Virtual Machines
 ●   Virtual Machines are managed with the onevm utility
       ●   Operations: create, deploy shutdown, livemigrate, stop, cancel,
           resume, suspend, delete, restart
       ●   Information: list, show, top, history
$ onevm create ttylinux.one

$ onevm list
  ID     USER    NAME STAT CPU                 MEM       HOSTNAME          TIME
  1 oneadmin ttylinux pend   0                   0                  00 00:00:28

$ onevm top


 ●   Hands on...
       ●   Create a couple of VMs and check virtual network usage (onevnet)
       ●   Try control operations with the VMs stop, shutdown, migrate, resume...
       ●   Modify the template
             –   Add one more NIC for the Blue network
             –   Add another DISK for VM data (type=”fs”, format=”ext2”)
Building Clouds with OpenNebula 1.4
 ●                                                                           Ruben S. Montero
Using the Private Cloud: Virtual Machines
 ●   Context contains data to be passed to the VM at boot time




#---------------------------------------
# Context for the VM
#    values can be:
#    $<template_variable>
#    $<template_variable>[<attribute>]
#    $<template_variable>[<attribute>, <attribute2>=<value2>]
#    $<vm_id>.<context_var>
#---------------------------------------
CONTEXT = [
  var_1 = "value_1",#Will be in context.sh as var_1=”val_1” (sh syntax)
  var_n = "value_n",#Will be in context.sh as var_N=”val_N” (sh syntax)
  files = "space-separated list of paths to include in context device",
  target= "device to attach the context device" ]
Building Clouds with OpenNebula 1.4                              Ruben S. Montero
Using the Private Cloud: Virtual Machines
 ●   Hands on... Add custom ssh keys the VM image
       ●   Check boot process of the ttylinux VM (systemrc.local) it will
             –   mount iso (do it yourself and see the ISO layout...)
             –   Source context.sh
             –   In this example it will execute init.sh so you can try anything
CONTEXT = [
    files      = "/srv/cloud/images/ttylinux/init.sh
/srv/cloud/one/.ssh/id_rsa.pub",
    target      = "hdc",
    root_pubkey = "id_rsa.pub"
]

$ more init.sh
#!/bin/bash
if [ -f /mnt/context/context.sh ]
then
   . /mnt/context/context.sh
fi
if [ -f /mnt/context/$ROOT_PUBKEY ]; then
         cat /mnt/context/$ROOT_PUBKEY >> /root/.ssh/authorized_keys
fi

Building Clouds with OpenNebula 1.4                                                Ruben S. Montero
Using the Private Cloud: Virtual Machines
 ●   Tunning the placement of VMs with the Match-making scheduler
       ●   First those hosts that do not meet the VM requirements are filtered
           out (REQUIREMENTS)
       ●   RANK is evaluated for the remaining hosts
       ●   That with the highest RANK is used for the VM
 ●   Placement policies are specified per VM

#---------------------------------------
#           Scheduler
#---------------------------------------
# Use Host Monitor attributes
REQUIREMENTS = "Bool_expression_for_reqs"
RANK         = "Arith_expression_to_rank_hosts"

 ●   Hands on... try a simple VM pinning
REQUIREMENTS = "HOSTNAME=”...”"

 ●   Hands on... try a simple load-aware policy
RANK = FREECPU
Building Clouds with OpenNebula 1.4                                       Ruben S. Montero
January 2010, CESGA Santiago de Compostela, Spain




PART III: Using External Cloud Providers
             (Hybrid Cloud)

                   Ruben S.Montero
               (rubensm@dacya.ucm.es)
            University Complutense of Madrid
Hybrid Cloud Computing: Overview
 ● VMs can be local or remote
 ● VM connectivity has to be configured, usually VPNs




     ● External Clouds are like any other host
     ● Placement constraints




Building Clouds with OpenNebula 1.4                     Ruben S. Montero
Installing the Hybrid Cloud Components
 ●   OpenNebula distribution includes drivers to build hybrid clouds with
     Amazon EC2 and Elastic Hosts
 ●   Additional requirements: EC2 libraries and tools
# apt-get install ec2-api-tools ec2-ami-tools

 ●   Hands on... try the EC2 tools (ec2-*)
$ export EC2_PRIVATE_KEY=/srv/cloud/one/ec2/pk.pem

$ export EC2_CERT=/srv/cloud/one/ec2/cert.pem

$ ec2-describe-images
IMAGE   ami-0742a66e    /rubensm-
amis.s3.amazonaws.com/image.manifest.xml       418314910487
available       private          i386    machine
IMAGE   ami-e142a688    rubensm-
amis.s3.amazonaws.com/image.manifest.xml         418314910487
available       private          i386    machine




Building Clouds with OpenNebula 1.4                                Ruben S. Montero
Configuring the EC2 Hybrid Cloud Driver
 ●   Hands on... Add the following drivers to oned.conf
IM_MAD = [
  name       = "im_ec2",
  executable = "one_im_ec2",
  arguments = "im_ec2/im_ec2.conf" ] # No. of instances of each type

VM_MAD = [
  name                   =   "vmm_ec2",
  executable             =   "one_vmm_ec2",
  arguments              =   "vmm_ec2/vmm_ec2.conf", # Defaults, e.g. keypair
  type                   =   "xml" ]

TM_MAD = [ #No actual transfers are made by OpenNebula to EC2
    name       = "tm_dummy",
    executable = "one_tm",
    arguments = "tm_dummy/tm_dummy.conf" ]



 ●   Hands on... Check the values of the driver configurations files



Building Clouds with OpenNebula 1.4                                         Ruben S. Montero
Configuring the EC2 Hybrid Cloud Driver
 ●   Configure the account to be used with Amazon EC2

$ vim $ONE_LOCATION/etc/vmm_ec2/vmm_ec2rc
#----------------------------------------------------------------------
# EC2 API TOOLS Configuration.
#----------------------------------------------------------------------
EC2_HOME=/usr
EC2_PRIVATE_KEY="/srv/cloud/one/ec2/pk.pem"
EC2_CERT="/srv/cloud/one/ec2/cert.pem"


 ●   Restart the OpenNebula daemon, and check that the new drivers are
     loaded
$ one stop; one start
$ more $ONE_LOCATION/var/oned.log
Fri Jan 15 18:16:46 2010 [VMM][I]: Loading Virtual Machine Manager driv
Fri Jan 15 18:16:46 2010 [VMM][I]:      Loading driver: vmm_kvm (KVM)
Fri Jan 15 18:16:47 2010 [VMM][I]:      Driver vmm_kvm loaded.
Fri Jan 15 18:16:47 2010 [VMM][I]:      Loading driver: vmm_ec2 (XML)
Fri Jan 15 00:16:47 2010 [InM][I]: Loading Information Manager drivers.
Fri Jan 15 00:16:47 2010 [InM][I]:      Loading driver: im_kvm
Fri Jan 15 00:16:47 2010 [InM][I]:      Driver im_kvm loaded
Fri Jan 15 00:16:47 2010 [InM][I]:      Loading driver: im_ec2
Building Clouds with OpenNebula 1.4                           Ruben S. Montero
Configuring the EC2 Hybrid Cloud Driver
 ●   Amazon EC2 cloud is manage by OpenNebula as any other cluster
     node
       ●   You can use several accounts by adding a driver for each account (use
           the arguments attribute, -k and -c options). Then create a host that uses
           the driver
       ●   You can use multiple EC2 zones, add a driver for each zone (use the
           arguments attribute, -u option), and a host that uses that driver
       ●   You can limit the use of EC2 instances by modifying the IM file
 ●   Hands on... Create your EC2 hybrid cloud by adding a new host
$ onehost create ec2 im_ec2 vmm_ec2 tm_dummy

$ onehost list
  ID NAME                             RVM   TCPU   FCPU   ACPU    TMEM    FMEM STAT
   0 84.21.x.y                          0    200    200    200 2017004 1667080   on
   1 84.21.x.z                          1    200    200    200 2017004 1681676   on
   2 ec2                                0    500    500    500 8912896 8912896   on




Building Clouds with OpenNebula 1.4                                          Ruben S. Montero
Using the EC2 Hybrid Cloud
 ●   Virtual Machines can be instantiated locally or in EC2
       ●   The template must provide a description for both instantiation
           methods.
       ●   The EC2 counterpart of your VM (AMI_ID) must be available for
           the driver account
       ●   The EC2 VM template attribute:
EC2 = [
  AMI                                 =   "ami_id for this VM",
  KEYPAIR                             =   "the keypair to use the instance",
  AUTHORIZED_PORTS                    =   "ports to access the instance",
  INSTANCETYPE                        =   "m1.small...",
  ELASTICIP                           =   "the elastic ip for this instance",
  CLOUD                               =   "host (EC2 cloud) to use this description with"
]




Building Clouds with OpenNebula 1.4                                                Ruben S. Montero
Using the EC2 Hybrid Cloud
 ●   Hands on... Add an EC2 counterpart to the ttylinux image
$vi ttylinux.one
#EC2 template machine, this will be use wen submitting this VM to EC2
EC2 = [ AMI="ami-ccf615a5",
        KEYPAIR="keypair",
        AUTHORIZED_PORTS="22",
        INSTANCETYPE=m1.small]

#Add this if you want to use only EC2 cloud
REQUIREMENTS = "HOSTNAME = "ec2""

 ●    Hands on... Create the VM and check progress
$ onevm create ttylinux.one
$ onevm list
  ID     USER      NAME STAT CPU     MEM        HOSTNAME        TIME
  16 oneadmin    one-16 runn   0       0             ec2 00 00:00:35
$ ec2-describe-instances
RESERVATION      r-5eff7536      418314910487    default
INSTANCE         i-bac3f0d2      ami-0572946c                     pending
keypair0         m1.small        2010-01-14T23:32:35+0000         us-
east-1a      aki-a71cf9ce     ari-a51cf9cc            monitoring-
disabled

Building Clouds with OpenNebula 1.4                             Ruben S. Montero
Using the EC2 Hybrid Cloud
 ●   Hands on... Log in the EC2 instance when running
$ onevm show 17
...
VIRTUAL MACHINE TEMPLATE
CPU=0.5
...
EC2=[
  AMI=ami-ccf615a5,
  AUTHORIZED_PORTS=22,
  INSTANCETYPE=m1.small,
  KEYPAIR=keypair ]
IP=ec2-72-44-62-194.compute-1.amazonaws.com
 ...
REQUIREMENTS=HOSTNAME = "ec2"
VMID=17

$ ssh -i keypair.pem root@ec2-72-44-62-194.compute-1.amazonaws.com
Linux ip-10-212-134-128 2.6.21.7-2.fc8xen-ec2-v1.0 #2 SMP Tue Sep 1
10:04:29 EDT 2009 i686
root@ip-10-212-134-128:~#

This costs money!
$ onevm shutdown 17
$ onehost disable ec2
$ onehost list
Building Clouds with OpenNebula 1.4                           Ruben S. Montero
January 2010, CESGA Santiago de Compostela, Spain




      PART IV: Share your Cloud!
          (Cloud Interfaces)

                  Ruben S.Montero
              (rubensm@dacya.ucm.es)
           University Complutense of Madrid
The Public Cloud: Overview
                                      ● You can use multiple interfaces for the Cloud
                                      ● Transparent to your setup:

                                         ● Hypervisor

                                         ● Storage Model

                                         ● Hybrid configuration




                                                           ● Client tools uses EC2 libraries
                                                           ● Potential integration with EC2 tools

                                                             (EC2_URL problems for example)
                                                           ● Provided in the OpenNebula

                                                             distribution
                                                           ● Includes a simple S3 replacement




 ● Supports HTTP and HTTPS protocols
 ● EC2 authentication based on OpenNebula

   credentials
 ● Public Cloud users need an OpenNebula

   account

Building Clouds with OpenNebula 1.4                                                     Ruben S. Montero
Installing the Public Cloud Components
 ●   OpenNebula distribution supports two Cloud interfaces: the EC2
     Query API and OCCI
 ●   Additional requirements: EC2 development library, web server and
     web framework
# gem install amazon-ec2
# sudo gem install sinatra
# sudo gem install thin

#    gem install sequel
#    apt-get install curl libcurl3 libcurl4-gnutls-dev libopenssl-ruby
#    gem install curb
#    gem install sqlite3-ruby

Add a “FQDN” for our Public Cloud
# vim /etc/hosts
127.0.0.1        localhost
#127.0.1.1       formiga-z

84.21.x.y                      formiga-z formiga-z.opennebula.org




Building Clouds with OpenNebula 1.4                                 Ruben S. Montero
Configuring the Public Cloud
 ●   The EC2 service is configured in $ONE_LOCATION/etc/econe.conf
 ●   Hands on... Study the configuration file and adjust it to your cloud
$ more econe.conf
# OpenNebula administrator user, the one_auth contents
USER=oneadmin
PASSWORD=onecloud

# OpenNebula sever contact information
ONE_XMLRPC=http://localhost:2633/RPC2

# Host and port where econe server will run keep FQDNs
SERVER=formiga-y.opennebula.org
PORT=4567

# Configuration for the image repository
# IMAGE_DIR will store the Cloud images, check space!
DATABASE=/srv/cloud/one/var/econe.db
IMAGE_DIR=/srv/cloud/public_repo/

# VM types allowed and its template file
VM_TYPE=[NAME=m1.small, TEMPLATE=m1.small.erb]


Building Clouds with OpenNebula 1.4                                 Ruben S. Montero
Configuring the Public Cloud
 ●   You have to define the correspondence between types (simple) and
     local instantiation of VMs (hard, you should be fine by now)
       ●   Capacity allocated by this VM type (CPU, MEMORY)
       ●   Your cloud requirements, e.g. force to use a given kernel (OS) or place
           public VMs in a given set of cluster nodes (REQUIREMENTS)
       ●    The network used by Public VMs (NIC)
 ●   VM Types are defined in econe.conf. Templates for the VM
     templates are in $ONE_LOCATION/etc/ec2query_templates
 ●   Templates for VM Types are erb files <% Ruby code here >, you
     should not need to modify that.




Building Clouds with OpenNebula 1.4                                       Ruben S. Montero
Configuring the Public Cloud
 ●   Hands on... Prepare the m1.small type of your cloud use ttylinux.one
     as a reference
$ more m1.small.erb

NAME         = eco-vm

CPU    = 0.1
MEMORY = 64

DISK = [ source                   =   <%= erb_vm_info[:img_path] %>,
         clone                    =   yes,
         target                   =   hda,
         readonly                 =   no]

#You have to create this network, and it should be owned by oneadmin

NIC          = [ NETWORK = "Red LAN" ]

IMAGE_ID = <%= erb_vm_info[:img_id] %>
INSTANCE_TYPE = <%= erb_vm_info[:instance_type ]%>




Building Clouds with OpenNebula 1.4                                    Ruben S. Montero
Configuring the Public Cloud
 ●   Hands on... start the econe server
$ unset EC2_URL
$ econe-server start

$ lsof -i

Check $ONE_LOCATION/var/econe-server.log for errors




Building Clouds with OpenNebula 1.4                   Ruben S. Montero
Using the Public Cloud
 ●   The econe-tools are a subset of the functionality provided by the
     onevm utility, and resembles the ec2-* cli
 ●   Image related commands are:
       ●   econe-upload, place an image in the Cloud repo and returns ID
       ●   econe-describe-images, lists the images
       ●   econe-register, register an image not really needed in 1.4
 ●   Instance related commands are:
       ●   econe-run-instances, starts a VM using an image ID
       ●   econe-describe-instances, lists the VMs
       ●   econe-terminate-instances, shutdowns a VM
 ●   User authentication is based in the OpenNebula credentials
       ●   AWSAccessKeyId is OpenNebula's username
       ●   AWSSecretAccessKey is OpenNebula's password


Building Clouds with OpenNebula 1.4                                     Ruben S. Montero
Using the Public Cloud
 ●   Pass your credentials to the econe-tools by (in this order)
       ●   Commands arguments (--access-key <username>, --secret-key <pass>)
       ●   Environemt EC2_ACCESS_KEY and EC2_SECRET_KEY
       ●   Environment ONE_AUTH
 ●   Point econe-tools to your target cloud
       ●   Command arguments (--url <http|https>://<fqdn>:<port>) port needed in
           not the default for the protocol
       ●   EC2_URL environment
 ●
      Hands on... upload the ttylinux image, and start it using the public
     cloud interface.
       ●   Compare the econe-* (public view) and onevm (local view) evolution and
           information
       ●   Check the template build by the econe server (onevm show)



Building Clouds with OpenNebula 1.4                                    Ruben S. Montero
Using the Public Cloud
$ econe-upload -U http://formiga-x.opennebula.org:4567 --access-key
oneadmin --secret-key onecloud /srv/cloud/images/ttylinux/ttylinux.img
Success: ImageId 1

$ export EC2_URL="http://formiga-15.opennebula.org:4567"
$ econe-describe-images -H
Owner      ImageId                     Location
-----------------------------------------------------------------------
oneadmin   1                           /srv/cloud/public_repo/1

$ econe-run-instances 1
oneadmin    1                                      18         m1.small

$ econe-describe-instances
oneadmin    18    1                                     pending
192.168.169.5   m1.small

This is the local view not accessible to public cloud users
$ onevm list
  ID     USER     NAME STAT CPU     MEM        HOSTNAME        TIME
  19 oneadmin   eco-vm runn   0   65536       84.21.x.y 00 00:01:34

$ onevm show 19



Building Clouds with OpenNebula 1.4                           Ruben S. Montero
Configuring SSL access for the Public Cloud
 ●   SSL security is handle by a proxy that forwards the request to the
     EC2 Query Service and takes back the answer to the client
 ●   Requirements:
       ●   A server certificate for the SSL connections
       ●   An HTTP proxy that understands SSL
       ●   EC2Query Service configuration to accept petitions from the proxy
 ●   Hands on... Install the proxy (lighttpd) and get the certificates for your
     cloud
# apt-get install lighttpd
# apt-get instatall ssl-cert


# /usr/sbin/make-ssl-cert generate-default-snakeoil
# cat /etc/ssl/private/ssl-cert-snakeoil.key /etc/ssl/certs/ssl-cert-
snakeoil.pem > /etc/lighttpd/server.pem




Building Clouds with OpenNebula 1.4                                     Ruben S. Montero
Configuring SSL access for the Public Cloud
 ●   Hands on... configure the lighttpd proxy
# vim /etc/lighttpd/lighttpd.conf
server.modules                = (
             "mod_access",
             "mod_alias",
             "mod_accesslog",
             "mod_compress",
             "mod_proxy"
...
## bind to port (default: 80)
server.port                = 8443
...
#### proxy module
proxy.server                 = ( "" =>
                                  ("" =>
                                   (
                                     "host" => "127.0.0.1",
                                     "port" => 4567
                                   )
                                   )
                               )
#### SSL engine
ssl.engine                   = "enable"
ssl.pemfile                  = "/etc/lighttpd/server.pem"
server.reject-expect-100-with-417 = "disable"
Building Clouds with OpenNebula 1.4                           Ruben S. Montero
Configuring SSL access for the Public Cloud
 ●   Hands on... configure the econe server
 $ vim /srv/cloud/one/etc/econe.conf

 #SERVER=formiga-15.opennebula.org
 SERVER=127.0.0.1
 PORT=4567

 # SSL proxy that serves the API (set if is being used)
 SSL_SERVER=formiga-15.opennebula.org


 ●   Hands on... by pass the EC2 library URL checking
 # sudo vim /var/lib/gems/1.8/gems/amazon-ec2-0.7.9/lib/AWS/EC2.rb
 Comment out line 12


 ●   Hands on... restart services (lighttpd and econe-server) and try your
     new SSL cloud access (https://formiga-x.opennebula.org:8443)




Building Clouds with OpenNebula 1.4                                Ruben S. Montero
January 2010, CESGA Santiago de Compostela, Spain




  PART V: Customizing your Cloud

                  Ruben S. Montero
              (rubensm@dacya.ucm.es)
           University Complutense of Madrid
Customizing and Extending your Cloud
 ●    You can customize your cloud by:
       ●   Tunning or adapting the transfer operations to your storage back-end
       ●   Adding new monitorization probes to improve the VM placement
       ●   Adjusting VM operations to your hypervisor installation
       ●   Trigger custom actions on specific VM events (e.g. “on VM creation
           update the accounting DB” or “on VM shutdown send an email”)
 ●    You can extend your cloud by:
       ●   Developing new drivers for other hypervisors
       ●   Developing new drivers for other storage back-ends
       ●   Developing Cloud applications using the OpenNebula API or the Cloud
           APIs


       OpenNebula is very scripting friendly, drivers can be written in any language. You can
     modify the current ones or use them as templates for new ones.




Building Clouds with OpenNebula 1.4                                                    Ruben S. Montero
Customizing the Storage of your Cloud
                                                 OpenNebula issue generic storage operations (check
                                                 var/<vm_id>/transfer.*)


                                                                 Transfer Driver process the core script




                                Action programs interpret the semantics
                                of generic actions depending on the
                                storage back.-end
Building Clouds with OpenNebula 1.4                                                          Ruben S. Montero
Customizing the Storage of your Cloud
 ●   OpenNebula requests the following abstract operations over a
     VM image
       ●   CLONE: This action will basically make a copy of the image from
           ORIGIN to DESTINATION.
       ●   LN: Creates a symbolic link in DESTINATION that points to
           ORIGIN
       ●   MKSWAP: Generates a swap image in DESTINATION. The size is
           given in ORIGIN in MB.
       ●   MKIMAGE: Creates a disk image in DESTINATION and populates
           it with the files inside ORIGIN directory.
       ●   DELETE: Deletes ORIGIN file or directory.
       ●   MV: Moves ORIGIN to DESTINATION.




Building Clouds with OpenNebula 1.4                                      Ruben S. Montero
Customizing the Storage of your Cloud
 ●   Actions are defined in
      $ONE_LOCATION/etc/tm_<storage>/tm_<storage>.conf
 $ more /srv/cloud/one/etc/tm_ssh/tm_ssh.conf
 CLONE   = ssh/tm_clone.sh
 LN      = ssh/tm_ln.sh
 MKSWAP = ssh/tm_mkswap.sh
 MKIMAGE = ssh/tm_mkimage.sh
 DELETE = ssh/tm_delete.sh
 MV      = ssh/tm_mv.sh

 ●   Actions scripts are placed in
      $ONE_LOCATION/lib/tm_commands/<storage>/
 $ ls /srv/cloud/one/lib/tm_commands/ssh/
 tm_clone.sh    tm_delete.sh tm_mkimage.sh      tm_mv.sh
 tm_context.sh tm_ln.sh       tm_mkswap.sh




Building Clouds with OpenNebula 1.4                        Ruben S. Montero
Customizing the Storage of your Cloud
 ●    Hands on... Take a look to the tm_clone.ssh

 . $TMCOMMON
 ...
 log "Creating directory $DST_DIR"
 exec_and_log "ssh $DST_HOST mkdir -p $DST_DIR"
 ...
 case $SRC in
 http://*)
     log "Downloading $SRC"
     exec_and_log "ssh $DST_HOST wget -O $DST_PATH $SRC"
     ;;

 *)
        log "Cloning $SRC"
        exec_and_log "scp $SRC $DST"
        ;;
 esac

 exec_and_log "ssh $DST_HOST chmod a+w $DST_PATH"

 ●    Hands on... Check the semantics of other operations for the ssh
      storage, e.g. tm_ln.ssh

Building Clouds with OpenNebula 1.4                               Ruben S. Montero
Customizing the Information System
 ●   OpenNebula gets host information by executing an arbitrary number of
     probes
 ●   A probe is a program that returns the monitorization metric in the form
     METRIC_NAME = VALUE
 ●   Probes are configured in
      $ONE_LOCATION/etc/im_<hypervisor>/im_<hypervisor>.conf
     And placed in
     $ONE_LOCATION/lib/im_probes
 ●   Probe information is mainly used for VM placement




Building Clouds with OpenNebula 1.4                                Ruben S. Montero
Customizing the Information System
 ●   Hands on... Take a look to the default probes defined for KVM
 $ more /home/ruben/Virtual/one/etc/im_kvm/im_kvm.conf
 cpuarchitecture=architecture.sh
 nodename=name.sh
 cpu=cpu.sh
 kvm=kvm.rb

 $ more name.sh
 #!/bin/sh

 echo HOSTNAME=`uname -n`


 ●   Hands on... Create a new probe that returns the number of VMs in
     RUNNING_VMS (e.g. you can use virsh, pgrep kvm...). Use the new
     metric to pack VMs (RANK=RUNNING_VMS).




Building Clouds with OpenNebula 1.4                              Ruben S. Montero
Customization with Hooks: Network Isolation

                                      ● IN: Only Ethernet frames from a MAC in Red LAN
                                      ● OUT: Only Ethernet frames from the MAC assigned by

                                        OpenNebula




● Networks are isolated at layer 2
● You can put any TCP/IP service as part of the VMs (e.g.

  DHCP, nagios...)

Building Clouds with OpenNebula 1.4                                                Ruben S. Montero
Customization with Hooks: Network Isolation
 ●   Requirements (this has to be done in all the cluster nodes)
       ●   Check that ebtables package is installed
       ●   Allow oneadmin to use the ebtables command through sudo
#visudo
...
oneadmin               ALL=(ALL) NOPASSWD: /sbin/ebtables *
...

 ●   Configure the hooks for OpenNebula
VM_HOOK = [
    name                   =   "ebtables-start",
    on                     =   "running",
    command                =   "/srv/cloud/one/share/hooks/ebtables-kvm",
    arguments              =   "one-$VMID",
    remote                 =   "yes" ]
VM_HOOK = [
    name                   =   "ebtables-flush",
    on                     =   "done",
    command                =   "/srv/cloud/one/share/hooks/ebtables-flush",
    arguments              =   "",
    remote                 =   "yes" ]

Building Clouds with OpenNebula 1.4                                           Ruben S. Montero
Customization with Hooks: Network Isolation
 ●   Hands on... Start a couple of VMs in Networks Red and Blue.
       ●   Check the ebtables rules in the hosts
       ●   Check connectivity between VMs
       ●   Change the network mask of the VMs and check connectivity
       ●   Shutdown and check the ebtables rules




Building Clouds with OpenNebula 1.4                                    Ruben S. Montero
January 2010, CESGA Santiago de Compostela, Spain




Building Clouds with OpenNebula 1.4

                  Ruben S.Montero
              (rubensm@dacya.ucm.es)
           University Complutense of Madrid
Summary
 ●   You should be able to:
       ●   Describe the benefits and characteristics of virtual infrastructures
           and IaaS clouds
       ●   Describe the characteristics and architecture of the different
           clouds that can be deployed with OpenNebula 1.4
       ●   Plan and architect a private cloud
       ●   Design, Use                and   Manage   Virtual   infrastructures   (cloud
           applications)
       ●   Build public and hybrid clouds
       ●   Adapt OpenNebula 1.4 to your datacenter




Building Clouds with OpenNebula 1.4                                                Ruben S. Montero

Contenu connexe

Tendances

Build a private cloud – prototype and test with open nebula
Build a private cloud – prototype and test with open nebulaBuild a private cloud – prototype and test with open nebula
Build a private cloud – prototype and test with open nebulaA B M Moniruzzaman
 
OpenNebula Conf 2014 | OpenNebula and MooseFS for disaster recovery: real clo...
OpenNebula Conf 2014 | OpenNebula and MooseFS for disaster recovery: real clo...OpenNebula Conf 2014 | OpenNebula and MooseFS for disaster recovery: real clo...
OpenNebula Conf 2014 | OpenNebula and MooseFS for disaster recovery: real clo...NETWAYS
 
PHP and the Cloud
PHP and the CloudPHP and the Cloud
PHP and the CloudIvo Jansch
 
OpenNebulaConf 2013 - Hands-on Tutorial: 1. Introduction and Architecture
OpenNebulaConf 2013 - Hands-on Tutorial: 1. Introduction and ArchitectureOpenNebulaConf 2013 - Hands-on Tutorial: 1. Introduction and Architecture
OpenNebulaConf 2013 - Hands-on Tutorial: 1. Introduction and ArchitectureOpenNebula Project
 
Ubuntu Cloud Juju
Ubuntu Cloud JujuUbuntu Cloud Juju
Ubuntu Cloud JujueNovance
 
LXC, Docker, and the future of software delivery | LinuxCon 2013
LXC, Docker, and the future of software delivery | LinuxCon 2013LXC, Docker, and the future of software delivery | LinuxCon 2013
LXC, Docker, and the future of software delivery | LinuxCon 2013dotCloud
 
OpenNebula 4.14 Hands-on Tutorial
OpenNebula 4.14 Hands-on TutorialOpenNebula 4.14 Hands-on Tutorial
OpenNebula 4.14 Hands-on TutorialOpenNebula Project
 
OpenNebulaConf 2016 - Building a GNU/Linux Distribution by Daniel Dehennin, M...
OpenNebulaConf 2016 - Building a GNU/Linux Distribution by Daniel Dehennin, M...OpenNebulaConf 2016 - Building a GNU/Linux Distribution by Daniel Dehennin, M...
OpenNebulaConf 2016 - Building a GNU/Linux Distribution by Daniel Dehennin, M...OpenNebula Project
 
Lxc – next gen virtualization for cloud intro (cloudexpo)
Lxc – next gen virtualization for cloud   intro (cloudexpo)Lxc – next gen virtualization for cloud   intro (cloudexpo)
Lxc – next gen virtualization for cloud intro (cloudexpo)Boden Russell
 
Securing Your Cloud With the Xen Hypervisor by Russell Pavlicek
Securing Your Cloud With the Xen Hypervisor by Russell PavlicekSecuring Your Cloud With the Xen Hypervisor by Russell Pavlicek
Securing Your Cloud With the Xen Hypervisor by Russell Pavlicekbuildacloud
 
Locally run a FIWARE Lab Instance In another Hypervisors
Locally run a FIWARE Lab Instance In another HypervisorsLocally run a FIWARE Lab Instance In another Hypervisors
Locally run a FIWARE Lab Instance In another HypervisorsJosé Ignacio Carretero Guarde
 
OpenNebula 5.4 Hands-on Tutorial
OpenNebula 5.4 Hands-on TutorialOpenNebula 5.4 Hands-on Tutorial
OpenNebula 5.4 Hands-on TutorialOpenNebula Project
 
The sexy world of Linux kernel pvops project
The sexy world of Linux kernel pvops projectThe sexy world of Linux kernel pvops project
The sexy world of Linux kernel pvops projectThe Linux Foundation
 
Linux containers – next gen virtualization for cloud (atl summit) ar4 3 - copy
Linux containers – next gen virtualization for cloud (atl summit) ar4 3 - copyLinux containers – next gen virtualization for cloud (atl summit) ar4 3 - copy
Linux containers – next gen virtualization for cloud (atl summit) ar4 3 - copyBoden Russell
 
Linux Virtualization
Linux VirtualizationLinux Virtualization
Linux VirtualizationOpenVZ
 
Linux Container Brief for IEEE WG P2302
Linux Container Brief for IEEE WG P2302Linux Container Brief for IEEE WG P2302
Linux Container Brief for IEEE WG P2302Boden Russell
 

Tendances (19)

Build a private cloud – prototype and test with open nebula
Build a private cloud – prototype and test with open nebulaBuild a private cloud – prototype and test with open nebula
Build a private cloud – prototype and test with open nebula
 
OpenNebula Conf 2014 | OpenNebula and MooseFS for disaster recovery: real clo...
OpenNebula Conf 2014 | OpenNebula and MooseFS for disaster recovery: real clo...OpenNebula Conf 2014 | OpenNebula and MooseFS for disaster recovery: real clo...
OpenNebula Conf 2014 | OpenNebula and MooseFS for disaster recovery: real clo...
 
PHP and the Cloud
PHP and the CloudPHP and the Cloud
PHP and the Cloud
 
OpenNebulaConf 2013 - Hands-on Tutorial: 1. Introduction and Architecture
OpenNebulaConf 2013 - Hands-on Tutorial: 1. Introduction and ArchitectureOpenNebulaConf 2013 - Hands-on Tutorial: 1. Introduction and Architecture
OpenNebulaConf 2013 - Hands-on Tutorial: 1. Introduction and Architecture
 
Ubuntu Cloud Juju
Ubuntu Cloud JujuUbuntu Cloud Juju
Ubuntu Cloud Juju
 
LXC, Docker, and the future of software delivery | LinuxCon 2013
LXC, Docker, and the future of software delivery | LinuxCon 2013LXC, Docker, and the future of software delivery | LinuxCon 2013
LXC, Docker, and the future of software delivery | LinuxCon 2013
 
OpenNebula 4.14 Hands-on Tutorial
OpenNebula 4.14 Hands-on TutorialOpenNebula 4.14 Hands-on Tutorial
OpenNebula 4.14 Hands-on Tutorial
 
OpenNebulaConf 2016 - Building a GNU/Linux Distribution by Daniel Dehennin, M...
OpenNebulaConf 2016 - Building a GNU/Linux Distribution by Daniel Dehennin, M...OpenNebulaConf 2016 - Building a GNU/Linux Distribution by Daniel Dehennin, M...
OpenNebulaConf 2016 - Building a GNU/Linux Distribution by Daniel Dehennin, M...
 
Lxc – next gen virtualization for cloud intro (cloudexpo)
Lxc – next gen virtualization for cloud   intro (cloudexpo)Lxc – next gen virtualization for cloud   intro (cloudexpo)
Lxc – next gen virtualization for cloud intro (cloudexpo)
 
Securing Your Cloud With the Xen Hypervisor by Russell Pavlicek
Securing Your Cloud With the Xen Hypervisor by Russell PavlicekSecuring Your Cloud With the Xen Hypervisor by Russell Pavlicek
Securing Your Cloud With the Xen Hypervisor by Russell Pavlicek
 
Locally run a FIWARE Lab Instance In another Hypervisors
Locally run a FIWARE Lab Instance In another HypervisorsLocally run a FIWARE Lab Instance In another Hypervisors
Locally run a FIWARE Lab Instance In another Hypervisors
 
OpenNebula 5.4 Hands-on Tutorial
OpenNebula 5.4 Hands-on TutorialOpenNebula 5.4 Hands-on Tutorial
OpenNebula 5.4 Hands-on Tutorial
 
Openstack deployment-with ubuntu
Openstack deployment-with ubuntuOpenstack deployment-with ubuntu
Openstack deployment-with ubuntu
 
The sexy world of Linux kernel pvops project
The sexy world of Linux kernel pvops projectThe sexy world of Linux kernel pvops project
The sexy world of Linux kernel pvops project
 
Linux containers – next gen virtualization for cloud (atl summit) ar4 3 - copy
Linux containers – next gen virtualization for cloud (atl summit) ar4 3 - copyLinux containers – next gen virtualization for cloud (atl summit) ar4 3 - copy
Linux containers – next gen virtualization for cloud (atl summit) ar4 3 - copy
 
Linux Virtualization
Linux VirtualizationLinux Virtualization
Linux Virtualization
 
All Virtual All The Time
All Virtual All The TimeAll Virtual All The Time
All Virtual All The Time
 
Linux Container Brief for IEEE WG P2302
Linux Container Brief for IEEE WG P2302Linux Container Brief for IEEE WG P2302
Linux Container Brief for IEEE WG P2302
 
PVOps Update
PVOps Update PVOps Update
PVOps Update
 

En vedette

Ensayo Realidad virtual
Ensayo Realidad virtualEnsayo Realidad virtual
Ensayo Realidad virtualGina Montero
 
Trucos windows-7
Trucos windows-7Trucos windows-7
Trucos windows-7Nestunga
 
Virtual research project presentation 2013
Virtual research project presentation 2013Virtual research project presentation 2013
Virtual research project presentation 2013Estefii Cabrera Morales
 
'METEORITE MEDAL’ IN SOCHI OLYMPICS 2014
'METEORITE MEDAL’ IN SOCHI OLYMPICS 2014'METEORITE MEDAL’ IN SOCHI OLYMPICS 2014
'METEORITE MEDAL’ IN SOCHI OLYMPICS 2014news4kid
 
Finding Hidden Opportunities with Advanced Web Analytics
Finding Hidden Opportunities with Advanced Web AnalyticsFinding Hidden Opportunities with Advanced Web Analytics
Finding Hidden Opportunities with Advanced Web AnalyticsDaniel Smulevich
 
Biblioteca Digitala - platforma YOOLIB
Biblioteca Digitala - platforma YOOLIBBiblioteca Digitala - platforma YOOLIB
Biblioteca Digitala - platforma YOOLIBzspotmedia
 
An update-on-imaging-of-colorectal-cancer
An update-on-imaging-of-colorectal-cancerAn update-on-imaging-of-colorectal-cancer
An update-on-imaging-of-colorectal-cancerDRx Man
 
Siemon Z Max Catalog
Siemon Z Max CatalogSiemon Z Max Catalog
Siemon Z Max Catalogrobgross144
 
Nach 400 Jahren APPsolut rauschfrei ? – der deutsche Blätterwald für die Hose...
Nach 400 Jahren APPsolut rauschfrei ? – der deutsche Blätterwald für die Hose...Nach 400 Jahren APPsolut rauschfrei ? – der deutsche Blätterwald für die Hose...
Nach 400 Jahren APPsolut rauschfrei ? – der deutsche Blätterwald für die Hose...Martin Krieg
 
Presentación corporativa reale reunión fece
Presentación corporativa reale   reunión fecePresentación corporativa reale   reunión fece
Presentación corporativa reale reunión fecearandareale
 
Colegio nacional
Colegio nacionalColegio nacional
Colegio nacionalcesar1729
 
Value of Diversity at the Workplace Presentation by Tina Tinde at career for...
Value of Diversity at the Workplace  Presentation by Tina Tinde at career for...Value of Diversity at the Workplace  Presentation by Tina Tinde at career for...
Value of Diversity at the Workplace Presentation by Tina Tinde at career for...Gry Tina Tinde
 
Aplicacion de toc en los procesos de produccion de imusa
Aplicacion de toc en los procesos de produccion de imusaAplicacion de toc en los procesos de produccion de imusa
Aplicacion de toc en los procesos de produccion de imusaCarmen Hevia Medina
 

En vedette (20)

Ensayo Realidad virtual
Ensayo Realidad virtualEnsayo Realidad virtual
Ensayo Realidad virtual
 
Trucos windows-7
Trucos windows-7Trucos windows-7
Trucos windows-7
 
Virtual research project presentation 2013
Virtual research project presentation 2013Virtual research project presentation 2013
Virtual research project presentation 2013
 
'METEORITE MEDAL’ IN SOCHI OLYMPICS 2014
'METEORITE MEDAL’ IN SOCHI OLYMPICS 2014'METEORITE MEDAL’ IN SOCHI OLYMPICS 2014
'METEORITE MEDAL’ IN SOCHI OLYMPICS 2014
 
Finding Hidden Opportunities with Advanced Web Analytics
Finding Hidden Opportunities with Advanced Web AnalyticsFinding Hidden Opportunities with Advanced Web Analytics
Finding Hidden Opportunities with Advanced Web Analytics
 
Biblioteca Digitala - platforma YOOLIB
Biblioteca Digitala - platforma YOOLIBBiblioteca Digitala - platforma YOOLIB
Biblioteca Digitala - platforma YOOLIB
 
An update-on-imaging-of-colorectal-cancer
An update-on-imaging-of-colorectal-cancerAn update-on-imaging-of-colorectal-cancer
An update-on-imaging-of-colorectal-cancer
 
Siemon Z Max Catalog
Siemon Z Max CatalogSiemon Z Max Catalog
Siemon Z Max Catalog
 
Nach 400 Jahren APPsolut rauschfrei ? – der deutsche Blätterwald für die Hose...
Nach 400 Jahren APPsolut rauschfrei ? – der deutsche Blätterwald für die Hose...Nach 400 Jahren APPsolut rauschfrei ? – der deutsche Blätterwald für die Hose...
Nach 400 Jahren APPsolut rauschfrei ? – der deutsche Blätterwald für die Hose...
 
Presentación corporativa reale reunión fece
Presentación corporativa reale   reunión fecePresentación corporativa reale   reunión fece
Presentación corporativa reale reunión fece
 
Colegio nacional
Colegio nacionalColegio nacional
Colegio nacional
 
Contenido Conceptual Unidad III
Contenido Conceptual Unidad IIIContenido Conceptual Unidad III
Contenido Conceptual Unidad III
 
Articulo cientifico sobre ISO 14001
Articulo cientifico sobre ISO 14001Articulo cientifico sobre ISO 14001
Articulo cientifico sobre ISO 14001
 
Ayuda en acción
Ayuda en acciónAyuda en acción
Ayuda en acción
 
Value of Diversity at the Workplace Presentation by Tina Tinde at career for...
Value of Diversity at the Workplace  Presentation by Tina Tinde at career for...Value of Diversity at the Workplace  Presentation by Tina Tinde at career for...
Value of Diversity at the Workplace Presentation by Tina Tinde at career for...
 
Tdah examen lengua adaptado
Tdah examen lengua adaptadoTdah examen lengua adaptado
Tdah examen lengua adaptado
 
014 1 juan 4
014 1 juan 4014 1 juan 4
014 1 juan 4
 
Aplicacion de toc en los procesos de produccion de imusa
Aplicacion de toc en los procesos de produccion de imusaAplicacion de toc en los procesos de produccion de imusa
Aplicacion de toc en los procesos de produccion de imusa
 
Rentas de quinta categoría
Rentas de quinta categoríaRentas de quinta categoría
Rentas de quinta categoría
 
Computación 2do Año (Parte II)
Computación 2do Año (Parte II)Computación 2do Año (Parte II)
Computación 2do Año (Parte II)
 

Similaire à Building Clouds One 1.4

Open stack meetup_boston_ubuntu_cloud
Open stack meetup_boston_ubuntu_cloudOpen stack meetup_boston_ubuntu_cloud
Open stack meetup_boston_ubuntu_cloudKamesh Pemmaraju
 
ISC Cloud'13 - Hands-On Tutorial on “Building Your Cloud for HPC, Here & Now,...
ISC Cloud'13 - Hands-On Tutorial on “Building Your Cloud for HPC, Here & Now,...ISC Cloud'13 - Hands-On Tutorial on “Building Your Cloud for HPC, Here & Now,...
ISC Cloud'13 - Hands-On Tutorial on “Building Your Cloud for HPC, Here & Now,...OpenNebula Project
 
Getting Started Hacking OpenNebula - Fosdem-2013
Getting Started Hacking OpenNebula - Fosdem-2013Getting Started Hacking OpenNebula - Fosdem-2013
Getting Started Hacking OpenNebula - Fosdem-2013OpenNebula Project
 
OpenNebula Interoperability
OpenNebula InteroperabilityOpenNebula Interoperability
OpenNebula Interoperabilitydmamolina
 
Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14Simon Storm
 
EGI TF 2013 / Cloud Interoperability Week – Hands-On Tutorial
EGI TF 2013 / Cloud Interoperability Week – Hands-On TutorialEGI TF 2013 / Cloud Interoperability Week – Hands-On Tutorial
EGI TF 2013 / Cloud Interoperability Week – Hands-On TutorialOpenNebula Project
 
comparative study of Cloud computing tools
comparative study of Cloud computing tools comparative study of Cloud computing tools
comparative study of Cloud computing tools Aditya Trivedi
 
Loadays 2013 OpenNebula Fundamentals
Loadays 2013 OpenNebula FundamentalsLoadays 2013 OpenNebula Fundamentals
Loadays 2013 OpenNebula FundamentalsOpenNebula Project
 
Lightning talk unikernels
Lightning talk unikernelsLightning talk unikernels
Lightning talk unikernelsMichael Bright
 
Cloud Computing in practice with OpenNebula ~ Develer workshop 2012
Cloud Computing in practice with OpenNebula ~ Develer workshop 2012Cloud Computing in practice with OpenNebula ~ Develer workshop 2012
Cloud Computing in practice with OpenNebula ~ Develer workshop 2012Giovanni Toraldo
 
Cloud computing, in practice ~ develer workshop
Cloud computing, in practice ~ develer workshopCloud computing, in practice ~ develer workshop
Cloud computing, in practice ~ develer workshopDeveler S.r.l.
 
OSDC 2012 | OpenNebula Tutorial by Constantino Vazquez Blanco
OSDC 2012 | OpenNebula Tutorial by Constantino Vazquez BlancoOSDC 2012 | OpenNebula Tutorial by Constantino Vazquez Blanco
OSDC 2012 | OpenNebula Tutorial by Constantino Vazquez BlancoNETWAYS
 
Eucalyptus, Nimbus & OpenNebula
Eucalyptus, Nimbus & OpenNebulaEucalyptus, Nimbus & OpenNebula
Eucalyptus, Nimbus & OpenNebulaAmar Myana
 
TECNIRIS@: OpenNebula Tutorial
TECNIRIS@: OpenNebula TutorialTECNIRIS@: OpenNebula Tutorial
TECNIRIS@: OpenNebula TutorialOpenNebula Project
 
Survey of open source cloud architectures
Survey of open source cloud architecturesSurvey of open source cloud architectures
Survey of open source cloud architecturesabhinav vedanbhatla
 
Open nebula a reference open cloud stack
Open nebula   a reference open cloud stackOpen nebula   a reference open cloud stack
Open nebula a reference open cloud stackIgnacio M. Llorente
 
Building IaaS Clouds and the Art of Virtual Machine Management: A Practical G...
Building IaaS Clouds and the Art of Virtual Machine Management: A Practical G...Building IaaS Clouds and the Art of Virtual Machine Management: A Practical G...
Building IaaS Clouds and the Art of Virtual Machine Management: A Practical G...Ruben S. Montero
 
Musings on Mesos: Docker, Kubernetes, and Beyond.
Musings on Mesos: Docker, Kubernetes, and Beyond.Musings on Mesos: Docker, Kubernetes, and Beyond.
Musings on Mesos: Docker, Kubernetes, and Beyond.Timothy St. Clair
 
The Future of System Administration
The Future of System AdministrationThe Future of System Administration
The Future of System AdministrationKris Buytaert
 

Similaire à Building Clouds One 1.4 (20)

Open stack meetup_boston_ubuntu_cloud
Open stack meetup_boston_ubuntu_cloudOpen stack meetup_boston_ubuntu_cloud
Open stack meetup_boston_ubuntu_cloud
 
ISC Cloud'13 - Hands-On Tutorial on “Building Your Cloud for HPC, Here & Now,...
ISC Cloud'13 - Hands-On Tutorial on “Building Your Cloud for HPC, Here & Now,...ISC Cloud'13 - Hands-On Tutorial on “Building Your Cloud for HPC, Here & Now,...
ISC Cloud'13 - Hands-On Tutorial on “Building Your Cloud for HPC, Here & Now,...
 
Getting Started Hacking OpenNebula - Fosdem-2013
Getting Started Hacking OpenNebula - Fosdem-2013Getting Started Hacking OpenNebula - Fosdem-2013
Getting Started Hacking OpenNebula - Fosdem-2013
 
OpenNebula Interoperability
OpenNebula InteroperabilityOpenNebula Interoperability
OpenNebula Interoperability
 
Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14
 
EGI TF 2013 / Cloud Interoperability Week – Hands-On Tutorial
EGI TF 2013 / Cloud Interoperability Week – Hands-On TutorialEGI TF 2013 / Cloud Interoperability Week – Hands-On Tutorial
EGI TF 2013 / Cloud Interoperability Week – Hands-On Tutorial
 
comparative study of Cloud computing tools
comparative study of Cloud computing tools comparative study of Cloud computing tools
comparative study of Cloud computing tools
 
Loadays 2013 OpenNebula Fundamentals
Loadays 2013 OpenNebula FundamentalsLoadays 2013 OpenNebula Fundamentals
Loadays 2013 OpenNebula Fundamentals
 
LinuxTag 2013
LinuxTag 2013LinuxTag 2013
LinuxTag 2013
 
Lightning talk unikernels
Lightning talk unikernelsLightning talk unikernels
Lightning talk unikernels
 
Cloud Computing in practice with OpenNebula ~ Develer workshop 2012
Cloud Computing in practice with OpenNebula ~ Develer workshop 2012Cloud Computing in practice with OpenNebula ~ Develer workshop 2012
Cloud Computing in practice with OpenNebula ~ Develer workshop 2012
 
Cloud computing, in practice ~ develer workshop
Cloud computing, in practice ~ develer workshopCloud computing, in practice ~ develer workshop
Cloud computing, in practice ~ develer workshop
 
OSDC 2012 | OpenNebula Tutorial by Constantino Vazquez Blanco
OSDC 2012 | OpenNebula Tutorial by Constantino Vazquez BlancoOSDC 2012 | OpenNebula Tutorial by Constantino Vazquez Blanco
OSDC 2012 | OpenNebula Tutorial by Constantino Vazquez Blanco
 
Eucalyptus, Nimbus & OpenNebula
Eucalyptus, Nimbus & OpenNebulaEucalyptus, Nimbus & OpenNebula
Eucalyptus, Nimbus & OpenNebula
 
TECNIRIS@: OpenNebula Tutorial
TECNIRIS@: OpenNebula TutorialTECNIRIS@: OpenNebula Tutorial
TECNIRIS@: OpenNebula Tutorial
 
Survey of open source cloud architectures
Survey of open source cloud architecturesSurvey of open source cloud architectures
Survey of open source cloud architectures
 
Open nebula a reference open cloud stack
Open nebula   a reference open cloud stackOpen nebula   a reference open cloud stack
Open nebula a reference open cloud stack
 
Building IaaS Clouds and the Art of Virtual Machine Management: A Practical G...
Building IaaS Clouds and the Art of Virtual Machine Management: A Practical G...Building IaaS Clouds and the Art of Virtual Machine Management: A Practical G...
Building IaaS Clouds and the Art of Virtual Machine Management: A Practical G...
 
Musings on Mesos: Docker, Kubernetes, and Beyond.
Musings on Mesos: Docker, Kubernetes, and Beyond.Musings on Mesos: Docker, Kubernetes, and Beyond.
Musings on Mesos: Docker, Kubernetes, and Beyond.
 
The Future of System Administration
The Future of System AdministrationThe Future of System Administration
The Future of System Administration
 

Dernier

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 

Dernier (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 

Building Clouds One 1.4

  • 1. January 2010, CESGA Santiago de Compostela, Spain Building Clouds with OpenNebula 1.4 Ruben S.Montero (rubensm@dacya.ucm.es) University Complutense of Madrid
  • 2. Course Overview ● Day one (January 18th, Moorning) ● Introduction to Cloud Computing (FAST!!!) ● Installing OpenNebula 1.4 ● Configure OpenNebula 1.4 (storage, hypervisor and network) ● Administration of an OpenNebula Cloud (hosts, users) ● Day one (January 18th, Afternoon) ● Basic usage (networks, VMs) ● More on usage (VMs, context and scheduling) Private Cloud ● Configuring an Hybrid Cloud with Amazon EC2 Hybrid Cloud ● Day two (January 19th, Moorning) ● Public Cloud interfaces: The EC2 Query API Public Cloud ● Advance Topics: Adapt OpenNebula 1.4 to your datacenter Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 3. Course Overview ● In this course you will learn to: ● Describe the benefits and characteristics of virtual infrastructures and IaaS clouds ● Describe the characteristics and architecture of the different clouds that can be deployed with OpenNebula 1.4 ● Plan and architect a private cloud ● Design, Use and Manage Virtual infrastructures (cloud applications) ● Build public and hybrid clouds ● Adapt OpenNebula 1.4 to your datacenter This box contains interesting messages This is a console output, for hands on, checking configuration files... # This is the root prompt $ This is oneadmin prompt Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 4. January 2010, CESGA Santiago de Compostela, Spain PART I: Building your Private Cloud Ruben S.Montero (rubensm@dacya.ucm.es) University Complutense of Madrid
  • 5. Cloud Computing in a Nutshell What Who Software as a Service On-demand access End-user to any application (does not care about hw or sw) Platform as a Service Platform for building Developer and delivering web (no managing of the underlying hw applications & swlayers) Infrastructure as a Service ᄎ Delivery of a raw System Administrator computer (complete management of the infrastructure computer infrastructure) In this course Physical Infrastructure Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 6. The IaaS Clouds a Four Point Check List ● Simple Interface ● Raw Infrastructure Resources ● Total control of the resources ● Capacity leased in the form of VMs ● Complete Service-HW decoupling ● Pay-as-you-go ● A single user can not get all the resources ● Elastic & “infinite” Capacity Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 7. The Anatomy of an IaaS Cloud VM VM VM VM VM VM Cloud API (web) Service Service Virtual Infrastructure Manager (VIM) Network Image Repositories (Storage) Physical Infrastructure Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 8. Why Virtual Infrastructure Manager a Virtual Infrastructure Manager? ● VMs are great!!...but something more is needed ● Where did/do I put my VM? (scheduling & monitoring) ● How do I provision a new cluster node? (clone & context) ● What MAC addresses are available? (networking) ● Provides a uniform view of the resource pool ● Life-cycle management and monitoring of VM ● The VIM integrates Image, Network and Virtualization VM VM VM VM OpenNebula (VIM) hypervisor hypervisor hypervisor hypervisor Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 9. Planning the Installation: System Overview ● Executes the OpenNebula Services ● Usually acts as a classical cluster front-end ● Repository of VM images ● Multiple backends (LVM, iSCSI..) ● Modular components to interact with the cluster services ● Types: storage, monitoring, virtualization and network ● Provides physical resources to VMs The same host can be can be a ● Must have a hypervisor installed the front-end and a node Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 10. Planning the Installation: Working in the Front-End ... ● Choose your installation mode: system wide (/usr, /etc...) or self- contained (under $ONE_LOCATION) ● Install software dependencies ● Runtime (also ssh and openssl) # apt-get install ruby # apt-get install sqlite3 # apt-get install libxmlrpc-c3 ● Development libraries and tools (only needed to build OpenNebula) # apt-get install libxmlrpc-c3-dev libsqlite3-dev libssl-dev # apt-get install g++ scons # apt-get install ruby-dev rubygems rake The following will give you a faster XML parser (faster CLI) # apt-get install libxml-parser-ruby1.8 libxslt1-dev libxml2-dev # gem install nokogiri SET SYSTEM LOCALES TO ENGLISH (oneadmin should be enough...) # cat /etc/default/locale LANG="en_US.UTF-8" Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 11. Planning the Installation: Working in the Front-End ... ● The Users of the private cloud: ● oneadmin: Account to run the daemons, manage the system and do all the low-level operations (e.g. start VMs, move images...). ● Users: create and manage their own VMs and networks. Need to be defined in OpenNebula ● Installation layout ● We will use the /srv/cloud directory to place the OpenNebula software ● /srv/cloud/one will hold the OpenNebula installation ● /srv/cloud/images will do our image repository in the course # tree /srv /srv/ `-- cloud |-- images `-- one |-- SRC The oneadmin account must be created system wide (i.e. front-end and all the nodes) you can use NIS, or a local account with the same ID's in all the hosts. Users do not need a UNIX account in the nodes, nor in the front-end. Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 12. Planning the Installation: Working in the Front-End ... ● Hands on... # groupadd -g 3000 cloud # mkdir /srv/cloud # chmod g+ws cloud /srv/cloud # mkdir /srv/cloud/images # useradd -d /srv/cloud/one -g cloud -u 3000 -s /bin/bash -m oneadmin Create the file-system hierarchy with the oneadmin account $ id uid=3000(oneadmin) gid=3000(cloud) grupos=3000(cloud) $ mkdir /srv/cloud/images $ mkdir SRC We will place the OpenNebula source code in SRC Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 13. Planning the Installation: Working in the Front-End ... ● Preparing the storage for the private cloud... ● Image Repository: Any storage medium for the VM images (usually a high performing SAN) – OpenNebula supports multiple back-ends (e.g. LVM for fast cloning) – The front-end must have access to the repository ● VM Directory: The home of the VM in the cluster node – Stores checkpoints, description files and VM disks – Actual operations over the VM directory depends on the storage medium – Should be shared for live-migrations – You can go on without a shared FS and use the SSH back-end – Defaults to $ONE_LOCATION/var/$VM_ID Dimensioning the Storage... Example: A 64 core cluster will typically run around 80VMs, each VM will require an average of 10GB of disk space. So you will need ~800GB for /srv/cloud/one, you will also want to store 10-15 master images so ~200GB for /srv/cloud/images. A 1TB /srv/cloud will be enough for this example setup. Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 14. Planning the Installation: Working in the Front-End ... ● In this course we will use NFS to share the VM directories ● The Image Repository is /srv/cloud/images Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 15. Planning the Installation: Working in the Front-End ... ● Hands on... # apt-get install nfs-kernel-server Export /srv/cloud to your nodes - only need /srv/cloud/one/var - we also export $HOME of oneadmin for easy SSH key configuration - No really need to export /srv/cloud/images # vi more /etc/exports /srv/cloud 84.21.XX.YY(rw,async,no_subtree_check,no_root_squash) # /etc/init.d/nfs-kernel-server stop # /etc/init.d/nfs-kernel-server start Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 16. Planning the Installation: Working in the Front-End ... ● Networking for the private cloud ● OpenNebula management operations uses a ssh connections, it does not require a performing NIC ● Image traffic, may require the movement of heavy files (VM images, checkpoints). Dedicated storage links may be a good idea ● VM demands, consider the typical requirements of your VMs. Several NICs to support the VM traffic may be a good idea ● OpenNebula relies on bridge networking for the VMs Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 17. Planning the Installation: Working in the Nodes ... ● Install software dependencies ● We need SSH daemon running in the cluster nodes (check it!) ● Runtime dependencies: # apt-get install ruby ● Users ● Create the oneadmin account (use same UID and GID) # groupadd -g 3000 cloud # useradd -d /srv/cloud/one -g cloud -u 3000 -s /bin/bash oneadmin ● Storage ● Recreate the installation layout and configure NFS to mount the VM dirs # mkdir /srv/cloud # chmod g+ws cloud /srv/cloud # apt-get install nfs-common # vi /etc/fstab x.y.z.w:/srv/cloud /srv/cloud nfs soft,intr,rsize=32768,wsize=32768,rw 0 0 Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 18. Planning the Installation: SSH Configuration ● Enable password-less SSH access to cluster nodes for the oneadmin account: DO NOT PROTECT PRIVATE KEY WITH A PASSWORD $ ssh-keygen Generating public/private rsa key pair. ... Enter passphrase (empty for no passphrase): Enter same passphrase again: $ cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys Tell ssh client not to ask to add hosts to known_hosts (optional) $ cat /srv/cloud/one/.ssh/config Host * StrictHostKeyChecking no TEST! $ ssh localhost $ ssh 84.21.xx.yy You may need to exchange keys with the nodes (not here as we share /srv/cloud/one the oneadmin home, and so the ~/.ssh directory Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 19. Planning the Installation: The Hypervisor ... ● Installing the Hypervisor ● OpenNebula supports KVM, Xen and Vmware (even simultaneously). This course applies to KVM and Xen ● Refer to the hypervisor documentation for additional (and better information) on setting up them. ● Setting up KVM and libvirt (Ubuntu Karmic) ● Install the packages #apt-get install qemu libvirt-bin kvm ● The network set up in this course peth0, the physical NIC Physical Host eth0 (bridge) eth0 (bridge) 84.21.xx.yy 84.21.xx.yy VM VM VM VM 192.168.170.xx 192.168.170.xx 192.168.169.xx 192.168.169.xx Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 20. Planning the Installation: The Hypervisor ... ● Hands on... Remove the default bridge in Ubuntu #rm /etc/libvirt/qemu/networks/autostart/default.xml #ifconfig virbr0 down #brctl delbr virbr0 Set up the network for the course (equivalent to a Xen setup) - bridge.sh will create the bridge at boot time (see next slide) - Execute it in the libvirt-bin start script #vim /etc/libvirt/bridge.sh #chmod +x /etc/libvirt/bridge.sh #vi /etc/init.d/libvirt-bin ... case "$1" in start) if check_start_libvirtd_option; then log_daemon_msg "Starting $DESC" "$NAME" /etc/libvirt/set_up_bridge.sh ... Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 21. Planning the Installation: The Hypervisor ... #!/bin/sh create_bridge () { ip link show p$1 > /dev/null 2>&1 if [ $? -ne 0 ] ; then ifdown $1 ip link set $1 down ip link set $1 name p$1 ip link set promisc on dev p$1 ip addr add 0.0.0.0 dev p$1 brctl addbr $1 brctl stp $1 off brctl addif $1 p$1 ip link set dev p$1 up ip link set dev $1 up echo "1" > /proc/sys/net/ipv4/ip_forward fi } create_bridge eth0 route del -net 84.21.xx.0/24 dev peth0 ifup eth0 Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 22. Planning the Installation: The Hypervisor ... ● Check the network configuration root@formiga-5:/srv# ifconfig eth0 Link encap:Ethernet HWaddr 00:1e:4f:e0:5e:9f ... lo Link encap:Bucle local ... peth0 Link encap:Ethernet HWaddr 00:1e:4f:e0:5e:9f ... # brctl show bridge name bridge id STP enabled interfaces eth0 8000.001e4fe05e9f no peth0 ● Add oneadmin to the libvirt group # usermod -G kvm,libvirtd oneadmin ● Test the installation for the oneadmin account $ virsh list Connecting to uri: qemu:///system Id Name State ---------------------------------- Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 23. Planning the Installation: Checklist Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 24. Installing OpenNebula 1.4 ● Grab the source code and compile it! ~/SRC$ wget http://dev.opennebula.org/attachments/download/103/one- 1.4.0.tar.gz ~/SRC$ tar xzvf one-1.4.0.tar.gz ~/SRC$ cd one-1.4/ ~/SRC$ scons ● Install the software in /srv/cloud/one (ONE_LOCATION) $ export ONE_LOCATION=/srv/cloud/one/ $ ./install.sh -d $ONE_LOCATION Check install.sh -h for other options ● Check and explore the installation tree ~$ ls -F bin/ etc/ examples.desktop include/ lib/ share/ SRC/ var/ Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 25. Configuring OpenNebula: The configuration interface ● $ONE_LOCATION/etc/oned.conf ● General configuration ● Defines the drivers used in the private cloud ● Match-making scheduler (default) ● Placement policies configured per VM $ONE_LOCATION/etc/im_*/im_*.conf ● ● Defines monitoring probes ● $ONE_LOCATION/etc/vmm_*/vmm_*.conf ● Defaults values for the hypervisor ● $ONE_LOCATION/etc/tm_*/tm_*.conf ● Defines action for generic storage operations Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 26. Configuring OpenNebula: The oned.conf file ● General configuration attributes ● Monitoring intervals, HOST_MONITORING_INTERVAL VM_POLLING_INTERVAL ● VM_DIR: Path to the VM directory for all the cluster nodes. ● Network parameters, MAC_PREFIX, NETWORK_SIZE ● PORT : Port where oned will listen for xml-rpc calls ● DEBUG_LEVEL HOST_MONITORING_INTERVAL = 60 VM_POLLING_INTERVAL = 60 #VM_DIR = /srv/cloud/one/var MAC_PREFIX = "00:01" NETWORK_SIZE = 254 PORT = 2633 DEBUG_LEVEL = 3 Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 27. Configuring OpenNebula: The oned.conf file ● Information Drivers, to monitor cluster nodes ● name: identifies the driver ● executable: absolute or relative to $ONE_LOCATION/lib/mads ● arguments: a probe configuration file IM_MAD = [ name = "im_kvm", executable = "one_im_ssh", arguments = "im_kvm/im_kvm.conf" ] ● Transfer Drivers, to interface with the storage ● name: identifies the driver ● executable: path to driver executable ● arguments: storage commands configuration file TM_MAD = [ name = "tm_nfs", executable = "one_tm", arguments = "tm_nfs/tm_nfs.conf" ] Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 28. Configuring OpenNebula: The oned.conf file ● Virtualization Drivers, to interface the hypervisors ● name: identifies the driver ● executable: absolute or relative to $ONE_LOCATION/lib/mads ● arguments: (not needed for the distribution drivers) ● default: default values for the hypervisor ● type: format of the VM description file to be passed to the driver: xen, kvm or xml VM_MAD = [ name = "vmm_kvm", executable = "one_vmm_kvm", default = "vmm_kvm/vmm_kvm.conf", type = "kvm" ] ● Hooks, custom programs that are executed on specific events, e.g. VM creation. ● Hands on... Check and adjust the values of oned.conf for your cloud Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 29. Configuring OpenNebula: Accounts ● Accounts in OpenNebula ● oneadmin, has enough privileges to perform any operation on any object. It is created the first time OpenNebula is started using the ONE_AUTH data ● Regular user accounts must be created by oneadmin and they can only manage their own objects. ● Configuring the oneadmin account ● Environment variables: ONE_AUTH, ONE_LOCATION and ONE_XMLRPC $ tail .bashrc export ONE_LOCATION=/srv/cloud/one export ONE_AUTH=$HOME/.one/one_auth export PATH=$PATH:$ONE_LOCATION/bin ● Create the password file $ mkdir .one $ cd .one $ cat one_auth oneadmin:onecloud Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 30. Configuring OpenNebula: Start & Stop ● Use the one script $ source .bashrc $ echo $ONE_AUTH /srv/cloud/one/.one/one_auth $one start oned and scheduler started $ more $ONE_LOCATION/var/oned.log Thu Jan 14 18:03:11 2010 [ONE][I]: Init OpenNebula Log system Thu Jan 14 18:03:11 2010 [ONE][I]: Log Level: 3 [0=ERROR,1=WARNING,2=INFO,3=DEBUG] Thu Jan 14 18:03:11 2010 [ONE][I]: ------------------------------------ Thu Jan 14 18:03:11 2010 [ONE][I]: OpenNebula Configuration File Thu Jan 14 18:03:11 2010 [ONE][I]: ------------------------------------ Be sure to configure the oneadmin account (specially, create the ONE_AUTH file) before starting OpenNebula for the first time. Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 31. Configuring OpenNebula: Hosts ● Cluster nodes are defined with ● Hostname of the cluster node or IP ● Information Driver to be used to monitor the host ● Storage Driver to clone, delete, move or copy images into the host ● Virtualization Driver to boot, stop, resume VMs in the host ● Cluster nodes are managed with the onehost utility ● Create & delete hosts ● List the hosts in the cluster ● Show detailed information from a host ● Enable/Disable a host Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 32. Configuring OpenNebula: Hosts ● Hands on... configure the hosts of your private cloud $ onehost create 84.21.xx.yy im_kvm vmm_kvm tm_nfs $ onehost create 84.21.xx.yy im_kvm vmm_kvm tm_nfs $ onehost list ID NAME RVM TCPU FCPU ACPU TMEM FMEM STAT 0 84.21.xx.yy 0 0 0 100 0 0 on 1 84.21.xx.zz 0 0 0 100 0 0 on $ tail -f $ONE_LOCATION/var/oned.log Thu Jan 14 18:07:39 2010 [InM][I]: Monitoring host 84.21.xx.yy (0) Thu Jan 14 18:07:39 2010 [InM][I]: Monitoring host 84.21.xx.zz (1) Thu Jan 14 18:07:43 2010 [InM][D]: Host 0 successfully monitored. Thu Jan 14 18:07:44 2010 [InM][D]: Host 1 successfully monitored. $ onehost list ID NAME RVM TCPU FCPU ACPU TMEM FMEM STAT 0 84.21.xx.yy 0 200 184 184 2017004 1848172 on 1 84.21.yy.zz 0 200 200 200 2017004 1857172 on $ onehost show 0 ● Hands on... Explore and test the onehost command in your cloud Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 33. Configuring OpenNebula: Users ● Users are defined within OpenNebula by: ● ID unique identifier for the user ● Name of the user, used for authentication ● Password used for authentication ● Users are managed with the oneuser utility ● Create & delete users ● List the users in the cluster ● Hands on... create new users in your private cloud and configure the “user” UNIX account $ oneuser create helen mypass User “Helen” should put helen:mypass in $ONE_AUTH $ oneuser list UID NAME PASSWORD ENABLE 0 oneadmin c24783ba96a35464632a624d9f829136edc0175e True 2 helen 34a91f713808846ade4a71577dc7963631ebae14 True $ oneuser delete helen Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 34. Configuring OpenNebula: Log Files ● The operations of the OpenNebula daemon and scheduler are logged in: ● oned: $ONE_LOCATION/var/oned.log, Its verbosity is set by DEBUG_LEVEL in $ONE_LOCATION/etc/oned.conf. ● Scheduler (mm_sched): All the scheduler information is collected into the $ONE_LOCATION/var/sched.log file. ● VM logs and files are in $ONE_LOCATION/var/<VM_ID>, more in a few slides... ● Drivers can activate ONE_MAD_DEBUG in the associated RC file (or in $ONE_LOCATION/etc/defaultrc) Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 35. January 2010, CESGA Santiago de Compostela, Spain PART II: Using your Private Cloud Ruben S.Montero (rubensm@dacya.ucm.es) University Complutense of Madrid
  • 36. Using the Private Cloud: Virtual Networks ● A Virtual Network in OpenNebula ● Defines a separated MAC/IP address space to be used by VMs ● Each virtual network is associated with a physical network through a bridge ● Virtual Networks can be isolated (at layer 2 level) with ebtables and hooks ● Virtual Network definition ● Name, of the network ● Type – Fixed, a set of IP/MAC leases – Ranged, defines a network range ● Bridge, name of the physical bridge in the physical host where the VM should connect its network interface. ● Virtual Networks are managed with the onevnet utility Networks created by oneadmin are public, i.e. can be used by VMs of any other user Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 37. Using the Private Cloud: Virtual Networks ● Hands on... $ vi red.net NAME = "Red LAN" TYPE = RANGED BRIDGE = eth0 NETWORK_SIZE = C NETWORK_ADDRESS = 192.168.169.0 $ vi blue.net NAME = "Blue LAN" TYPE = FIXED BRIDGE = eth0 LEASES = [IP=192.168.170.5] LEASES = [IP=192.168.170.10] LEASES = [IP=192.168.170.15] LEASES = [IP=192.168.170.20] LEASES = [IP=192.168.170.25] $ onevnet -v create blue.net $ onevnet -v create red.net ● Hands on... explore the use of onevnet list, show, delete Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 38. Using the Private Cloud: Virtual Networks ● Using a Virtual Network with your VMs ● Define NICs attached to a given virtual network. The VM will get a NIC with a free MAC in the network and attached to the corresponding bridge #A VM with two interfaces each one in a different vlan NIC=[NETWORK="Blue LAN"] NIC=[NETWORK="Red LAN"] #Ask for a specific IP/MAC of the Red vlan NIC=[NETWORK="Red LAN", IP=192.168.0.3] ● Prepare the VM to use the IP. Sample scripts to set the IP based on the MAC are provided for several Linux distributions. IP-MAC address correspondence I P: 10. 0. 1. 2 MAC: 02: 01: 0A: 00: 01: 02 oned.conf IP Address Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 39. Using the Private Cloud: Virtual Machines ● Preparing a VM to be used with OpenNebula ● You can use any VM prepared for the target hypervisor ● Hint I: Place the vmcontext.sh script in the boot process to make better use of vlans ● Hint II: Do not pack useless information in the VM images: – swap. OpenNebula can create swap partitions on-the-fly in the target host – Scratch or volatile storage. OpenNebula can create plain FS on-the- fly in the target host ● Hint III: Install once and deploy many; prepare master images ● Hint IV: Do not put private information (e.g. ssh keys) in the master images, use the CONTEXT ● Hint V: Pass arbitrary data to a master image using CONTEXT Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 40. Using the Private Cloud: Virtual Machines ● Virtual Machine Life-cycle Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 41. Using the Private Cloud: Virtual Machines ● A Virtual Machine in OpenNebula ● A capacity in terms memory and CPU ● A set of NICs attached to one or more virtual networks ● A set of disk images, to be “transfered” to/from the execution host. ● A state file (optional) or recovery file, with the memory image of a running VM plus some hypervisor specific information. ● Virutal Machines are defined in a VM template ● Each VM has an unique ID in OpenNebula the VM_ID ● All the files (logs, images, state files...) are stored in $ONE_LOCATION/var/<VM_ID> Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 42. Using the Private Cloud: Virtual Machines ● Virtual Machine Definition File (VM templates) #--------------------------------------- # Name of the VM #--------------------------------------- NAME = "vm-example" # Optional, Default: one-$VMID #--------------------------------------- # Capacity #--------------------------------------- CPU = "amount_of_requested_CPU" MEMORY = "amount_of_requested_MEM" VCPU = "number of virtual cpus" #--------------------------------------- # OS and boot options #--------------------------------------- OS = [ kernel = "path_to_os_kernel", # para-virtualization initrd = "path_to_initrd_image", # para-virtualization kernel_cmd = "kernel_command_line", root = "device to be mounted as root" bootloader = "path to the boot loader exec” boot = "device to boot from" ] Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 43. Using the Private Cloud: Virtual Machines ● Virtual Machine Definition File (VM templates) #--------------------------------------- # Features of the hypervisor #--------------------------------------- FEATURES = [ pae = "yes|no", # Optional, KVM acpi = "yes|no" ] # Optional, KVM #--------------------------------------- # VM Disks #--------------------------------------- DISK = [ type = "floppy|disk|cdrom|swap|fs|block", source = "path_to_disk_image_file|physical_dev", format = “type for fs disks”, size = "size_in_GB", target = "device_to_map_disk", bus = "ide|scsi|virtio|xen", readonly = "yes|no", clone = "yes|no", save = "yes|no" ] Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 44. Using the Private Cloud: Virtual Machines ● Virtual Machine Definition File (VM templates) #--------------------------------------- # Network Interfaces #--------------------------------------- NIC = [ network = "name_of_the_virtual_network", ip = "ip_address", bridge = "name_of_bridge_to_bind_if", target = "device_name_to_map_if", mac = "HW_address", script = "path_to_script_to_bring_up_if", Model = "NIC model"] #--------------------------------------- # I/O Interfaces #--------------------------------------- INPUT = [ type = "mouse|tablet", bus = "usb|ps2|xen" ] Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 45. Using the Private Cloud: Virtual Machines ● Virtual Machine Definition File (VM templates) #--------------------------------------- # I/O Interfaces #--------------------------------------- GRAPHICS = [ type = "vnc|sdl", listen = "IP-to-listen-on", port = "port_for_VNC_server", passwd = "passwor_for_VNC_server" ] #--------------------------------------- # Raw Hypervisor attributes #--------------------------------------- RAW = [ type = "xen|kvm", data = "raw_domain_configutarion"] Not all the parameters are supported for each hypervisor. Complete reference and examples for all sections in http://www.opennebula.org/doku.php?id=documentation:rel1.4:template Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 46. Using the Private Cloud: Virtual Machines ● Hands on... define a ttylinux VM NAME = ttylinux CPU = 0.1 MEMORY = 64 DISK = [ source = "/srv/cloud/images/ttylinux/ttylinux.img", target = "hda", readonly = "no" ] NIC = [ NETWORK = "Red LAN" ] FEATURES = [ acpi="no" ] #This may be useful to debug your VMs (can use also console) GRAPHICS = [ type = "vnc", listen = "loclahost", port = "5902", keymap="es"] Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 47. Using the Private Cloud: Virtual Machines ● Fix the apparmor libvirt issue for the cluster nodes (bug in 9.10) # tail /etc/apparmor.d/abstractions/libvirt-qemu # https://launchpad.net/bugs/457716 #include <abstractions/private-files-strict> owner @{HOME}/ r, owner @{HOME}/** rw, /srv/cloud/one/var/** rw, # /etc/init.d/apparmor restart Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 48. Using the Private Cloud: Virtual Machines ● Virtual Machines are managed with the onevm utility ● Operations: create, deploy shutdown, livemigrate, stop, cancel, resume, suspend, delete, restart ● Information: list, show, top, history $ onevm create ttylinux.one $ onevm list ID USER NAME STAT CPU MEM HOSTNAME TIME 1 oneadmin ttylinux pend 0 0 00 00:00:28 $ onevm top ● Hands on... ● Create a couple of VMs and check virtual network usage (onevnet) ● Try control operations with the VMs stop, shutdown, migrate, resume... ● Modify the template – Add one more NIC for the Blue network – Add another DISK for VM data (type=”fs”, format=”ext2”) Building Clouds with OpenNebula 1.4 ● Ruben S. Montero
  • 49. Using the Private Cloud: Virtual Machines ● Context contains data to be passed to the VM at boot time #--------------------------------------- # Context for the VM # values can be: # $<template_variable> # $<template_variable>[<attribute>] # $<template_variable>[<attribute>, <attribute2>=<value2>] # $<vm_id>.<context_var> #--------------------------------------- CONTEXT = [ var_1 = "value_1",#Will be in context.sh as var_1=”val_1” (sh syntax) var_n = "value_n",#Will be in context.sh as var_N=”val_N” (sh syntax) files = "space-separated list of paths to include in context device", target= "device to attach the context device" ] Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 50. Using the Private Cloud: Virtual Machines ● Hands on... Add custom ssh keys the VM image ● Check boot process of the ttylinux VM (systemrc.local) it will – mount iso (do it yourself and see the ISO layout...) – Source context.sh – In this example it will execute init.sh so you can try anything CONTEXT = [ files = "/srv/cloud/images/ttylinux/init.sh /srv/cloud/one/.ssh/id_rsa.pub", target = "hdc", root_pubkey = "id_rsa.pub" ] $ more init.sh #!/bin/bash if [ -f /mnt/context/context.sh ] then . /mnt/context/context.sh fi if [ -f /mnt/context/$ROOT_PUBKEY ]; then cat /mnt/context/$ROOT_PUBKEY >> /root/.ssh/authorized_keys fi Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 51. Using the Private Cloud: Virtual Machines ● Tunning the placement of VMs with the Match-making scheduler ● First those hosts that do not meet the VM requirements are filtered out (REQUIREMENTS) ● RANK is evaluated for the remaining hosts ● That with the highest RANK is used for the VM ● Placement policies are specified per VM #--------------------------------------- # Scheduler #--------------------------------------- # Use Host Monitor attributes REQUIREMENTS = "Bool_expression_for_reqs" RANK = "Arith_expression_to_rank_hosts" ● Hands on... try a simple VM pinning REQUIREMENTS = "HOSTNAME=”...”" ● Hands on... try a simple load-aware policy RANK = FREECPU Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 52. January 2010, CESGA Santiago de Compostela, Spain PART III: Using External Cloud Providers (Hybrid Cloud) Ruben S.Montero (rubensm@dacya.ucm.es) University Complutense of Madrid
  • 53. Hybrid Cloud Computing: Overview ● VMs can be local or remote ● VM connectivity has to be configured, usually VPNs ● External Clouds are like any other host ● Placement constraints Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 54. Installing the Hybrid Cloud Components ● OpenNebula distribution includes drivers to build hybrid clouds with Amazon EC2 and Elastic Hosts ● Additional requirements: EC2 libraries and tools # apt-get install ec2-api-tools ec2-ami-tools ● Hands on... try the EC2 tools (ec2-*) $ export EC2_PRIVATE_KEY=/srv/cloud/one/ec2/pk.pem $ export EC2_CERT=/srv/cloud/one/ec2/cert.pem $ ec2-describe-images IMAGE ami-0742a66e /rubensm- amis.s3.amazonaws.com/image.manifest.xml 418314910487 available private i386 machine IMAGE ami-e142a688 rubensm- amis.s3.amazonaws.com/image.manifest.xml 418314910487 available private i386 machine Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 55. Configuring the EC2 Hybrid Cloud Driver ● Hands on... Add the following drivers to oned.conf IM_MAD = [ name = "im_ec2", executable = "one_im_ec2", arguments = "im_ec2/im_ec2.conf" ] # No. of instances of each type VM_MAD = [ name = "vmm_ec2", executable = "one_vmm_ec2", arguments = "vmm_ec2/vmm_ec2.conf", # Defaults, e.g. keypair type = "xml" ] TM_MAD = [ #No actual transfers are made by OpenNebula to EC2 name = "tm_dummy", executable = "one_tm", arguments = "tm_dummy/tm_dummy.conf" ] ● Hands on... Check the values of the driver configurations files Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 56. Configuring the EC2 Hybrid Cloud Driver ● Configure the account to be used with Amazon EC2 $ vim $ONE_LOCATION/etc/vmm_ec2/vmm_ec2rc #---------------------------------------------------------------------- # EC2 API TOOLS Configuration. #---------------------------------------------------------------------- EC2_HOME=/usr EC2_PRIVATE_KEY="/srv/cloud/one/ec2/pk.pem" EC2_CERT="/srv/cloud/one/ec2/cert.pem" ● Restart the OpenNebula daemon, and check that the new drivers are loaded $ one stop; one start $ more $ONE_LOCATION/var/oned.log Fri Jan 15 18:16:46 2010 [VMM][I]: Loading Virtual Machine Manager driv Fri Jan 15 18:16:46 2010 [VMM][I]: Loading driver: vmm_kvm (KVM) Fri Jan 15 18:16:47 2010 [VMM][I]: Driver vmm_kvm loaded. Fri Jan 15 18:16:47 2010 [VMM][I]: Loading driver: vmm_ec2 (XML) Fri Jan 15 00:16:47 2010 [InM][I]: Loading Information Manager drivers. Fri Jan 15 00:16:47 2010 [InM][I]: Loading driver: im_kvm Fri Jan 15 00:16:47 2010 [InM][I]: Driver im_kvm loaded Fri Jan 15 00:16:47 2010 [InM][I]: Loading driver: im_ec2 Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 57. Configuring the EC2 Hybrid Cloud Driver ● Amazon EC2 cloud is manage by OpenNebula as any other cluster node ● You can use several accounts by adding a driver for each account (use the arguments attribute, -k and -c options). Then create a host that uses the driver ● You can use multiple EC2 zones, add a driver for each zone (use the arguments attribute, -u option), and a host that uses that driver ● You can limit the use of EC2 instances by modifying the IM file ● Hands on... Create your EC2 hybrid cloud by adding a new host $ onehost create ec2 im_ec2 vmm_ec2 tm_dummy $ onehost list ID NAME RVM TCPU FCPU ACPU TMEM FMEM STAT 0 84.21.x.y 0 200 200 200 2017004 1667080 on 1 84.21.x.z 1 200 200 200 2017004 1681676 on 2 ec2 0 500 500 500 8912896 8912896 on Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 58. Using the EC2 Hybrid Cloud ● Virtual Machines can be instantiated locally or in EC2 ● The template must provide a description for both instantiation methods. ● The EC2 counterpart of your VM (AMI_ID) must be available for the driver account ● The EC2 VM template attribute: EC2 = [ AMI = "ami_id for this VM", KEYPAIR = "the keypair to use the instance", AUTHORIZED_PORTS = "ports to access the instance", INSTANCETYPE = "m1.small...", ELASTICIP = "the elastic ip for this instance", CLOUD = "host (EC2 cloud) to use this description with" ] Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 59. Using the EC2 Hybrid Cloud ● Hands on... Add an EC2 counterpart to the ttylinux image $vi ttylinux.one #EC2 template machine, this will be use wen submitting this VM to EC2 EC2 = [ AMI="ami-ccf615a5", KEYPAIR="keypair", AUTHORIZED_PORTS="22", INSTANCETYPE=m1.small] #Add this if you want to use only EC2 cloud REQUIREMENTS = "HOSTNAME = "ec2"" ● Hands on... Create the VM and check progress $ onevm create ttylinux.one $ onevm list ID USER NAME STAT CPU MEM HOSTNAME TIME 16 oneadmin one-16 runn 0 0 ec2 00 00:00:35 $ ec2-describe-instances RESERVATION r-5eff7536 418314910487 default INSTANCE i-bac3f0d2 ami-0572946c pending keypair0 m1.small 2010-01-14T23:32:35+0000 us- east-1a aki-a71cf9ce ari-a51cf9cc monitoring- disabled Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 60. Using the EC2 Hybrid Cloud ● Hands on... Log in the EC2 instance when running $ onevm show 17 ... VIRTUAL MACHINE TEMPLATE CPU=0.5 ... EC2=[ AMI=ami-ccf615a5, AUTHORIZED_PORTS=22, INSTANCETYPE=m1.small, KEYPAIR=keypair ] IP=ec2-72-44-62-194.compute-1.amazonaws.com ... REQUIREMENTS=HOSTNAME = "ec2" VMID=17 $ ssh -i keypair.pem root@ec2-72-44-62-194.compute-1.amazonaws.com Linux ip-10-212-134-128 2.6.21.7-2.fc8xen-ec2-v1.0 #2 SMP Tue Sep 1 10:04:29 EDT 2009 i686 root@ip-10-212-134-128:~# This costs money! $ onevm shutdown 17 $ onehost disable ec2 $ onehost list Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 61. January 2010, CESGA Santiago de Compostela, Spain PART IV: Share your Cloud! (Cloud Interfaces) Ruben S.Montero (rubensm@dacya.ucm.es) University Complutense of Madrid
  • 62. The Public Cloud: Overview ● You can use multiple interfaces for the Cloud ● Transparent to your setup: ● Hypervisor ● Storage Model ● Hybrid configuration ● Client tools uses EC2 libraries ● Potential integration with EC2 tools (EC2_URL problems for example) ● Provided in the OpenNebula distribution ● Includes a simple S3 replacement ● Supports HTTP and HTTPS protocols ● EC2 authentication based on OpenNebula credentials ● Public Cloud users need an OpenNebula account Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 63. Installing the Public Cloud Components ● OpenNebula distribution supports two Cloud interfaces: the EC2 Query API and OCCI ● Additional requirements: EC2 development library, web server and web framework # gem install amazon-ec2 # sudo gem install sinatra # sudo gem install thin # gem install sequel # apt-get install curl libcurl3 libcurl4-gnutls-dev libopenssl-ruby # gem install curb # gem install sqlite3-ruby Add a “FQDN” for our Public Cloud # vim /etc/hosts 127.0.0.1 localhost #127.0.1.1 formiga-z 84.21.x.y formiga-z formiga-z.opennebula.org Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 64. Configuring the Public Cloud ● The EC2 service is configured in $ONE_LOCATION/etc/econe.conf ● Hands on... Study the configuration file and adjust it to your cloud $ more econe.conf # OpenNebula administrator user, the one_auth contents USER=oneadmin PASSWORD=onecloud # OpenNebula sever contact information ONE_XMLRPC=http://localhost:2633/RPC2 # Host and port where econe server will run keep FQDNs SERVER=formiga-y.opennebula.org PORT=4567 # Configuration for the image repository # IMAGE_DIR will store the Cloud images, check space! DATABASE=/srv/cloud/one/var/econe.db IMAGE_DIR=/srv/cloud/public_repo/ # VM types allowed and its template file VM_TYPE=[NAME=m1.small, TEMPLATE=m1.small.erb] Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 65. Configuring the Public Cloud ● You have to define the correspondence between types (simple) and local instantiation of VMs (hard, you should be fine by now) ● Capacity allocated by this VM type (CPU, MEMORY) ● Your cloud requirements, e.g. force to use a given kernel (OS) or place public VMs in a given set of cluster nodes (REQUIREMENTS) ● The network used by Public VMs (NIC) ● VM Types are defined in econe.conf. Templates for the VM templates are in $ONE_LOCATION/etc/ec2query_templates ● Templates for VM Types are erb files <% Ruby code here >, you should not need to modify that. Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 66. Configuring the Public Cloud ● Hands on... Prepare the m1.small type of your cloud use ttylinux.one as a reference $ more m1.small.erb NAME = eco-vm CPU = 0.1 MEMORY = 64 DISK = [ source = <%= erb_vm_info[:img_path] %>, clone = yes, target = hda, readonly = no] #You have to create this network, and it should be owned by oneadmin NIC = [ NETWORK = "Red LAN" ] IMAGE_ID = <%= erb_vm_info[:img_id] %> INSTANCE_TYPE = <%= erb_vm_info[:instance_type ]%> Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 67. Configuring the Public Cloud ● Hands on... start the econe server $ unset EC2_URL $ econe-server start $ lsof -i Check $ONE_LOCATION/var/econe-server.log for errors Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 68. Using the Public Cloud ● The econe-tools are a subset of the functionality provided by the onevm utility, and resembles the ec2-* cli ● Image related commands are: ● econe-upload, place an image in the Cloud repo and returns ID ● econe-describe-images, lists the images ● econe-register, register an image not really needed in 1.4 ● Instance related commands are: ● econe-run-instances, starts a VM using an image ID ● econe-describe-instances, lists the VMs ● econe-terminate-instances, shutdowns a VM ● User authentication is based in the OpenNebula credentials ● AWSAccessKeyId is OpenNebula's username ● AWSSecretAccessKey is OpenNebula's password Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 69. Using the Public Cloud ● Pass your credentials to the econe-tools by (in this order) ● Commands arguments (--access-key <username>, --secret-key <pass>) ● Environemt EC2_ACCESS_KEY and EC2_SECRET_KEY ● Environment ONE_AUTH ● Point econe-tools to your target cloud ● Command arguments (--url <http|https>://<fqdn>:<port>) port needed in not the default for the protocol ● EC2_URL environment ● Hands on... upload the ttylinux image, and start it using the public cloud interface. ● Compare the econe-* (public view) and onevm (local view) evolution and information ● Check the template build by the econe server (onevm show) Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 70. Using the Public Cloud $ econe-upload -U http://formiga-x.opennebula.org:4567 --access-key oneadmin --secret-key onecloud /srv/cloud/images/ttylinux/ttylinux.img Success: ImageId 1 $ export EC2_URL="http://formiga-15.opennebula.org:4567" $ econe-describe-images -H Owner ImageId Location ----------------------------------------------------------------------- oneadmin 1 /srv/cloud/public_repo/1 $ econe-run-instances 1 oneadmin 1 18 m1.small $ econe-describe-instances oneadmin 18 1 pending 192.168.169.5 m1.small This is the local view not accessible to public cloud users $ onevm list ID USER NAME STAT CPU MEM HOSTNAME TIME 19 oneadmin eco-vm runn 0 65536 84.21.x.y 00 00:01:34 $ onevm show 19 Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 71. Configuring SSL access for the Public Cloud ● SSL security is handle by a proxy that forwards the request to the EC2 Query Service and takes back the answer to the client ● Requirements: ● A server certificate for the SSL connections ● An HTTP proxy that understands SSL ● EC2Query Service configuration to accept petitions from the proxy ● Hands on... Install the proxy (lighttpd) and get the certificates for your cloud # apt-get install lighttpd # apt-get instatall ssl-cert # /usr/sbin/make-ssl-cert generate-default-snakeoil # cat /etc/ssl/private/ssl-cert-snakeoil.key /etc/ssl/certs/ssl-cert- snakeoil.pem > /etc/lighttpd/server.pem Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 72. Configuring SSL access for the Public Cloud ● Hands on... configure the lighttpd proxy # vim /etc/lighttpd/lighttpd.conf server.modules = ( "mod_access", "mod_alias", "mod_accesslog", "mod_compress", "mod_proxy" ... ## bind to port (default: 80) server.port = 8443 ... #### proxy module proxy.server = ( "" => ("" => ( "host" => "127.0.0.1", "port" => 4567 ) ) ) #### SSL engine ssl.engine = "enable" ssl.pemfile = "/etc/lighttpd/server.pem" server.reject-expect-100-with-417 = "disable" Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 73. Configuring SSL access for the Public Cloud ● Hands on... configure the econe server $ vim /srv/cloud/one/etc/econe.conf #SERVER=formiga-15.opennebula.org SERVER=127.0.0.1 PORT=4567 # SSL proxy that serves the API (set if is being used) SSL_SERVER=formiga-15.opennebula.org ● Hands on... by pass the EC2 library URL checking # sudo vim /var/lib/gems/1.8/gems/amazon-ec2-0.7.9/lib/AWS/EC2.rb Comment out line 12 ● Hands on... restart services (lighttpd and econe-server) and try your new SSL cloud access (https://formiga-x.opennebula.org:8443) Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 74. January 2010, CESGA Santiago de Compostela, Spain PART V: Customizing your Cloud Ruben S. Montero (rubensm@dacya.ucm.es) University Complutense of Madrid
  • 75. Customizing and Extending your Cloud ● You can customize your cloud by: ● Tunning or adapting the transfer operations to your storage back-end ● Adding new monitorization probes to improve the VM placement ● Adjusting VM operations to your hypervisor installation ● Trigger custom actions on specific VM events (e.g. “on VM creation update the accounting DB” or “on VM shutdown send an email”) ● You can extend your cloud by: ● Developing new drivers for other hypervisors ● Developing new drivers for other storage back-ends ● Developing Cloud applications using the OpenNebula API or the Cloud APIs OpenNebula is very scripting friendly, drivers can be written in any language. You can modify the current ones or use them as templates for new ones. Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 76. Customizing the Storage of your Cloud OpenNebula issue generic storage operations (check var/<vm_id>/transfer.*) Transfer Driver process the core script Action programs interpret the semantics of generic actions depending on the storage back.-end Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 77. Customizing the Storage of your Cloud ● OpenNebula requests the following abstract operations over a VM image ● CLONE: This action will basically make a copy of the image from ORIGIN to DESTINATION. ● LN: Creates a symbolic link in DESTINATION that points to ORIGIN ● MKSWAP: Generates a swap image in DESTINATION. The size is given in ORIGIN in MB. ● MKIMAGE: Creates a disk image in DESTINATION and populates it with the files inside ORIGIN directory. ● DELETE: Deletes ORIGIN file or directory. ● MV: Moves ORIGIN to DESTINATION. Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 78. Customizing the Storage of your Cloud ● Actions are defined in $ONE_LOCATION/etc/tm_<storage>/tm_<storage>.conf $ more /srv/cloud/one/etc/tm_ssh/tm_ssh.conf CLONE = ssh/tm_clone.sh LN = ssh/tm_ln.sh MKSWAP = ssh/tm_mkswap.sh MKIMAGE = ssh/tm_mkimage.sh DELETE = ssh/tm_delete.sh MV = ssh/tm_mv.sh ● Actions scripts are placed in $ONE_LOCATION/lib/tm_commands/<storage>/ $ ls /srv/cloud/one/lib/tm_commands/ssh/ tm_clone.sh tm_delete.sh tm_mkimage.sh tm_mv.sh tm_context.sh tm_ln.sh tm_mkswap.sh Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 79. Customizing the Storage of your Cloud ● Hands on... Take a look to the tm_clone.ssh . $TMCOMMON ... log "Creating directory $DST_DIR" exec_and_log "ssh $DST_HOST mkdir -p $DST_DIR" ... case $SRC in http://*) log "Downloading $SRC" exec_and_log "ssh $DST_HOST wget -O $DST_PATH $SRC" ;; *) log "Cloning $SRC" exec_and_log "scp $SRC $DST" ;; esac exec_and_log "ssh $DST_HOST chmod a+w $DST_PATH" ● Hands on... Check the semantics of other operations for the ssh storage, e.g. tm_ln.ssh Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 80. Customizing the Information System ● OpenNebula gets host information by executing an arbitrary number of probes ● A probe is a program that returns the monitorization metric in the form METRIC_NAME = VALUE ● Probes are configured in $ONE_LOCATION/etc/im_<hypervisor>/im_<hypervisor>.conf And placed in $ONE_LOCATION/lib/im_probes ● Probe information is mainly used for VM placement Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 81. Customizing the Information System ● Hands on... Take a look to the default probes defined for KVM $ more /home/ruben/Virtual/one/etc/im_kvm/im_kvm.conf cpuarchitecture=architecture.sh nodename=name.sh cpu=cpu.sh kvm=kvm.rb $ more name.sh #!/bin/sh echo HOSTNAME=`uname -n` ● Hands on... Create a new probe that returns the number of VMs in RUNNING_VMS (e.g. you can use virsh, pgrep kvm...). Use the new metric to pack VMs (RANK=RUNNING_VMS). Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 82. Customization with Hooks: Network Isolation ● IN: Only Ethernet frames from a MAC in Red LAN ● OUT: Only Ethernet frames from the MAC assigned by OpenNebula ● Networks are isolated at layer 2 ● You can put any TCP/IP service as part of the VMs (e.g. DHCP, nagios...) Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 83. Customization with Hooks: Network Isolation ● Requirements (this has to be done in all the cluster nodes) ● Check that ebtables package is installed ● Allow oneadmin to use the ebtables command through sudo #visudo ... oneadmin ALL=(ALL) NOPASSWD: /sbin/ebtables * ... ● Configure the hooks for OpenNebula VM_HOOK = [ name = "ebtables-start", on = "running", command = "/srv/cloud/one/share/hooks/ebtables-kvm", arguments = "one-$VMID", remote = "yes" ] VM_HOOK = [ name = "ebtables-flush", on = "done", command = "/srv/cloud/one/share/hooks/ebtables-flush", arguments = "", remote = "yes" ] Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 84. Customization with Hooks: Network Isolation ● Hands on... Start a couple of VMs in Networks Red and Blue. ● Check the ebtables rules in the hosts ● Check connectivity between VMs ● Change the network mask of the VMs and check connectivity ● Shutdown and check the ebtables rules Building Clouds with OpenNebula 1.4 Ruben S. Montero
  • 85. January 2010, CESGA Santiago de Compostela, Spain Building Clouds with OpenNebula 1.4 Ruben S.Montero (rubensm@dacya.ucm.es) University Complutense of Madrid
  • 86. Summary ● You should be able to: ● Describe the benefits and characteristics of virtual infrastructures and IaaS clouds ● Describe the characteristics and architecture of the different clouds that can be deployed with OpenNebula 1.4 ● Plan and architect a private cloud ● Design, Use and Manage Virtual infrastructures (cloud applications) ● Build public and hybrid clouds ● Adapt OpenNebula 1.4 to your datacenter Building Clouds with OpenNebula 1.4 Ruben S. Montero