Installing and Basic Usage: Opennebula Cloud Management Platform

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 29

OpenNebula Cloud Management Platform >

Innovative Open Source Technologies and Professional Services to Build your Enterprise-ready Cloud Computing Environment

Installing and Basic Usage

C12G Labs S.L.

Rev20130919

All of the material in this Tutorial is copyright-protected and may not be published in other works without express written permission from C12G Labs. All trademarks are property of their respective owners.
C12G Labs S.L. 1/15

Agenda
Installing and Basic Usage

!! Planning the Installation !! Installation (node 1 - Frontend) !! Installation (node 2 - Worker Node) !! Configuration !! Basic Usage !! Managing Hosts !! Images, Networks, Templates and VMs !! Managing Users, Quotas and ACLs !! Logging & Debugging

Installing and Basic Usage

A Typical OpenNebula Environment


Planning the Installation Monitoring,Virtualization, Storage and Network

! Repository of VM images ! Multiple Backends (LVM, Ceph)

! Provides physical resources for the VMs ! Must have a hypervisor installed
Installing and Basic Usage 3

Virtual Lab
Planning the Installation

NODE 1

NODE 2

Installing and Basic Usage

Required Software
Installing

!! Head node !! ssh, ruby !! OpenNebula: oned, mm_sched, sunstone, !! Worker nodes !! Hypervisor (KVM, Xen or VMWare) !! ssh, ruby (Xen & KVM) !! Optional !! Storage Backends (LVM, iSCSI, Ceph, ) !! Networking systems (VLAN, Open vSwitch, ) !! Ganglia, LDAP, Apache, Nginx
Installing and Basic Usage 5

Installation node 1 - Frontend


Installing

Hands on (node1) ! !! Activate repo and Install Packages


# cp /var/tmp/tutorial/opennebula.repo /etc/ yum.repos.d/ # yum install opennebula-server opennebula-sunstone opennebula-node-kvm opennebula-flow

!! Add QEMU drivers


# sed -i 's/"kvm" ]/"qemu" ]/' /etc/one/oned.conf

!! Configure NFS Server


# cat /etc/exports
/var/lib/one *(rw,sync,no_subtree_check,root_squash,anonuid=9869,anongid=9869)
Installing and Basic Usage 6

Installation node 1 - Frontend


Installing

Hands on (node1) ! !! Configure Sunstone


# sed -i 's/127.0.0.1/0.0.0.0/' /etc/one/sunstone-server.conf

!! Start Services
# # # # service service service service nfs start libvirtd start opennebula start opennebula-sunstone start

!! Quick overview of the CLI


# # $ $ gpasswd -a oneadmin wheel su - oneadmin oneuser show oneuser -help
7

Installing and Basic Usage

Installation node 1 - Frontend


Installing

Hands on (node1) ! !! OpenNebula CLI Commands


$ one[TAB]

oneuser onegroup oneacl onehost onecluster onevnet onedatastore

Manage Users Manage Groups Manage ACLs Manage Hosts Manage Clusters Manage Networks Manage Datastores

oneimage onetemplate onevm oneacct onemarket onedb

Manage Images Manage Templates Manage VMs Accounting Tool Marketplace Tool DB Tool

Installing and Basic Usage

Installation node 2 Worker Node


Installing

Hands on (node2) ! !! Activate repo and Install Packages


# cp /var/tmp/tutorial/opennebula.repo /etc/ yum.repos.d/ # yum install opennebula-node-kvm

!! Configure Network, Hostname, NFS and sudo


# echo HOSTNAME=node2 > /etc/sysconfig/network # hostname node2 # sed -i 's/1.1.1.1/1.1.1.2/' /etc/sysconfig/networkscripts/ifcfg-br1 # ifconfig br1 1.1.1.2/24 up # mount t nfs 1.1.1.1:/var/lib/one /var/lib/one # gpasswd -a oneadmin wheel # service libvirtd start
Installing and Basic Usage 9

Configure Password-less SSH


Installing

Hands on! (always node1 from now on) !! OpenNebula needs passwordless ssh access to all the nodes from all the nodes:
# (as oneadmin) $ ssh-keyscan node1 node2 > ~/.ssh/known_hosts # test it! $ $ $ $ ssh node2 exit ssh node1 exit

