You are on page 1of 86

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) Basic usage (networks, VMs) More on usage (VMs, context and scheduling) Configuring an Hybrid Cloud with Amazon EC2 Public Cloud interfaces: The EC2 Query API Advance Topics: Adapt OpenNebula 1.4 to your datacenter
Private Cloud Hybrid Cloud

Day one (January 18th, Afternoon)
● ●

Day two (January 19th, Moorning)

Public Cloud

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 applications) and Manage Virtual infrastructures (cloud

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

4 Ruben S.Cloud Computing in a Nutshell What Software as a Service On-demand access to any application Who End-user (does not care about hw or sw) Platform as a Service Platform for building and delivering web applications Developer (no managing of the underlying hw & swlayers) Infrastructure as a Service ᄎ Delivery of a raw computer infrastructure System Administrator (complete management of the computer infrastructure) In this course Physical Infrastructure Building Clouds with OpenNebula 1. 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 A single user can not get all the resources ● ● Pay-as-you-go ● ● Elastic & “infinite” Capacity Building Clouds with OpenNebula 1. Montero .4 Ruben S.

4 Ruben S.The Anatomy of an IaaS Cloud VM Cloud API (web) VM Service VM VM VM Service VM Virtual Infrastructure Manager (VIM) Network Image Repositories (Storage) Physical Infrastructure Building Clouds with OpenNebula 1. Montero .

Network and Virtualization VM VM VM VM ● ● OpenNebula (VIM) hypervisor hypervisor hypervisor hypervisor Building Clouds with OpenNebula 1..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. Montero .4 Ruben S.

Montero . virtualization and network ● The same host can be can be a the front-end and a node Building Clouds with OpenNebula 1.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.4 Provides physical resources to VMs ● Must have a hypervisor installed ● Ruben S.) ● Modular components to interact with the cluster services ● Types: storage. monitoring..

. /etc.Planning the Installation: Working in the Front-End . ● Choose your installation mode: system wide (/usr. Montero .4 Ruben S.8 libxslt1-dev libxml2-dev # gem install nokogiri SET SYSTEM LOCALES TO ENGLISH (oneadmin should be enough....UTF-8" Building Clouds with OpenNebula 1.) or selfcontained (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...) # cat /etc/default/locale LANG="en_US.

front-end and all the nodes) you can use NIS.). nor in the front-end.one |-.Planning the Installation: Working in the Front-End . move images.cloud |-.g. Need to be defined in OpenNebula 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 ● ● Installation layout ● ● ● # tree /srv /srv/ `-..SRC The oneadmin account must be created system wide (i..4 Ruben S.images `-. ● The Users of the private cloud: ● oneadmin: Account to run the daemons. Users: create and manage their own VMs and networks. manage the system and do all the low-level operations (e.. Montero . Users do not need a UNIX account in the nodes. Building Clouds with OpenNebula 1. start VMs. or a local account with the same ID's in all the hosts.e..

. Montero ...Planning the Installation: Working in the Front-End ..4 Ruben S. # 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. ● Hands on.

A 1TB /srv/cloud will be enough for this example setup. ● Preparing the storage for the private cloud. each VM will require an average of 10GB of disk space. Example: A 64 core cluster will typically run around 80VMs.. 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..g.... Montero .4 Ruben S. ● Image Repository: Any storage medium for the VM images (usually a high performing SAN) – – OpenNebula supports multiple back-ends (e. 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 ● VM Directory: The home of the VM in the cluster node – – – – – Dimensioning the Storage. LVM for fast cloning) The front-end must have access to the repository Stores checkpoints.Planning the Installation: Working in the Front-End . 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.

