OpenNebula
Tutorial
© OpenNebula Project. Creative Commons Attribution-NonCommercial-ShareAlike License
Rev20171113
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
Virtual Lab
The Environment
lab-X-node1
OpenNebula
oned, sunstone, etc...
NFS Server
lab-X-node2
KVM & Libvirt
NFS Client
Bridge br0
(ens4)
VM 1 VM 2 VM 3
lab-X-node3
KVM & Libvirt
NFS Client
Bridge br0
(ens4)
VM 4 VM 5 VM 6
VM communication
Datastore
Images
4Installing and Basic Usage
Virtual Lab
Accessing the environment
● Each lab has 2 virtual machines:
○ lab-X-node1: opennebula & hypervisor
○ lab-X-node2: just the hypervisor
5Installing and Basic Usage
Virtual Lab
Accessing the environment
● You can ssh to your environment like this
$ ssh gateway@labs.opennebula.systems
-L 9869:lab-X-node1:9869 
-L 29876:lab-X-node1:29876
(password is 'onecourse!')
$ ssh lab-X-node1
(where 'X' is your lab number!)
6Installing and Basic Usage
Virtual Lab
http://putty.org/
7Installing and Basic Usage
Virtual Lab
gateway@labs.opennebula.systems
8Installing and Basic Usage
(password is 'onecourse!')
(where 'X' is your lab number!)
Virtual Lab
9Installing and Basic Usage
Environment
● The root password for both lab nodes is opennebula
● OpenNebula 5.4.3 is installed
● Switch to the oneadmin account to use OpenNebula
● Both nodes are registered and configured
● Ubuntu 16.04 template available
● Sunstone is available in your laptop
○ open: http://localhost:9869
○ login / password: oneadmin / opennebula
○ you must keep the ssh connection open!!!
10Installing and Basic Usage
Virtual Lab
Accessing the environment
From there, you can jump to the nodes: node2 and node3
[root@lab-1-node1 ~]# ssh lab-1-node2
The password is opennebula
11Installing and Basic Usage
Virtual Lab
Inspecting the environment - Packages
Hands on (node1)
Let's see what packages have been installed:
$ rpm -qa | grep opennebula
These packages have already been installed from the repo
located in /etc/yum.repos.d/opennebula.repo. They
have been installed with yum install (you don't need to do
this).
Check the packages installed in node2 or node3, they're not
the same!
12Installing and Basic Usage
Virtual Lab
Inspecting the environment - Services
Hands on (node1)
Let's see what services are running:
$ systemctl | grep opennebula
These services have been enabled to start automatically
when the VM boots (systemctl enable <service>).
node2 and node3 has libvirt running.
13Installing and Basic Usage
Virtual Lab
Inspecting the environment - Storage
Hands on (node1)
node1 is exporting /srv by NFS (check /etc/exports)
The datastores are shared:
$ file /var/lib/one/datastores/*
/var/lib/one/datastores/0: symbolic link to `/srv/0'
/var/lib/one/datastores/1: symbolic link to `/srv/1'
/var/lib/one/datastores/2: directory
Check /etc/fstab and file /var/lib/one/datastores/*
in node2 and node3.
14Installing and Basic Usage
Virtual Lab
Inspecting the environment - Network
Hands on (node2)
● node2 and node3 have a bridge br0
● VMs will be connected to br0
● br0 is linked to ens4
● ens4 is the private communication between the VMs
Verify with these commands:
brctl show
cat /etc/sysconfig/network-scripts/ifcfg-br0
15Installing and Basic Usage
Virtual Lab
Inspecting the environment - SSH access
Hands on (node1)
It is necessary to be able to ssh from any node to any other
node without password as oneadmin
Verify:
# Make sure you are oneadmin in node1
$ su - oneadmin
# ssh to the same node
$ ssh lab-X-node1 hostname
# ssh to the other nodes
$ ssh lab-X-node2 hostname
$ ssh lab-X-node3 hostname
16Installing and Basic Usage
Virtual Lab
Inspecting the environment - OpenNebula Configuration
Configuration changes:
--- /etc/one/oned.conf.orig
+++ /etc/one/oned.conf
@@ -82 +82 @@
-DB = [ BACKEND = "sqlite" ]
+DB = [ BACKEND="mysql", SERVER="localhost", PORT=3306,
USER="oneadmin", PASSWD="oneadmin", DB_NAME="opennebula" ]
--- /etc/one/sched.conf.orig
+++ /etc/one/sched.conf
@@ -74 +74 @@
-SCHED_INTERVAL = 30
+SCHED_INTERVAL = 5
17Installing and Basic Usage
Virtual Lab
Inspecting the environment - OpenNebula Configuration
Configuration changes:
--- /etc/one/vmm_exec/vmm_exec_kvm.conf.orig
+++ /etc/one/vmm_exec/vmm_exec_kvm.conf
@@ -37 +37 @@
-DISK = [ driver = "raw" , cache = "none"]
+DISK = [ driver = "raw", cache = "unsafe", total_iops_sec =
"50" ]
--- /etc/one/onegate-server.conf.orig
+++ /etc/one/onegate-server.conf
@@ -27 +27 @@
-:host: 127.0.0.1
+:host: 192.168.0.1
18Installing and Basic Usage
Virtual Lab
Inspecting the environment - OpenNebula Password
The oneadmin password is located here:
$ cat /var/lib/one/.one/one_auth
oneadmin:opennebula
The first time OpenNebula starts, it sets the password from
the contents of this file.
19Installing and Basic Usage
Virtual Lab
Installation
Summary of the installation:
● Install the repo: /etc/yum.repos.d/opennebula.repo
● Install packages: yum install opennebula …
● Install gems: /usr/share/one/install_gems
● Enable OpenNebula services
● Configure Storage
● Configure Network
● Configure passwordless ssh access
● OpenNebula configuration files
20Installing and Basic Usage
CLI
OpenNebula Interfaces
Hands on (node1)
Overview of the CLI (as oneadmin)
# su - oneadmin
$ oneuser show
$ oneuser –h
$ one[TAB]
All the CLI commands should
be executed as the oneadmin
user. Remember to switch to
the oneadmin user always!
21Installing and Basic Usage
CLI
OpenNebula Interfaces
$ one[TAB]
oneuser Manage Users oneimage Manage Images
onegroup Manage Groups onetemplate Manage Templates
oneacl Manage ACLs onevm Manage VMs
onehost Manage Hosts oneacct Accounting Tool
onecluster Manage Clusters onemarket Marketplace Tool
onevnet Manage Networks onedb DB Tool
onedatastore Manage Datastores oneflow Manage flows (services)
oneshowback Showback onemarketapp Import marketapps
onevdc Manage VDCs onevrouter Manage virtual routers
onevcenter Import vCenter reources onesecgroup Manage sec. groups
onezone Manage zones
22Installing and Basic Usage
Get User Information - Sunstone
Installing
Try out Sunstone!
http://localhost:9869
Login: oneadmin
Password: opennebula
23Installing and Basic Usage
Adding Hosts - Sunstone
Basic Usage – Hosts
Hands on! (Sunstone)
● Create one host in Sunstone:
● Type: KVM
● Cluster: Default
● Hostname: lab-X-node2
● Watch transition INIT => ON
● Click on the row for more information
● Automatic gathering of monitoring data
● Take a look at the graphs
24Installing and Basic Usage
Adding Hosts - CLI
Basic Usage – Hosts
Hands on! (CLI)
(as oneadmin in the Frontend – node1)
$ onehost –h
$ onehost create –h
$ onehost create lab-X-node3 –i kvm -v kvm
$ onehost list
$ onehost top
# Wait for ON ... and then CTRL-C
$ onehost show lab-X-node3
$ onehost show 1
$ onehost show -x 1
25Installing and Basic Usage
Adding Images
Basic Usage – Images
Hands on! (Sunstone)
● Create a new Image
● Name: ubuntu-16.04
● Path: http://192.168.122.1/ubuntu-16.04.qcow2
● Advanced Options
● Bus: Virtio
● Image mapping driver: qcow2
26Installing and Basic Usage
Overview
Basic Usage - Datastores
27Installing and Basic Usage
Overview
Basic Usage - Datastores
Hands on! (Sunstone)
Datastore 0 (system) and Datastore 1 (default)
Change the TM_MAD to qcow2 in both datastores.
28Installing and Basic Usage
Adding Networks
Basic Usage – Networks
Hands on! (Sunstone)
br0
VM VM
Node 2
ens4
br0
Node 3
ens4
VM VM
29Installing and Basic Usage
Adding Networks
Basic Usage – Networks
Hands on! (Sunstone)
General
● Name: private
Configuration
● Bridge: br0
Addresses
● IP start: 192.168.0.100
● Size: 100
Context
● Gateway: 192.168.0.1
● DNS: 8.8.8.8
30Installing 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…
General
● Name: ubuntu-16.04
● Logo: Ubuntu
● Description: Testing VM
● CPU: 0.3
● Memory: 512 MB
Storage
● Click ubuntu-16.04
Network
● Click private
Input/Output
● Enter your keymap. Leave as is
if using a US keyboard.
MB, not GB
31Installing and Basic Usage
Adding Templates
Basic Usage – Template
Hands on! (Sunstone)
Context
● Check 'Add OneGate token'
● Check 'Report Ready to OneGate''
● In the Start script text area type:
touch /tmp/tutorial-test
● Check 'Encode script in Base64'
● Custom vars → Key: PASSWORD, Value: opennebula
Click Create
32Installing and Basic Usage
SSH Contextualization
Basic Usage – adding SSH contextualization
Hands on!
● Users should be able to access the VMs without password.
● Grab the SSH from here (in lab-X-node1):
cat /var/lib/one/.ssh/id_rsa.pub
ssh-rsa
AAAAB3NzaC1yc2EAAAADAQABAAABAQC9nzF1clIaAji5k6eh+3W5GE
opFKfuwSWmq88mAStNTX31rnqJeGCqSkw5VwgSdGaaPzPVc3jNvB3l
… oneadmin@lab-X-node1
● Copy that key.
33Installing and Basic Usage
SSH Contextualization
Basic Usage – adding SSH contextualization
Hands on!
● Paste that key into Sunstone:
34Installing and Basic Usage
Instantiating
Basic Usage – VMs
Hands on! (Sunstone)
● VNC ( root / opennebula )
● Network configured using context
ip a
● ping the other machine
● migrate the other machine (watch
ping)
● live-migrate the other machine
(watch ping)
● Instantiate the template
● Deploy 2 VMs
● Leave the name blank
● Open Virtual Machines
● Watch the transition
PENDING => RUNNING
● Deployed in different hosts
35Installing and Basic Usage
SSH Contextualization
Basic Usage – adding SSH contextualization
Hands on!
● Deploy the VM and check that you can SSH from the node
# as oneadmin in lab-X-node1
ssh root@192.168...
● Obtain the correct IP from the VM information in Sunstone
36Installing and Basic Usage
Contextualization
Basic Usage – VMs
Hands on!
Login to the first VM and look at contextualization
Take a look at the contextualization files:
root@ubuntu:~# head -n 11 /var/run/one-context/context.sh.local
# Context variables generated by OpenNebula
DISK_ID='1'
ETH0_CONTEXT_FORCE_IPV4=''
ETH0_DNS=''
ETH0_GATEWAY=''
ETH0_GATEWAY6=''
ETH0_IP='192.168.0.100'
ETH0_IP6=''
ETH0_IP6_PREFIX_LENGTH=''
ETH0_IP6_ULA=''
ETH0_MAC='02:00:c0:a8:00:64'
root@ubuntu:~# ls /etc/one-context.d/
loc-05-grow-rootfs loc-16-gen-env net-15-hostname
loc-10-network loc-20-set-username-password net-97-start-script
loc-10-network-pci loc-22-ssh_public_key net-98-execute-scripts
loc-11-dns loc-24-ssh_host_key net-99-report-ready
loc-14-mount-swap net-11-fix-loopback
37Installing and Basic Usage
Contextualization
Basic Usage – VMs
Hands on!
The file /tmp/tutorial-test has been created thanks to the START SCRIPT text
area:
root@ubuntu:~# ls /tmp/tutorial-test
/tmp/tutorial-test
root@ubuntu:~#
38Installing 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.
recover --recreate Cleans the VM and moves it to PENDING.
terminate (--hard) Shuts down a VM, cleans host and VM is removed
from OpenNebula.
recover --delete VM is immediately destroyed regardless of state.
Recommended only for oneadmin.
39Installing and Basic Usage
Storage: Attach new disk
● In the Images tab: Create new Image
● Name: data-100
● Type: Generic storage datablock
● Empty disk image
● Size in MB: 100
● Image mapping driver: qcow2
● BUS: Virtio
● In the VM info / Storage tab
● Attach disk: data-100
● VNC:
fdisk -l
Other VM actions
Basic Usage – VMs
Hands on! (Sunstone)
40Installing and Basic Usage
Other VM actions
Basic Usage – VMs
Hands on! (Sunstone)
● Capacity: Power off first, then resize VM capacity. Memory 768.
● Snapshot
● Take (system) snapshot
● Modify the VM
● Revert
41Installing and Basic Usage
Chmod and Chown, UNIX Style!
Permissions
Hands on! (Sunstone)
Make the all the resources previously created usable by everybody
Apply to all the images, templates and virtual networks.
Owner could be changed too => chown, chgrp and chmod.
Take a look at Template → Share
42Installing and Basic Usage
Creating Groups
Groups
Hands on!
Admin: Click Create an administrator user
Username: students-admin
Password: …
Check the Permissions tab (no modifications)
43Installing and Basic Usage
Associated ACLs
Groups
Hands on!
When a group is created, a new set of ACLs are introduced
44Installing and Basic Usage
VDCs
The Power of VDCs
45Installing and Basic Usage
Three Views
OpenNebula Views
OpenNebula
Admin Group Admin
Cloud User
46Installing and Basic Usage
The Admin View
OpenNebula Views
OpenNebula
Admin Group Admin
Cloud User
47Installing and Basic Usage
OpenNebula Views
Configure your Cloud from the Admin perspective
OpenNebula
Admin Group Admin
Cloud User
48Installing and Basic Usage
Group Admin View
Using Groups
Hands on!
Login as students-admin
●Create a student
●Assign Quotas (2 VM limit)
49Installing and Basic Usage
User the Cloud as a Cloud User
OpenNebula Views
OpenNebula
Admin Group Admin
Cloud User
50Installing and Basic Usage
Cloud View
OpenNebula Views
Hands on!
Login as the student and instantiate a new VM
●Select the ubuntu-14.04
template
●Network private
● Explore the VM actions. Power Off and Save VM
● With the oneadmin account see the new template and image
● Other options: SSH Key, Quotas, Settings
51Installing and Basic Usage
Group Admin View
Using Groups
Hands on!
Login as students-admin
52Installing and Basic Usage
Explore
Federation
OpenNebula can scale by federation many OpenNebula instances.
Scheduler
The OpenNebula Scheduler is extremely flexible. Write your own rules
you want to guarantee that your vms end up wherever you need them.
OneGate
Send custom Metrics to OpenNebula
AppMarket
Deliver appliances ready to be consumed
CloudBursting
Scale out your private resources to EC2
vOneCloud
vCloud Director Replacement with al the OpenNebula Cloud benefits
Other Features
53Installing and Basic Usage
We Will Be Happy to Clarify Any Question
Questions?

OpenNebula 5.4 Hands-on Tutorial

  • 1.
    OpenNebula Tutorial © OpenNebula Project.Creative Commons Attribution-NonCommercial-ShareAlike License Rev20171113
  • 2.
    A Typical OpenNebulaEnvironment 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
  • 3.
    Virtual Lab The Environment lab-X-node1 OpenNebula oned,sunstone, etc... NFS Server lab-X-node2 KVM & Libvirt NFS Client Bridge br0 (ens4) VM 1 VM 2 VM 3 lab-X-node3 KVM & Libvirt NFS Client Bridge br0 (ens4) VM 4 VM 5 VM 6 VM communication Datastore Images
  • 4.
    4Installing and BasicUsage Virtual Lab Accessing the environment ● Each lab has 2 virtual machines: ○ lab-X-node1: opennebula & hypervisor ○ lab-X-node2: just the hypervisor
  • 5.
    5Installing and BasicUsage Virtual Lab Accessing the environment ● You can ssh to your environment like this $ ssh gateway@labs.opennebula.systems -L 9869:lab-X-node1:9869 -L 29876:lab-X-node1:29876 (password is 'onecourse!') $ ssh lab-X-node1 (where 'X' is your lab number!)
  • 6.
    6Installing and BasicUsage Virtual Lab http://putty.org/
  • 7.
    7Installing and BasicUsage Virtual Lab gateway@labs.opennebula.systems
  • 8.
    8Installing and BasicUsage (password is 'onecourse!') (where 'X' is your lab number!) Virtual Lab
  • 9.
    9Installing and BasicUsage Environment ● The root password for both lab nodes is opennebula ● OpenNebula 5.4.3 is installed ● Switch to the oneadmin account to use OpenNebula ● Both nodes are registered and configured ● Ubuntu 16.04 template available ● Sunstone is available in your laptop ○ open: http://localhost:9869 ○ login / password: oneadmin / opennebula ○ you must keep the ssh connection open!!!
  • 10.
    10Installing and BasicUsage Virtual Lab Accessing the environment From there, you can jump to the nodes: node2 and node3 [root@lab-1-node1 ~]# ssh lab-1-node2 The password is opennebula
  • 11.
    11Installing and BasicUsage Virtual Lab Inspecting the environment - Packages Hands on (node1) Let's see what packages have been installed: $ rpm -qa | grep opennebula These packages have already been installed from the repo located in /etc/yum.repos.d/opennebula.repo. They have been installed with yum install (you don't need to do this). Check the packages installed in node2 or node3, they're not the same!
  • 12.
    12Installing and BasicUsage Virtual Lab Inspecting the environment - Services Hands on (node1) Let's see what services are running: $ systemctl | grep opennebula These services have been enabled to start automatically when the VM boots (systemctl enable <service>). node2 and node3 has libvirt running.
  • 13.
    13Installing and BasicUsage Virtual Lab Inspecting the environment - Storage Hands on (node1) node1 is exporting /srv by NFS (check /etc/exports) The datastores are shared: $ file /var/lib/one/datastores/* /var/lib/one/datastores/0: symbolic link to `/srv/0' /var/lib/one/datastores/1: symbolic link to `/srv/1' /var/lib/one/datastores/2: directory Check /etc/fstab and file /var/lib/one/datastores/* in node2 and node3.
  • 14.
    14Installing and BasicUsage Virtual Lab Inspecting the environment - Network Hands on (node2) ● node2 and node3 have a bridge br0 ● VMs will be connected to br0 ● br0 is linked to ens4 ● ens4 is the private communication between the VMs Verify with these commands: brctl show cat /etc/sysconfig/network-scripts/ifcfg-br0
  • 15.
    15Installing and BasicUsage Virtual Lab Inspecting the environment - SSH access Hands on (node1) It is necessary to be able to ssh from any node to any other node without password as oneadmin Verify: # Make sure you are oneadmin in node1 $ su - oneadmin # ssh to the same node $ ssh lab-X-node1 hostname # ssh to the other nodes $ ssh lab-X-node2 hostname $ ssh lab-X-node3 hostname
  • 16.
    16Installing and BasicUsage Virtual Lab Inspecting the environment - OpenNebula Configuration Configuration changes: --- /etc/one/oned.conf.orig +++ /etc/one/oned.conf @@ -82 +82 @@ -DB = [ BACKEND = "sqlite" ] +DB = [ BACKEND="mysql", SERVER="localhost", PORT=3306, USER="oneadmin", PASSWD="oneadmin", DB_NAME="opennebula" ] --- /etc/one/sched.conf.orig +++ /etc/one/sched.conf @@ -74 +74 @@ -SCHED_INTERVAL = 30 +SCHED_INTERVAL = 5
  • 17.
    17Installing and BasicUsage Virtual Lab Inspecting the environment - OpenNebula Configuration Configuration changes: --- /etc/one/vmm_exec/vmm_exec_kvm.conf.orig +++ /etc/one/vmm_exec/vmm_exec_kvm.conf @@ -37 +37 @@ -DISK = [ driver = "raw" , cache = "none"] +DISK = [ driver = "raw", cache = "unsafe", total_iops_sec = "50" ] --- /etc/one/onegate-server.conf.orig +++ /etc/one/onegate-server.conf @@ -27 +27 @@ -:host: 127.0.0.1 +:host: 192.168.0.1
  • 18.
    18Installing and BasicUsage Virtual Lab Inspecting the environment - OpenNebula Password The oneadmin password is located here: $ cat /var/lib/one/.one/one_auth oneadmin:opennebula The first time OpenNebula starts, it sets the password from the contents of this file.
  • 19.
    19Installing and BasicUsage Virtual Lab Installation Summary of the installation: ● Install the repo: /etc/yum.repos.d/opennebula.repo ● Install packages: yum install opennebula … ● Install gems: /usr/share/one/install_gems ● Enable OpenNebula services ● Configure Storage ● Configure Network ● Configure passwordless ssh access ● OpenNebula configuration files
  • 20.
    20Installing and BasicUsage CLI OpenNebula Interfaces Hands on (node1) Overview of the CLI (as oneadmin) # su - oneadmin $ oneuser show $ oneuser –h $ one[TAB] All the CLI commands should be executed as the oneadmin user. Remember to switch to the oneadmin user always!
  • 21.
    21Installing and BasicUsage CLI OpenNebula Interfaces $ one[TAB] oneuser Manage Users oneimage Manage Images onegroup Manage Groups onetemplate Manage Templates oneacl Manage ACLs onevm Manage VMs onehost Manage Hosts oneacct Accounting Tool onecluster Manage Clusters onemarket Marketplace Tool onevnet Manage Networks onedb DB Tool onedatastore Manage Datastores oneflow Manage flows (services) oneshowback Showback onemarketapp Import marketapps onevdc Manage VDCs onevrouter Manage virtual routers onevcenter Import vCenter reources onesecgroup Manage sec. groups onezone Manage zones
  • 22.
    22Installing and BasicUsage Get User Information - Sunstone Installing Try out Sunstone! http://localhost:9869 Login: oneadmin Password: opennebula
  • 23.
    23Installing and BasicUsage Adding Hosts - Sunstone Basic Usage – Hosts Hands on! (Sunstone) ● Create one host in Sunstone: ● Type: KVM ● Cluster: Default ● Hostname: lab-X-node2 ● Watch transition INIT => ON ● Click on the row for more information ● Automatic gathering of monitoring data ● Take a look at the graphs
  • 24.
    24Installing and BasicUsage Adding Hosts - CLI Basic Usage – Hosts Hands on! (CLI) (as oneadmin in the Frontend – node1) $ onehost –h $ onehost create –h $ onehost create lab-X-node3 –i kvm -v kvm $ onehost list $ onehost top # Wait for ON ... and then CTRL-C $ onehost show lab-X-node3 $ onehost show 1 $ onehost show -x 1
  • 25.
    25Installing and BasicUsage Adding Images Basic Usage – Images Hands on! (Sunstone) ● Create a new Image ● Name: ubuntu-16.04 ● Path: http://192.168.122.1/ubuntu-16.04.qcow2 ● Advanced Options ● Bus: Virtio ● Image mapping driver: qcow2
  • 26.
    26Installing and BasicUsage Overview Basic Usage - Datastores
  • 27.
    27Installing and BasicUsage Overview Basic Usage - Datastores Hands on! (Sunstone) Datastore 0 (system) and Datastore 1 (default) Change the TM_MAD to qcow2 in both datastores.
  • 28.
    28Installing and BasicUsage Adding Networks Basic Usage – Networks Hands on! (Sunstone) br0 VM VM Node 2 ens4 br0 Node 3 ens4 VM VM
  • 29.
    29Installing and BasicUsage Adding Networks Basic Usage – Networks Hands on! (Sunstone) General ● Name: private Configuration ● Bridge: br0 Addresses ● IP start: 192.168.0.100 ● Size: 100 Context ● Gateway: 192.168.0.1 ● DNS: 8.8.8.8
  • 30.
    30Installing and BasicUsage 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… General ● Name: ubuntu-16.04 ● Logo: Ubuntu ● Description: Testing VM ● CPU: 0.3 ● Memory: 512 MB Storage ● Click ubuntu-16.04 Network ● Click private Input/Output ● Enter your keymap. Leave as is if using a US keyboard. MB, not GB
  • 31.
    31Installing and BasicUsage Adding Templates Basic Usage – Template Hands on! (Sunstone) Context ● Check 'Add OneGate token' ● Check 'Report Ready to OneGate'' ● In the Start script text area type: touch /tmp/tutorial-test ● Check 'Encode script in Base64' ● Custom vars → Key: PASSWORD, Value: opennebula Click Create
  • 32.
    32Installing and BasicUsage SSH Contextualization Basic Usage – adding SSH contextualization Hands on! ● Users should be able to access the VMs without password. ● Grab the SSH from here (in lab-X-node1): cat /var/lib/one/.ssh/id_rsa.pub ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9nzF1clIaAji5k6eh+3W5GE opFKfuwSWmq88mAStNTX31rnqJeGCqSkw5VwgSdGaaPzPVc3jNvB3l … oneadmin@lab-X-node1 ● Copy that key.
  • 33.
    33Installing and BasicUsage SSH Contextualization Basic Usage – adding SSH contextualization Hands on! ● Paste that key into Sunstone:
  • 34.
    34Installing and BasicUsage Instantiating Basic Usage – VMs Hands on! (Sunstone) ● VNC ( root / opennebula ) ● Network configured using context ip a ● ping the other machine ● migrate the other machine (watch ping) ● live-migrate the other machine (watch ping) ● Instantiate the template ● Deploy 2 VMs ● Leave the name blank ● Open Virtual Machines ● Watch the transition PENDING => RUNNING ● Deployed in different hosts
  • 35.
    35Installing and BasicUsage SSH Contextualization Basic Usage – adding SSH contextualization Hands on! ● Deploy the VM and check that you can SSH from the node # as oneadmin in lab-X-node1 ssh root@192.168... ● Obtain the correct IP from the VM information in Sunstone
  • 36.
    36Installing and BasicUsage Contextualization Basic Usage – VMs Hands on! Login to the first VM and look at contextualization Take a look at the contextualization files: root@ubuntu:~# head -n 11 /var/run/one-context/context.sh.local # Context variables generated by OpenNebula DISK_ID='1' ETH0_CONTEXT_FORCE_IPV4='' ETH0_DNS='' ETH0_GATEWAY='' ETH0_GATEWAY6='' ETH0_IP='192.168.0.100' ETH0_IP6='' ETH0_IP6_PREFIX_LENGTH='' ETH0_IP6_ULA='' ETH0_MAC='02:00:c0:a8:00:64' root@ubuntu:~# ls /etc/one-context.d/ loc-05-grow-rootfs loc-16-gen-env net-15-hostname loc-10-network loc-20-set-username-password net-97-start-script loc-10-network-pci loc-22-ssh_public_key net-98-execute-scripts loc-11-dns loc-24-ssh_host_key net-99-report-ready loc-14-mount-swap net-11-fix-loopback
  • 37.
    37Installing and BasicUsage Contextualization Basic Usage – VMs Hands on! The file /tmp/tutorial-test has been created thanks to the START SCRIPT text area: root@ubuntu:~# ls /tmp/tutorial-test /tmp/tutorial-test root@ubuntu:~#
  • 38.
    38Installing and BasicUsage 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. recover --recreate Cleans the VM and moves it to PENDING. terminate (--hard) Shuts down a VM, cleans host and VM is removed from OpenNebula. recover --delete VM is immediately destroyed regardless of state. Recommended only for oneadmin.
  • 39.
    39Installing and BasicUsage Storage: Attach new disk ● In the Images tab: Create new Image ● Name: data-100 ● Type: Generic storage datablock ● Empty disk image ● Size in MB: 100 ● Image mapping driver: qcow2 ● BUS: Virtio ● In the VM info / Storage tab ● Attach disk: data-100 ● VNC: fdisk -l Other VM actions Basic Usage – VMs Hands on! (Sunstone)
  • 40.
    40Installing and BasicUsage Other VM actions Basic Usage – VMs Hands on! (Sunstone) ● Capacity: Power off first, then resize VM capacity. Memory 768. ● Snapshot ● Take (system) snapshot ● Modify the VM ● Revert
  • 41.
    41Installing and BasicUsage Chmod and Chown, UNIX Style! Permissions Hands on! (Sunstone) Make the all the resources previously created usable by everybody Apply to all the images, templates and virtual networks. Owner could be changed too => chown, chgrp and chmod. Take a look at Template → Share
  • 42.
    42Installing and BasicUsage Creating Groups Groups Hands on! Admin: Click Create an administrator user Username: students-admin Password: … Check the Permissions tab (no modifications)
  • 43.
    43Installing and BasicUsage Associated ACLs Groups Hands on! When a group is created, a new set of ACLs are introduced
  • 44.
    44Installing and BasicUsage VDCs The Power of VDCs
  • 45.
    45Installing and BasicUsage Three Views OpenNebula Views OpenNebula Admin Group Admin Cloud User
  • 46.
    46Installing and BasicUsage The Admin View OpenNebula Views OpenNebula Admin Group Admin Cloud User
  • 47.
    47Installing and BasicUsage OpenNebula Views Configure your Cloud from the Admin perspective OpenNebula Admin Group Admin Cloud User
  • 48.
    48Installing and BasicUsage Group Admin View Using Groups Hands on! Login as students-admin ●Create a student ●Assign Quotas (2 VM limit)
  • 49.
    49Installing and BasicUsage User the Cloud as a Cloud User OpenNebula Views OpenNebula Admin Group Admin Cloud User
  • 50.
    50Installing and BasicUsage Cloud View OpenNebula Views Hands on! Login as the student and instantiate a new VM ●Select the ubuntu-14.04 template ●Network private ● Explore the VM actions. Power Off and Save VM ● With the oneadmin account see the new template and image ● Other options: SSH Key, Quotas, Settings
  • 51.
    51Installing and BasicUsage Group Admin View Using Groups Hands on! Login as students-admin
  • 52.
    52Installing and BasicUsage Explore Federation OpenNebula can scale by federation many OpenNebula instances. Scheduler The OpenNebula Scheduler is extremely flexible. Write your own rules you want to guarantee that your vms end up wherever you need them. OneGate Send custom Metrics to OpenNebula AppMarket Deliver appliances ready to be consumed CloudBursting Scale out your private resources to EC2 vOneCloud vCloud Director Replacement with al the OpenNebula Cloud benefits Other Features
  • 53.
    53Installing and BasicUsage We Will Be Happy to Clarify Any Question Questions?