Installing and Basic Usage

10

Get User Information - Sunstone


Installing

!! Get the Sunstone Login information


# (as oneadmin) $ cat ~/.one/one_auth oneadmin:<password>

!! Try out sunstone! http://localhost:9869

Installing and Basic Usage

11

oned.conf
Configuration

/etc/one/oned.conf (open this file and take a look!) !!OpenNebula Daemon: !!LOG, PORT, DB !!Monitoring Intervals: MANAGER_TIMER, MONITORING_INTERVAL !!Configuration options for VMs: !!VNC_BASE_PORT !!MAC_PREFIX (MAC ! IP) !!DEFAULT_DEVICE_PREFIX = "hd (or vd, xvd, etc) !!Drivers: !!IM_MAD, VMM_MAD, TM_MAD, DATASTORE_MAD, HM_MAD, AUTH_MAD !!Resources: !!DEFAULT_UMASK !!VM_RESTRICTED_ATTR, IMAGE_RESTRICTED_ATTR
Installing and Basic Usage 12

sched.conf
Configuration

/etc/one/sched.conf (open this file and take a look!) !!Scheduler Daemon: !!ONED_PORT, SCHED_INTERVAL, LOG !!Dispatch Options !!MAX_VM, MAX_DISPATCH, MAX_HOST, LIVE_RESCHEDS !!Policy !!DEFAULT_SCHED (packing, striping, load-aware, custom)

Installing and Basic Usage

13

Adding Hosts - Sunstone


Basic Usage Hosts

Hands on! (Sunstone) !!Create one host in Sunstone: node1 !!Virtualization: KVM !!Information: KVM !!Network: dummy !!Cluster: dummy !!Watch transition INIT " ON !!Click on the row for more information !!Automatic gathering of monitoring data !!Take a look at the graphs

Installing and Basic Usage

14

Adding Hosts - CLI


Basic Usage Hosts

Hands on! (CLI) (always as oneadmin in the Frontend node 1)


$ onehost help $ onehost create help $ $ $ $ ssh node2 ls ld /var/tmp/one onehost create node2 -i kvm -v kvm -n dummy onehost list onehost top

# Wait for ON ... and then CTRL-C $ $ $ $ ssh node2 ls onehost show onehost show onehost show ld /var/tmp/one node2 1 -x 1

Installing and Basic Usage

15

Adding Images
Basic Usage Images

Hands on! (Sunstone) !!Create an Image in Sunstone !!Name: tty !!Provide a Path: /var/tmp/tutorial/ttylinux.qcow2.img !!Advanced " Driver: qcow2 !!Datastore: default !!Create! !!Watch transition LOCKED " READY !!Ownership and Permissions (ala Unix!), Size, Driver... Hands on! (CLI)
$ oneimage list $ oneimage show tty # DO NOT EXECUTE THE FOLLOWING COMMAND $ oneimage create --name tty --driver qcow2 --path /var/tmp/tutorial/ttylinux.qcow2.img -d default Installing and Basic Usage

16

System Datastore
Basic Usage Datastores

Hands on! (Sunstone) !!Inspect each Datastore: !!The system datastore: !!Holds images for running VMs !!The TM_MAD (transfer manager driver) is shared which means:

Installing and Basic Usage

17

Shared Datastore
Basic Usage Datastores

Hands on! (Sunstone) !!The default datastore: !!Holds images ready to be cloned or linked for VMs !!The DS_MAD is fs because our image is a regular file !!The TM_MAD (transfer manager driver) is shared which means:

Installing and Basic Usage

18

Adding Networks
Basic Usage Networks

Hands on! (Sunstone) !!Create a new Network !!Name: private !!Type: Fixed Network !!IP: 192.168.0.1 -> [ENTER] -> repeat ... -> 192.168.0.4 !!Network Model: default !!Bridge: br1

VM

VM

VM

VM

br1 eth1 Node 1


Installing and Basic Usage

br1 eth1 Node 2


19

Adding Networks
Basic Usage Networks

Hands on! (Sunstone) !!Network extended information: !!Lease Management " Add, Hold and Remove Leases Hands on! (CLI)
$ cat private2.net NAME = private2 TYPE = fixed BRIDGE = br1 LEASES = [ IP = 10.0.0.1 ] LEASES = [ IP = 10.0.0.2 ] $ $ $ $ $ onevnet onevnet onevnet onevnet onevnet create private2 list show private addleases private 192.168.0.105 hold private 192.168.0.105
20

