3. 3Installing and Basic Usage
A Typical OpenNebula Environment
Planning the Installation
• Repository of VM images
• Multiple Backends (LVM, Ceph)
Monitoring,Virtualization,
Storage and Network
• Provides physical resources for the VMs
• Must have a hypervisor installed
9. 9Installing and Basic Usage
Installation node 2 – Worker Node
Installing
Hands on (node2) !
● Activate repo and Install Packages
● Configure Network, Hostname, NFS and sudo
# cp /var/tmp/tutorial/opennebula.repo /etc/
yum.repos.d/
# yum install opennebula-node-kvm
# echo HOSTNAME=node2 > /etc/sysconfig/network
# hostname node2
# sed -i 's/1.1.1.1/1.1.1.2/' /etc/sysconfig/network-
scripts/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
10. 10Installing and Basic Usage
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
11. 11Installing and Basic Usage
Get User Information - Sunstone
Installing
● Get the Sunstone Login information
● Try out sunstone! http://localhost:9869
# (as oneadmin)
$ cat ~/.one/one_auth
oneadmin:<password>
12. 12Installing and Basic Usage
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
13. 13Installing and Basic Usage
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)
14. 14Installing and Basic Usage
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
15. 15Installing and Basic Usage
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 –ld /var/tmp/one
$ onehost show node2
$ onehost show 1
$ onehost show -x 1
16. 16Installing and Basic Usage
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
17. 17Installing and Basic Usage
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:
18. 18Installing and Basic Usage
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:
19. 19Installing and Basic Usage
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
br1
VM VM
Node 1
eth1
br1
Node 2
eth1
VM VM
20. 20Installing and Basic Usage
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 create private2
$ onevnet list
$ onevnet show private
$ onevnet addleases private 192.168.0.105
$ onevnet hold private 192.168.0.105
21. 21Installing 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!
23. 23Installing and Basic Usage
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
24. 24Installing and Basic Usage
Main VM actions
Basic Usage – VMs
suspend VM state saved. Kept in the host.
power off (--hard) Powers off a VM. Kept in the host.
stop VM state saved. Taken to the system datastore.
undeploy (--hard) Powers off a VM. Taken to the system datastore.
reboot (--hard) Reboots the VM.
delete --recreate Cleans the VM and moves it to PENDING.
shutdown (--hard) Powers off a VM, cleans host and VM is removed
from OpenNebula.
delete VM is immediately destroyed regardless of state.
Recommended only for oneadmin.
25. 25Installing and Basic Usage
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
26. 26Installing and Basic Usage
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.
27. 27Installing and Basic Usage
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
28. 28Installing and Basic Usage
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