Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 -...

32
Installing and Basic Usage OpenNebula Cloud Management Platform > Innovative Open Source Technologies and Professional Services to Build your Enterprise-ready Cloud Computing Environment Acknowledgments The research leading to these results has received funding from the European Union's Seventh Framework Programme ([FP7/2007-2013]) under grant agreement n° 612053 (CloudCatalyst Project) Creative Commons Attribution-NonCommercial-ShareAlike License Carlos Martín OpenNebula Project Engineer EGI Community Forum Helsinki, 19-23 May 2014

Transcript of Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 -...

Page 1: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

Installing and Basic Usage

OpenNebula Cloud Management Platform >

Innovative Open Source Technologies and Professional Services to

Build your Enterprise-ready Cloud Computing Environment

Acknowledgments

The research leading to these results has received funding from the

European Union's Seventh Framework Programme ([FP7/2007-2013])

under grant agreement n° 612053 (CloudCatalyst Project)

Creative Commons Attribution-NonCommercial-ShareAlike License

Carlos Martín

OpenNebula Project Engineer

EGI Community Forum

Helsinki, 19-23 May 2014

Page 2: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

2 Installing and Basic Usage

Agenda

Installing and Basic Usage

● Planning the Installation

● Installation (node 1 - Frontend)

● Installation (node 2 - WorkerNode)

● Configuration

● Basic Usage

● Managing Hosts

● Images, Networks, Templates and VMs

● Managing Users, Quotas and ACLs

● Logging & Debugging

Page 3: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

3 Installing and Basic Usage

OpenNebula Views

Different perspectives for different users

OpenNebula

Admin VDCAdmin

Cloud User

Page 4: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

4 Installing and Basic Usage

OpenNebula Views

Configure your Cloud from the Admin perspective

OpenNebula

Admin VDCAdmin

Cloud User

Page 5: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

5 Installing 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

Page 6: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

6 Installing and Basic Usage

Virtual Lab

Planning the Installation

NODE 1 NODE 2

Page 7: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

7 Installing and Basic Usage

Virtual Lab

Installing

● Start node1. node2 must be started after node1

● You can access them from:

1. VirtualBox GUI

2. Console/putty

● node1 (password centos)

● node2 (password centos)

$ ssh localhost -l root -p 2222

$ ssh localhost -l root -p 2223

Page 8: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

8 Installing and Basic Usage

Installation node 1 - Frontend

Installing

Hands on (node1) !

● Install Packages

● Configure the OpenNebula Services

# yum install opennebula-server opennebula-sunstone

opennebula-node-kvm opennebula-flow opennebula-gate

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

# echo 'ONEGATE_ENDPOINT = "http://1.1.1.1:5030"' >> /etc/one/oned.conf

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

# sed -i '/^:market/d' /etc/one/sunstone-server.conf

# echo ':marketplace_url: http://localhost:6242/appliance' >> \

/etc/one/sunstone-server.conf

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

Page 9: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

9 Installing and Basic Usage

Installation node 1 - Frontend

Installing

Hands on (node1) !

# chmod 755 /etc/one

# gpasswd -a oneadmin wheel

# service opennebula start

# service opennebula-sunstone start

# service libvirtd restart

# su - oneadmin

$ oneuser show

$ oneuser -h

● Start the services

● Overview of the CLI

Page 10: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

10 Installing and Basic Usage

Installation node 1 - Frontend

Installing

Hands on (node1) !

● OpenNebula CLI Commands

$ 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

Page 11: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

11 Installing and Basic Usage

Installation node 2 – Worker Node

Installing

Hands on (node2) !

● Install Packages

# yum install opennebula-node-kvm

# service libvirtd restart

● Start the services

Page 12: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

12 Installing 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

Page 13: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

13 Installing 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>

Page 14: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

14 Installing 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: none

●Watch transition INIT => ON

●Click on the row for more information

●Automatic gathering of monitoring data

●Take a look at the graphs

Page 15: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

15 Installing 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

Page 16: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

16 Installing and Basic Usage

Adding Images

Basic Usage – Images