● Hands on.Planning the Installation: Working in the Front-End .no_subtree_check. Montero . # apt-get install nfs-kernel-server Export /srv/cloud to your nodes .async.d/nfs-kernel-server stop # /etc/init..d/nfs-kernel-server start Building Clouds with OpenNebula 1....no_root_squash) # /etc/init.YY(rw.21.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.XX.4 Ruben S.only need /srv/cloud/one/var .

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. consider the typical requirements of your VMs. Dedicated storage links may be a good idea VM demands.. ● Networking for the private cloud ● OpenNebula management operations uses a ssh connections.4 Ruben S.. Montero . it does not require a performing NIC Image traffic. checkpoints). may require the movement of heavy files (VM images.Planning the Installation: Working in the Front-End .

● 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.intr.rsize=32768.w:/srv/cloud /srv/cloud nfs soft.4 Ruben S...Planning the Installation: Working in the Nodes .wsize=32768.y.z. Montero .rw 0 0 Building Clouds with OpenNebula 1.

and so the ~/. Enter passphrase (empty for no passphrase): Enter same passphrase again: $ cp ~/.ssh/config Host * StrictHostKeyChecking no TEST! $ ssh localhost $ ssh 84.ssh/id_rsa.ssh directory Building Clouds with OpenNebula 1.4 Ruben S.21.yy You may need to exchange keys with the nodes (not here as we share /srv/cloud/one the oneadmin home.ssh/authorized_keys Tell ssh client not to ask to add hosts to known_hosts (optional) $ cat /srv/cloud/one/. .xx... 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.pub ~/.

169.xx 192.168.168.xx.xx 192.169.21.yy VM VM 192.Planning the Installation: The Hypervisor .. Xen and Vmware (even simultaneously).xx Building Clouds with OpenNebula 1.168.xx.170. the physical NIC Physical Host eth0 (bridge) eth0 (bridge) 84.4 .21. ● Installing the Hypervisor ● OpenNebula supports KVM. Install the packages ● ● Setting up KVM and libvirt (Ubuntu Karmic) ● #apt-get install qemu libvirt-bin kvm ● The network set up in this course peth0.. Montero VM VM 192.yy 84.168.170.xx Ruben S. This course applies to KVM and Xen Refer to the hypervisor documentation for additional (and better information) on setting up them.

Execute it in the libvirt-bin start script #vim /etc/libvirt/bridge..bridge..sh #vi /etc/init.d/libvirt-bin . Montero .xml #ifconfig virbr0 down #brctl delbr virbr0 Set up the network for the course (equivalent to a Xen setup) . ● Hands on..4 Ruben S.. then log_daemon_msg "Starting $DESC" "$NAME" /etc/libvirt/set_up_bridge.sh . Building Clouds with OpenNebula 1. case "$1" in start) if check_start_libvirtd_option.. Remove the default bridge in Ubuntu #rm /etc/libvirt/qemu/networks/autostart/default.Planning the Installation: The Hypervisor .sh #chmod +x /etc/libvirt/bridge..sh will create the bridge at boot time (see next slide) ...

4 Ruben S.0.0.Planning the Installation: The Hypervisor .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...xx. then ifdown $1 ip ip ip ip link link link addr set set set add $1 down $1 name p$1 promisc on dev p$1 0. #!/bin/sh create_bridge () { ip link show p$1 > /dev/null 2>&1 if [ $? -ne 0 ] . Montero .0/24 dev peth0 ifup eth0 Building Clouds with OpenNebula 1.21.

. ● 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 .libvirtd oneadmin ● $ virsh list Connecting to uri: qemu:///system Id Name State ---------------------------------Building Clouds with OpenNebula 1.001e4fe05e9f no peth0 ● Add oneadmin to the libvirt group Test the installation for the oneadmin account # usermod -G kvm..Planning the Installation: The Hypervisor .. # brctl show bridge name bridge id STP enabled interfaces eth0 8000.4 Ruben S... peth0 Link encap:Ethernet HWaddr 00:1e:4f:e0:5e:9f .. Montero ...

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

sh -d $ONE_LOCATION Check install.0.org/attachments/download/103/one1.4/ ~/SRC$ scons ● Install the software in /srv/cloud/one (ONE_LOCATION) $ export ONE_LOCATION=/srv/cloud/one/ $ .4.gz ~/SRC$ tar xzvf one-1.tar.desktop include/ lib/ share/ SRC/ var/ ~$ ls -F bin/ etc/ Building Clouds with OpenNebula 1.tar.4 Ruben S./install. Montero .0.sh -h for other options ● Check and explore the installation tree examples.4 ● Grab the source code and compile it! ~/SRC$ wget http://dev.gz ~/SRC$ cd one-1.4.opennebula.Installing OpenNebula 1.

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 DEBUG_LEVEL = 2633 = 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
= = = = "vmm_kvm", "one_vmm_kvm", "vmm_kvm/vmm_kvm.conf", "kvm" ]

VM_MAD = [ name executable default type

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
Ruben S. Montero

Building Clouds with OpenNebula 1.4

one/one_auth PATH=$PATH:$ONE_LOCATION/bin ● ● Configuring the oneadmin account ● $ tail export export export ● Create the password file $ mkdir .4 Ruben S.one $ cd . Environment variables: ONE_AUTH. Montero .bashrc ONE_LOCATION=/srv/cloud/one ONE_AUTH=$HOME/.Configuring OpenNebula: Accounts ● Accounts in OpenNebula ● oneadmin.one $ cat one_auth oneadmin:onecloud Building Clouds with OpenNebula 1. 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. ONE_LOCATION and ONE_XMLRPC . has enough privileges to perform any operation on any object.

Montero .3=DEBUG] Thu Jan 14 18:03:11 2010 [ONE][I]: Thu Jan 14 18:03:11 2010 [ONE][I]: Thu Jan 14 18:03:11 2010 [ONE][I]: Init OpenNebula Log system Log Level: 3 -----------------------------------OpenNebula Configuration File ------------------------------------ Be sure to configure the oneadmin account (specially.4 Ruben S.bashrc $ echo $ONE_AUTH /srv/cloud/one/.1=WARNING.Configuring OpenNebula: Start & Stop ● Use the one script $ source .log Thu Jan 14 18:03:11 2010 [ONE][I]: Thu Jan 14 18:03:11 2010 [ONE][I]: [0=ERROR.one/one_auth $one start oned and scheduler started $ more $ONE_LOCATION/var/oned. Building Clouds with OpenNebula 1. create the ONE_AUTH file) before starting OpenNebula for the first time.2=INFO.

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. stop.4 Ruben S. delete. move or copy images into the host Virtualization Driver to boot. Montero . resume VMs in the host Create & delete hosts List the hosts in the cluster Show detailed information from a host Enable/Disable a host ● ● ● ● Cluster nodes are managed with the onehost utility ● ● ● ● Building Clouds with OpenNebula 1.

yy.21. Montero Building Clouds with OpenNebula 1.yy im_kvm vmm_kvm tm_nfs $ onehost list ID NAME 0 84.zz $ onehost show 0 RVM 0 0 TCPU 200 200 FCPU 184 200 ACPU TMEM FMEM STAT 184 2017004 1848172 on 200 2017004 1857172 on ● Hands on..yy 1 84.21..zz RVM 0 0 TCPU 0 0 FCPU 0 0 ACPU 100 100 TMEM 0 0 FMEM STAT 0 on 0 on $ tail -f $ONE_LOCATION/var/oned.21...zz (1) Thu Jan 14 18:07:43 2010 [InM][D]: Host 0 successfully monitored.21.xx.Configuring OpenNebula: Hosts ● Hands on.21.yy im_kvm vmm_kvm tm_nfs $ onehost create 84. $ onehost list ID NAME 0 84.xx.xx.21.yy 1 84.xx. configure the hosts of your private cloud $ onehost create 84. Thu Jan 14 18:07:44 2010 [InM][D]: Host 1 successfully monitored.log Thu Jan 14 18:07:39 2010 [InM][I]: Monitoring host 84.xx.xx.4 .xx.21.yy (0) Thu Jan 14 18:07:39 2010 [InM][I]: Monitoring host 84. Explore and test the onehost command in your cloud Ruben S.21.

.Configuring OpenNebula: Users ● Users are defined within OpenNebula by: ● ID unique identifier for the user Name of the user.4 Ruben S. used for authentication Password used for authentication Create & delete users List the users in the cluster ● ● ● Users are managed with the oneuser utility ● ● ● Hands on. Montero ENABLE True True . 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 0 oneadmin c24783ba96a35464632a624d9f829136edc0175e 2 helen 34a91f713808846ade4a71577dc7963631ebae14 $ oneuser delete helen Building Clouds with OpenNebula 1..

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

January 2010.Montero (rubensm@dacya. CESGA Santiago de Compostela. Spain PART II: Using your Private Cloud Ruben S.es) University Complutense of Madrid .ucm.

i.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 Name. Montero . a set of IP/MAC leases Ranged. ● Virtual Networks are managed with the onevnet utility Networks created by oneadmin are public.e.4 Ruben S. name of the physical bridge in the physical host where the VM should connect its network interface. defines a network range ● Bridge. can be used by VMs of any other user Building Clouds with OpenNebula 1. of the network Type – – ● ● ● Virtual Network definition ● ● Fixed.

4 .25] $ onevnet -v create blue.170.170.net NAME = "Blue LAN" TYPE = FIXED BRIDGE = eth0 LEASES = [IP=192.168..168. delete Ruben S...170. explore the use of onevnet list.net $ onevnet -v create red. Montero Building Clouds with OpenNebula 1.170.net ● Hands on. $ vi red.10] LEASES = [IP=192.169..168.168.15] LEASES = [IP=192.170.net NAME = "Red LAN" TYPE = RANGED BRIDGE = eth0 NETWORK_SIZE = C NETWORK_ADDRESS = 192.0 $ vi blue.168. show.20] LEASES = [IP=192.5] LEASES = [IP=192.168.Using the Private Cloud: Virtual Networks ● Hands on.

3] ● Prepare the VM to use the IP.conf Building Clouds with OpenNebula 1.168. IP-MAC address correspondence I P: 10.4 IP Address Ruben S.0.Using the Private Cloud: Virtual Networks ● Using a Virtual Network with your VMs ● Define NICs attached to a given virtual network. 2 M AC: 02: 01: 0A: 00: 01: 02 oned. IP=192. 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". 0. Montero . 1. Sample scripts to set the IP based on the MAC are provided for several Linux distributions.

4 Ruben S. use the CONTEXT Hint V: Pass arbitrary data to a master image using CONTEXT ● ● Building Clouds with OpenNebula 1.g. OpenNebula can create plain FS on-thefly in the target host – ● Hint III: Install once and deploy many. OpenNebula can create swap partitions on-the-fly in the target host Scratch or volatile storage.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. ssh keys) in the master images. prepare master images Hint IV: Do not put private information (e. Montero .sh script in the boot process to make better use of vlans Hint II: Do not pack useless information in the VM images: – ● ● swap.

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

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. with the memory image of a running VM plus some hypervisor specific information. to be “transfered” to/from the execution host. images.) are stored in $ONE_LOCATION/var/<VM_ID> ● ● Building Clouds with OpenNebula 1.. A state file (optional) or recovery file.. Montero . ● ● ● ● Virutal Machines are defined in a VM template Each VM has an unique ID in OpenNebula the VM_ID All the files (logs. state files.4 Ruben S.

# para-virtualization initrd = "path_to_initrd_image". 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 kernel_cmd = "kernel_command_line". Montero .Using the Private Cloud: Virtual Machines ● Virtual Machine Definition File (VM templates) #--------------------------------------# Name of the VM #--------------------------------------NAME = "vm-example" # Optional. 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.

"yes|no". "ide|scsi|virtio|xen".Using the Private Cloud: Virtual Machines ● Virtual Machine Definition File (VM templates) #--------------------------------------# Features of the hypervisor #--------------------------------------FEATURES = [ pae = "yes|no".4 . "yes|no" ] Ruben S. "path_to_disk_image_file|physical_dev". KVM #--------------------------------------# VM Disks #--------------------------------------DISK = [ type source format size target bus readonly clone save = = = = = = = = = "floppy|disk|cdrom|swap|fs|block". "size_in_GB". "yes|no". Montero Building Clouds with OpenNebula 1. acpi = "yes|no" ] # Optional. "device_to_map_disk". “type for fs disks”. KVM # Optional.

"HW_address".4 Ruben S. Montero . "name_of_bridge_to_bind_if". "ip_address". "NIC model"] #--------------------------------------# I/O Interfaces #--------------------------------------INPUT = [ type = "mouse|tablet". "device_name_to_map_if".Using the Private Cloud: Virtual Machines ● Virtual Machine Definition File (VM templates) #--------------------------------------# Network Interfaces #--------------------------------------NIC = [ network ip bridge target mac script Model = = = = = = = "name_of_the_virtual_network". "path_to_script_to_bring_up_if". bus = "usb|ps2|xen" ] Building Clouds with OpenNebula 1.

