Professional Documents
Culture Documents
Installing and Basic Usage: Opennebula Cloud Management Platform
Installing and Basic Usage: Opennebula Cloud Management Platform
Installing and Basic Usage: Opennebula Cloud Management Platform
Innovative Open Source Technologies and Professional Services to Build your Enterprise-ready Cloud Computing Environment
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
! 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
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
!! Start Services
# # # # service service service service nfs start libvirtd start opennebula start opennebula-sunstone start
Manage Users Manage Groups Manage ACLs Manage Hosts Manage Clusters Manage Networks Manage Datastores
Manage Images Manage Templates Manage VMs Accounting Tool Marketplace Tool DB Tool
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
10
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)
13
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
14
# Wait for ON ... and then CTRL-C $ $ $ $ ssh node2 ls onehost show onehost show onehost show ld /var/tmp/one node2 1 -x 1
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:
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:
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
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
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!
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" ]
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
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.
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.
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
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
28
Questions?
We Will Be Happy to Clarify Any Question
29