Installing and Basic Usage

Adding Templates
Basic Usage Template

Hands on! (Sunstone) !!A template is a Virtual Machine definition ready to be instantiated !!It has CPU, Memory, Disks, NIC, Graphical Ports, etc... !!Create a new Template: !!Name: ttylinux !!CPU: 0.1 !!Memory: 64M !!Storage: tty !!Network: private !!Input/Output: VNC + Keymap !!Random values in Context " Custom Variables !!Create!

Installing and Basic Usage

21

Adding Templates
Basic Usage Template

Hands on! (CLI) !!Try the useful --dry option in the CLI
$ onetemplate create --help $ onetemplate create --name ttylinux --cpu 0.1 \ --memory 64 --disk tty --nic private --vnc --dry NAME="ttylinux CPU=0.1 MEMORY=64 DISK=[ IMAGE="tty ] NIC=[ NETWORK="private ] GRAPHICS=[ TYPE="vnc", LISTEN="0.0.0.0" ]

Installing and Basic Usage

22

Instantiating
Basic Usage VMs

Hands on! (Sunstone) !!Instantiate the template !!Deploy 2 VMs !!Leave the name blank !!Watch the transition PENDING " RUNNING !!In which host is running each VM? !!vnc ( root / password) !!ifconfig " configured using context !!migrate !!live-migrate !!ping the other machine

Installing and Basic Usage

23

Main VM actions
Basic Usage VMs

suspend power off (--hard) stop undeploy (--hard) reboot (--hard) delete --recreate shutdown (--hard) delete

VM state saved. Kept in the host. Powers off a VM. Kept in the host. VM state saved. Taken to the system datastore. Powers off a VM. Taken to the system datastore. Reboots the VM. Cleans the VM and moves it to PENDING. Powers off a VM, cleans host and VM is removed from OpenNebula. VM is immediately destroyed regardless of state. Recommended only for oneadmin.

Installing and Basic Usage

24

Other VM actions
Basic Usage VMs

Hands on! (Sunstone) !!VM extended information tab !!Capacity - Resize VM capacity !!Storage - Attach new disk !!Network - Attach new nic !!create a new network " attach nic " reboot !!Snapshot !!create a file using VNC !!Take snapshot !!Modify the file !!Revert !!Placement !!Actions - Schedule action !!Template !!Log
Installing and Basic Usage 25

Managing Users
Basic Usage Users

Hands on! (Sunstone) !!Create new user: testuser / testpass !!Click on new user " Update Quotas !!Enforce 1 Max VMs " Add/edit quota !!Other possible options !!limit the use of a Datastore !!limit the use of an Image !!limit the use of a Network !!Apply changes! !!Create new ACL !!We can customize any rule extending the functionality provided by the Unix ownership/group/permissions schema.

Installing and Basic Usage

26

Logs
Basic Usage Logging and Debugging

!!Logs are kept under /var/log/one !!oned.log: all the information related to the oned daemon. Every request, actions and driver errors will be here. The verbosity is set by DEBUG_LEVEL in /etc/one/oned.conf !!sched.log:has all the information related to the placement of Virtual Machines. If a VM is not being deployed (kept in PENDING state), this log will explain why. !!<id>.log: the log of each VM. Also accessible through Sunstone. !!To activate driver logs, enable ONE_MAD_DEBUG in /etc/one/defaultrc

Installing and Basic Usage

27

Other Features
Other Key Features in OpenNebula

!!Appliance Marketplace !!Catalog of virtual appliances !!Integrated with Sunstone !!Deployable in Private Cloud !!Hybrid Cloud Computing !!AWS connector that enables Cloud-Bursting !!Service Management (OneFlow) !!Automatic execution and scaling of multi-tiered applications !!Gain insight cloud applications !!Virtual Data Centers !!Fully-isolated virtual infrastructures !!Fedaration of multiple OpenNebula Zones !!Fine-Grained Accounting

Installing and Basic Usage

28

Questions?
We Will Be Happy to Clarify Any Question

Installing and Basic Usage

29

You might also like