4 Ruben S.org/doku. "port_for_VNC_server". "IP-to-listen-on".opennebula. "passwor_for_VNC_server" ] #--------------------------------------# Raw Hypervisor attributes #--------------------------------------RAW = [ type = "xen|kvm".Using the Private Cloud: Virtual Machines ● Virtual Machine Definition File (VM templates) #--------------------------------------# I/O Interfaces #--------------------------------------GRAPHICS type listen port passwd = = = = = [ "vnc|sdl". data = "raw_domain_configutarion"] Not all the parameters are supported for each hypervisor.4:template Building Clouds with OpenNebula 1.php?id=documentation:rel1. Montero . Complete reference and examples for all sections in http://www.

readonly = "no" ] NIC = [ NETWORK = "Red LAN" ] FEATURES = [ acpi="no" ] #This may be useful to debug your VMs (can use also console) GRAPHICS = [ type = "vnc"..1 MEMORY = 64 DISK = [ source = "/srv/cloud/images/ttylinux/ttylinux.img". keymap="es"] Building Clouds with OpenNebula 1. listen = "loclahost". Montero . port = "5902".. define a ttylinux VM NAME = ttylinux CPU = 0.Using the Private Cloud: Virtual Machines ● Hands on. target = "hda".4 Ruben S.

d/apparmor restart Building Clouds with OpenNebula 1.4 Ruben S. # /etc/init. owner @{HOME}/** rw.10) # tail /etc/apparmor.net/bugs/457716 #include <abstractions/private-files-strict> owner @{HOME}/ r.Using the Private Cloud: Virtual Machines ● Fix the apparmor libvirt issue for the cluster nodes (bug in 9.d/abstractions/libvirt-qemu # https://launchpad. Montero . /srv/cloud/one/var/** rw.