Hands on! (Sunstone)

●Create a new Image

● Name: ttylinux

● Path: /var/www/html/ttyvd-context.qcow2

● Set Attributes:

DEV_PREFIX=vd

DRIVER=qcow2

Page 17: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

17 Installing and Basic Usage

Datastores

Overview

Hands on! (Sunstone)

Page 18: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

18 Installing and Basic Usage

Adding Networks

Basic Usage – Networks

Hands on! (Sunstone)

● Click Create

● Name: private

● IP: 192.168.0.1 => [ENTER]

=> … 192.168.0.4

● Network Model: default

● Bridge: br1

br1

VM VM

Node 1

eth1

br1

Node 2

eth1

VM VM

Page 19: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

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

General

● Name: ttylinux

● CPU: 0.1

● Memory: 64M

Storage

● Click ttylinux

Network

● Click private

● Model virtio

OS Booting

● Arch x86_64

Input/Output

● Click VNC and add Keymap

Page 20: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

20 Installing and Basic Usage

Instantiating

Basic Usage – VMs

Hands on! (Sunstone)

●VNC ( root / password )

● ifconfig: configured using context

●ping the other machine

●migrate

● live-migrate

● Instantiate the template

●Deploy 2 VMs

●Leave the name blank

●Open Virtual Machines

●Watch the transition

PENDING => RUNNING

●Deployed in different hosts

Page 21: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

21 Installing and Basic Usage

Main VM actions

Contextualization

Hands on!

Login to the first VM and look at contextualization

Take a look at the contextualization files:

Page 22: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

22 Installing 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.

Page 23: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

23 Installing and Basic Usage

Other VM actions

Basic Usage – VMs

Hands on! (Sunstone)

●Storage: Attach new disk

● Create new Image => Type: “Datablock”; “Empty Datablock”; Size: 100;

FS Type: “qcow2” ; Device Prefix: “vd”; Driver: “qcow2”

●Network: Attach new nic (model virtio)

●Snapshot

●Take snapshot

●Modify the VM

●Revert

●Capacity: Do a poweroff --hard. Then resize VM capacity

echo 1 >> /sys/bus/pci/rescan

fdisk -l

Page 24: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

24 Installing and Basic Usage

Permissions

Chmod and Chown, UNIX Style!

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 and chmod.

Page 25: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

25 Installing and Basic Usage

Groups

Creating Groups

Hands on!

Resources: adds the whole OpenNebula Zone

Admin: Create an Administrator User

Permissions: Keep defaults

Page 26: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

26 Installing and Basic Usage

Groups

Associated ACLs

Hands on!

When a group is created, a new set of ACLs are introduced

Page 27: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

27 Installing and Basic Usage

OpenNebula Views

Configure your Cloud from the Admin perspective

OpenNebula

Admin VDCAdmin

Cloud User

Page 28: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

28 Installing and Basic Usage

Groups

Using Groups

Hands on!

Login as students-admin and change the view to vdcadmin

Create a new student and update the Quotas

Page 29: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

29 Installing and Basic Usage

OpenNebula Views

Configure your Cloud from the Admin perspective

OpenNebula

Admin VDCAdmin

Cloud User

Page 30: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

30 Installing and Basic Usage

Users

Cloud View

Hands on!

Login as the student and instantiate a new VM

●Select the ttylinux template

●Customize => Small x1

●Network private

●Explore the VM actions. Power Off and Save VM

●Other options: SSH Key, Quotas, Settings

●With the oneadmin account see the new template and image

Page 31: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

31 Installing and Basic Usage

Other Interesting Features

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.

OneFlow

Manage multi-vm services

OneGate

Send custom Metrics to OpenNebula

AppMarket

Deliver appliances ready to be consumed

CloudBursting

Scale out your private resources to EC2

Page 32: Installing and Basic Usage - EGI (Indico) · Installing and Basic Usage 10 Installation node 1 - Frontend Installing Hands on (node1) ! OpenNebula CLI Commands $ one[TAB] oneuser

32 Installing and Basic Usage

We Will Be Happy to Clarify Any Question

Questions?