. shutdown. history ● $ onevm create ttylinux.. format=”ext2”) Ruben S. migrate. suspend. stop.4 ● . Montero Building Clouds with OpenNebula 1. ● Create a couple of VMs and check virtual network usage (onevnet) Try control operations with the VMs stop.Using the Private Cloud: Virtual Machines ● Virtual Machines are managed with the onevm utility ● Operations: create. deploy shutdown. Modify the template – – ● ● Add one more NIC for the Blue network Add another DISK for VM data (type=”fs”. show.one $ onevm list ID USER NAME STAT CPU 1 oneadmin ttylinux pend 0 $ onevm top ● MEM 0 HOSTNAME TIME 00 00:00:28 Hands on. top. delete.. resume. resume. livemigrate.. cancel. restart Information: list.

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>.#Will be in context.#Will be in context. <attribute2>=<value2>] # $<vm_id>.4 Ruben S.<context_var> #--------------------------------------CONTEXT = [ var_1 = "value_1". target= "device to attach the context device" ] Building Clouds with OpenNebula 1.sh as var_1=”val_1” (sh syntax) var_n = "value_n". Montero .sh as var_N=”val_N” (sh syntax) files = "space-separated list of paths to include in context device".

pub".pub" ] $ more init.sh #!/bin/bash if [ -f /mnt/context/context.) Source context..sh so you can try anything CONTEXT = [ files = "/srv/cloud/images/ttylinux/init. then cat /mnt/context/$ROOT_PUBKEY >> /root/.ssh/id_rsa. /mnt/context/context.4 Ruben S.sh In this example it will execute init..ssh/authorized_keys fi Building Clouds with OpenNebula 1.sh /srv/cloud/one/..sh fi if [ -f /mnt/context/$ROOT_PUBKEY ].Using the Private Cloud: Virtual Machines ● Hands on.sh ] then .local) it will – – – mount iso (do it yourself and see the ISO layout. Add custom ssh keys the VM image ● Check boot process of the ttylinux VM (systemrc.. Montero . target = "hdc". root_pubkey = "id_rsa.

..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.4 . Montero REQUIREMENTS = "HOSTNAME=\”. try a simple VM pinning Hands on...\”" ● RANK = FREECPU Building Clouds with OpenNebula 1. try a simple load-aware policy Ruben S...

January 2010. CESGA Santiago de Compostela. Spain PART III: Using External Cloud Providers (Hybrid Cloud) Ruben S.Montero (rubensm@dacya.es) University Complutense of Madrid .ucm.

4 Ruben S. usually VPNs ● External Clouds are like any other host ● Placement constraints ● Building Clouds with OpenNebula 1.Hybrid Cloud Computing: Overview VMs can be local or remote ● VM connectivity has to be configured. Montero .

amazonaws.amazonaws.. try the EC2 tools (ec2-*) ● # apt-get install ec2-api-tools ec2-ami-tools ● $ export EC2_PRIVATE_KEY=/srv/cloud/one/ec2/pk.4 Ruben S.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 Hands on.manifest..manifest.com/image.pem $ export EC2_CERT=/srv/cloud/one/ec2/cert.com/image.s3.pem $ ec2-describe-images IMAGE ami-0742a66e /rubensmamis. Montero .xml 418314910487 available private i386 machine IMAGE ami-e142a688 rubensmamis.s3.xml 418314910487 available private i386 machine Building Clouds with OpenNebula 1.

keypair "xml" ] TM_MAD = [ #No actual transfers are made by OpenNebula to EC2 name = "tm_dummy".conf".4 Ruben S. Add the following drivers to oned. # Defaults. executable = "one_tm"..g.conf IM_MAD = [ name = "im_ec2".. Check the values of the driver configurations files Building Clouds with OpenNebula 1. Montero . of instances of each type VM_MAD = [ name executable arguments type = = = = "vmm_ec2". arguments = "im_ec2/im_ec2. e. "vmm_ec2/vmm_ec2.Configuring the EC2 Hybrid Cloud Driver ● Hands on. executable = "one_im_ec2"..conf" ] # No.conf" ] ● Hands on.. "one_vmm_ec2". arguments = "tm_dummy/tm_dummy.

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.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 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.pem" EC2_CERT="/srv/cloud/one/ec2/cert. Montero .4 Ruben S. and check that the new drivers are loaded $ one stop.pem" ● Restart the OpenNebula daemon. one start $ more $ONE_LOCATION/var/oned.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.

y 1 84..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. Then create a host that uses the driver You can use multiple EC2 zones.x. Montero . and a host that uses that driver You can limit the use of EC2 instances by modifying the IM file ● ● ● Hands on. add a driver for each zone (use the arguments attribute..21. Create your EC2 hybrid cloud by adding a new host $ onehost create ec2 im_ec2 vmm_ec2 tm_dummy $ onehost list ID NAME 0 84.x.z 2 ec2 RVM 0 1 0 TCPU 200 200 500 FCPU 200 200 500 ACPU TMEM FMEM STAT 200 2017004 1667080 on 200 2017004 1681676 on 500 8912896 8912896 on Building Clouds with OpenNebula 1.4 Ruben S. -u option). -k and -c options).21.

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

4 Ruben S.one #EC2 template machine. INSTANCETYPE=m1. Create the VM and check progress $ onevm create ttylinux. AUTHORIZED_PORTS="22".. Add an EC2 counterpart to the ttylinux image $vi ttylinux.Using the EC2 Hybrid Cloud ● Hands on..small 2010-01-14T23:32:35+0000 useast-1a aki-a71cf9ce ari-a51cf9cc monitoringdisabled Building Clouds with OpenNebula 1. KEYPAIR="keypair"...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. this will be use wen submitting this VM to EC2 EC2 = [ AMI="ami-ccf615a5". Montero .small] #Add this if you want to use only EC2 cloud REQUIREMENTS = "HOSTNAME = \"ec2\"" ● Hands on.

. Montero ..amazonaws.21. REQUIREMENTS=HOSTNAME = "ec2" VMID=17 $ ssh -i keypair...com Linux ip-10-212-134-128 2.. INSTANCETYPE=m1. Log in the EC2 instance when running $ onevm show 17 . AUTHORIZED_PORTS=22.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...compute-1.4 Ruben S.small.7-2.fc8xen-ec2-v1.6.compute-1.. EC2=[ AMI=ami-ccf615a5. KEYPAIR=keypair ] IP=ec2-72-44-62-194.amazonaws.5 .pem root@ec2-72-44-62-194.com .Using the EC2 Hybrid Cloud ● Hands on. VIRTUAL MACHINE TEMPLATE CPU=0.

Spain PART IV: Share your Cloud! (Cloud Interfaces) Ruben S.es) University Complutense of Madrid .Montero (rubensm@dacya.ucm. CESGA Santiago de Compostela.January 2010.

Montero .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.

x. 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.4 Ruben S.0.0.org Building Clouds with OpenNebula 1.Installing the Public Cloud Components ● OpenNebula distribution supports two Cloud interfaces: the EC2 Query API and OCCI Additional requirements: EC2 development library. Montero .21.y formiga-z formiga-z.1 formiga-z 84.1 localhost #127.1.opennebula.

Configuring the Public Cloud ● The EC2 service is configured in $ONE_LOCATION/etc/econe..opennebula.small.erb] Building Clouds with OpenNebula 1.conf Hands on.small. check space! DATABASE=/srv/cloud/one/var/econe. Study the configuration file and adjust it to your cloud ● $ more econe..db IMAGE_DIR=/srv/cloud/public_repo/ # VM types allowed and its template file VM_TYPE=[NAME=m1.org PORT=4567 # Configuration for the image repository # IMAGE_DIR will store the Cloud images. TEMPLATE=m1.4 Ruben S. 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. Montero .conf # OpenNebula administrator user.

Configuring the Public Cloud ● You have to define the correspondence between types (simple) and local instantiation of VMs (hard. MEMORY) Your cloud requirements. you should not need to modify that. 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. you should be fine by now) ● Capacity allocated by this VM type (CPU. Templates for the VM templates are in $ONE_LOCATION/etc/ec2query_templates Templates for VM Types are erb files <% Ruby code here >. e.4 Ruben S. ● Building Clouds with OpenNebula 1. Montero .conf.g.

hda. 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. yes. Montero .1 MEMORY = 64 DISK = [ source clone target readonly = = = = <%= erb_vm_info[:img_path] %>. no] #You have to create this network.one as a reference $ more m1..Configuring the Public Cloud ● Hands on. Prepare the m1.4 Ruben S.small.small type of your cloud use ttylinux..erb NAME = eco-vm CPU = 0.

.Configuring the Public Cloud ● Hands on.log for errors Building Clouds with OpenNebula 1. start the econe server $ unset EC2_URL $ econe-server start $ lsof -i Check $ONE_LOCATION/var/econe-server. Montero .4 Ruben S..

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

4 Ruben S. --secret-key <pass>) Environemt EC2_ACCESS_KEY and EC2_SECRET_KEY Environment ONE_AUTH Command arguments (--url <http|https>://<fqdn>:<port>) port needed in not the default for the protocol EC2_URL environment ● ● ● Point econe-tools to your target cloud ● ● ● Hands on.Using the Public Cloud ● Pass your credentials to the econe-tools by (in this order) ● Commands arguments (--access-key <username>. upload the ttylinux image. ● 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.. Montero . and start it using the public cloud interface..

5 m1. Montero .Using the Public Cloud $ econe-upload -U http://formiga-x.org:4567" $ econe-describe-images -H Owner ImageId Location ----------------------------------------------------------------------oneadmin 1 /srv/cloud/public_repo/1 $ econe-run-instances 1 oneadmin 1 $ econe-describe-instances oneadmin 18 1 192.y 00 00:01:34 $ onevm show 19 Building Clouds with OpenNebula 1.4 Ruben S.x.img Success: ImageId 1 $ export EC2_URL="http://formiga-15.small pending 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.org:4567 --access-key oneadmin --secret-key onecloud /srv/cloud/images/ttylinux/ttylinux.21.168.169.opennebula.small 18 m1.opennebula.

pem Building Clouds with OpenNebula 1.key /etc/ssl/certs/ssl-certsnakeoil.. 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.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.pem > /etc/lighttpd/server.

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

opennebula.0. Montero .8/gems/amazon-ec2-0.1 PORT=4567 # SSL proxy that serves the API (set if is being used) SSL_SERVER=formiga-15.9/lib/AWS/EC2.rb Comment out line 12 ● Hands on.org SERVER=127. by pass the EC2 library URL checking # sudo vim /var/lib/gems/1.0..org ● Hands on..org:8443) Building Clouds with OpenNebula 1.opennebula. restart services (lighttpd and econe-server) and try your new SSL cloud access (https://formiga-x.opennebula...conf #SERVER=formiga-15.7.. configure the econe server $ vim /srv/cloud/one/etc/econe.4 Ruben S.Configuring SSL access for the Public Cloud ● Hands on..

es) University Complutense of Madrid . CESGA Santiago de Compostela.January 2010. Spain PART V: Customizing your Cloud Ruben S.ucm. Montero (rubensm@dacya.

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. You can modify the current ones or use them as templates for new ones. Building Clouds with OpenNebula 1. “on VM creation update the accounting DB” or “on VM shutdown send an email”) 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 ● ● ● ● You can extend your cloud by: ● ● ● OpenNebula is very scripting friendly. drivers can be written in any language. Montero .4 Ruben S.g.

-end Building Clouds with OpenNebula 1. Montero .Customizing the Storage of your Cloud OpenNebula issue generic storage operations (check var/<vm_id>/transfer.4 Ruben S.*) Transfer Driver process the core script Action programs interpret the semantics of generic actions depending on the storage back.

● ● ● ● ● Building Clouds with OpenNebula 1. The size is given in ORIGIN in MB. MKIMAGE: Creates a disk image in DESTINATION and populates it with the files inside ORIGIN directory. Montero .4 Ruben S.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. MV: Moves ORIGIN to DESTINATION. LN: Creates a symbolic link in DESTINATION that points to ORIGIN MKSWAP: Generates a swap image in DESTINATION. DELETE: Deletes ORIGIN file or directory.

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

$TMCOMMON ...g.ssh . esac exec_and_log "ssh $DST_HOST chmod a+w $DST_PATH" ● Hands on. Check the semantics of other operations for the ssh storage. tm_ln....Customizing the Storage of your Cloud ● Hands on..ssh Ruben S. case $SRC in http://*) log "Downloading $SRC" exec_and_log "ssh $DST_HOST wget -O $DST_PATH $SRC" . Montero Building Clouds with OpenNebula 1. log "Creating directory $DST_DIR" exec_and_log "ssh $DST_HOST mkdir -p $DST_DIR" . Take a look to the tm_clone.. e. *) log "Cloning $SRC" exec_and_log "scp $SRC $DST" .4 ....

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>. Montero .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.

.Customizing the Information System ● Hands on.). Create a new probe that returns the number of VMs in RUNNING_VMS (e..sh kvm=kvm.. Take a look to the default probes defined for KVM $ more /home/ruben/Virtual/one/etc/im_kvm/im_kvm.sh cpu=cpu.sh #!/bin/sh echo HOSTNAME=`uname -n` ● Hands on. Montero .4 Ruben S..conf cpuarchitecture=architecture..g. you can use virsh. Use the new metric to pack VMs (RANK=RUNNING_VMS).sh nodename=name..rb $ more name. Building Clouds with OpenNebula 1. pgrep kvm.

g.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. nagios... DHCP.) ● Building Clouds with OpenNebula 1.

"one-$VMID".. "yes" ] "ebtables-flush". "done". "".4 .. "yes" ] Ruben S. Montero VM_HOOK = [ name on command arguments remote VM_HOOK = [ name on command arguments remote Building Clouds with OpenNebula 1.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 . "/srv/cloud/one/share/hooks/ebtables-flush". "/srv/cloud/one/share/hooks/ebtables-kvm".. "running". ● ALL=(ALL) NOPASSWD: /sbin/ebtables * Configure the hooks for OpenNebula = = = = = = = = = = "ebtables-start".. oneadmin .

.Customization with Hooks: Network Isolation ● Hands on. ● 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. Start a couple of VMs in Networks Red and Blue.. Montero .

ucm. Spain Building Clouds with OpenNebula 1.es) University Complutense of Madrid .4 Ruben S.Montero (rubensm@dacya.January 2010. CESGA Santiago de Compostela.

Use applications) and Manage Virtual infrastructures (cloud ● ● ● ● Build public and hybrid clouds Adapt OpenNebula 1.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.4 to your datacenter ● Building Clouds with OpenNebula 1.4 Ruben S. Montero .