Setting up your virtual infrastructure using FIWARE Lab Cloud

92
Setting up your virtual infrastructure using FIWARE Lab Cloud Fernando López Telefónica I+D Cloud Architects, FIWARE fernando.lopezaguilar@ telefonica.com , @flopezaguilar (Slides: http://tinyurl.com/fiwarelab-cloud)

description

FI-WARE presentation of Cloud functionalities based on OpenStack.

Transcript of Setting up your virtual infrastructure using FIWARE Lab Cloud

Page 1: Setting up your virtual infrastructure using FIWARE Lab Cloud

Setting up your virtual infrastructure using FIWARE Lab Cloud

Fernando LópezTelefónica I+DCloud Architects, [email protected], @flopezaguilar

(Slides: http://tinyurl.com/fiwarelab-cloud)

Page 2: Setting up your virtual infrastructure using FIWARE Lab Cloud

Content

• Introduction to FIWARE Lab Cloud Hosting

• Deploying your first VM

• Working with networks

• Creating Containers and adding objects

• Deploying components for your application

• Reference Information

2

Page 3: Setting up your virtual infrastructure using FIWARE Lab Cloud

FIWARE Lab Cloud Hosting

3

Page 4: Setting up your virtual infrastructure using FIWARE Lab Cloud

FIWARE Lab Cloud Hosting

Cloud Portal PaaS

SDC Monitoring

Account

4

Page 5: Setting up your virtual infrastructure using FIWARE Lab Cloud

FIWARE Lab Cloud – Multiregion

5

Page 6: Setting up your virtual infrastructure using FIWARE Lab Cloud

Summary

• Account– Managing your identity and organizations

• Compute– Creating VMs and accessing them

• Monitoring– Getting monitoring information from your VMs

• SDC– Deploying Software in your VMs

• Storage– Creating and attaching volumes

– Uploading objects to containers

• PaaS Manager– Working with regions

– Creating Tiers and deploying Blueprints

• Network– Working with Nets and Subnets

6

Page 7: Setting up your virtual infrastructure using FIWARE Lab Cloud

Account

• Creating an account– https://account.lab.fi-ware.org

• Understanding organizations– Mapped to OS tenants

• Signing in in Cloud Portal – https://cloud.lab.fi-ware.org– SSO

7

Page 8: Setting up your virtual infrastructure using FIWARE Lab Cloud

Basic functionalities

8

Page 9: Setting up your virtual infrastructure using FIWARE Lab Cloud

FIWARE Lab Cloud Hosting: basic functionalities

• Create your account in lab.fiware.org

• Enter in the Cloud Portal

• Create your keypair (private key)

• Deploy your instance

• Add a public IP

• Open ports to the VM

9

Page 10: Setting up your virtual infrastructure using FIWARE Lab Cloud

Add new user

Enter your email and passwordto access to the FIWARE Lab.

If you do not have it or forgot it, sign up or request for a new one.

10

Page 11: Setting up your virtual infrastructure using FIWARE Lab Cloud

Create keypair

You must create a keypairto access to the servers.

11

Page 12: Setting up your virtual infrastructure using FIWARE Lab Cloud

Create keypair

You must create a keypairto access to the servers.

12

Page 13: Setting up your virtual infrastructure using FIWARE Lab Cloud

How to connect from Windows (I)

• Install PuTTY and PuTTYgen from http://www.putty.org/

• Convert your Keypair to PPK

– Start PuTTYgen (e.g. From the Start menu, click All Programs > PuTTY > PuTTYgen)

– Click Load and select the Keypair file (e.g. my_cert.pem). You’ll need to display All Files (*.*) to see your Keypair.

– Click Open. And select the destination path and name of your PPK file.

13

Page 14: Setting up your virtual infrastructure using FIWARE Lab Cloud

How to connect from Windows (II)

• Connect to your instance

– Start PuTTY.

– Put the public IP of your instance (default SSH port is 22).

• Configure it to use your Keypair

– Open the Auth submenu (Connection > SSH > Auth)

– Select the recently generated Private key file (PPK file).

14

Page 15: Setting up your virtual infrastructure using FIWARE Lab Cloud

How to obtain your public key from pem file

• Secure to have the proper permissions:$ chmod 600 private.pem

• Create the public key:$ ssh-keygen –y –f private.pem >> publickey.pub

• Add the public key to your system$ cat publickey.pub >> ~/.ssh/id_rsa.pub

15

Page 16: Setting up your virtual infrastructure using FIWARE Lab Cloud

How to import your public key into OpenStack

• Just go to the .ssh directory and execute

$cat ~/.ssh/id_rsa.pub

• Copy and Paste the content in the Public Key textarea.

• Assign a keypair name

• Press Import Keypair.

16

Page 17: Setting up your virtual infrastructure using FIWARE Lab Cloud

Security groups

Create a Security Group

17

Page 18: Setting up your virtual infrastructure using FIWARE Lab Cloud

Security groups

Create a Security Group

18

Page 19: Setting up your virtual infrastructure using FIWARE Lab Cloud

Create and edit Security Group rules

19

Page 20: Setting up your virtual infrastructure using FIWARE Lab Cloud

Create and edit Security Group rules

20

Page 21: Setting up your virtual infrastructure using FIWARE Lab Cloud

Allocate IP to a project

Allocate new IP

21

Page 22: Setting up your virtual infrastructure using FIWARE Lab Cloud

Launch Instances

Launch new instance

22

Page 23: Setting up your virtual infrastructure using FIWARE Lab Cloud

Launch Instances

23

Page 24: Setting up your virtual infrastructure using FIWARE Lab Cloud

Launch Instances

24

Page 25: Setting up your virtual infrastructure using FIWARE Lab Cloud

Launch Instances

25

Page 26: Setting up your virtual infrastructure using FIWARE Lab Cloud

Launch Instances

26

Page 27: Setting up your virtual infrastructure using FIWARE Lab Cloud

Associate IP

27

Page 28: Setting up your virtual infrastructure using FIWARE Lab Cloud

Allocate Floating IP

28

Page 29: Setting up your virtual infrastructure using FIWARE Lab Cloud

Instances Overview

29

Page 30: Setting up your virtual infrastructure using FIWARE Lab Cloud

Access to the instance

30

Page 31: Setting up your virtual infrastructure using FIWARE Lab Cloud

Network functionalities

31

Page 32: Setting up your virtual infrastructure using FIWARE Lab Cloud

FIWARE Lab Cloud Hosting: networks functionalities

• Create your own network

• Create your subnet associate to the previous network

• Create a router

• Set gateway

• Assign subnet

• Deploy your instance

• Assign public IP to your instance

• Check the new instance.

32

Page 33: Setting up your virtual infrastructure using FIWARE Lab Cloud

FIWARE Lab Cloud Hosting: working with networks

• Multi-tenancy– High or Low?

• Do I need to isolate tenants?– Even if you trust them, you might want isolation.– Tenant creates his own network(s) and router(s)

allowing complex network topologies for multi-tier applications.

33

Page 34: Setting up your virtual infrastructure using FIWARE Lab Cloud

Create your own network

Create a newNetwork

34

Page 35: Setting up your virtual infrastructure using FIWARE Lab Cloud

Create your own network

Assign a nameFor the network

35

Page 36: Setting up your virtual infrastructure using FIWARE Lab Cloud

Add subnet associate to the previous network

Add subnet

36

Page 37: Setting up your virtual infrastructure using FIWARE Lab Cloud

Add subnet associate to the previous network

Add NetworkAddress (CIDR)

Define DNSserver

37

Page 38: Setting up your virtual infrastructure using FIWARE Lab Cloud

CIDR notation

10.10.1.32/27 represents:

• The given IPv4 address and its associated routing prefix 10.10.1.32, or equivalently.

• Its subnet mask 255.255.255.224, which has 27 leading 1-bits.

38

Page 39: Setting up your virtual infrastructure using FIWARE Lab Cloud

Create a router

Assign routername

39

Page 40: Setting up your virtual infrastructure using FIWARE Lab Cloud

Set gateway

Assign a gatewayto the router

40

Page 41: Setting up your virtual infrastructure using FIWARE Lab Cloud

Set gateway

Select the network

41

Page 42: Setting up your virtual infrastructure using FIWARE Lab Cloud

Assign subnet

Double Click on the router name

42

Page 43: Setting up your virtual infrastructure using FIWARE Lab Cloud

Assign subnet

Add interface(subnet)

43

Page 44: Setting up your virtual infrastructure using FIWARE Lab Cloud

Assign subnet

Select the network to connect

44

Page 45: Setting up your virtual infrastructure using FIWARE Lab Cloud

Deploy a new instance: Details

45

Page 46: Setting up your virtual infrastructure using FIWARE Lab Cloud

Deploy a new instance: Access & Security

46

Page 47: Setting up your virtual infrastructure using FIWARE Lab Cloud

Deploy a new instance: Networking

Select the network to connect

47

Page 48: Setting up your virtual infrastructure using FIWARE Lab Cloud

Deploy a new instance: connect to VM display

Select connect to Interface

48

Page 49: Setting up your virtual infrastructure using FIWARE Lab Cloud

Deploy a new instance: connect to VM display

49

Page 50: Setting up your virtual infrastructure using FIWARE Lab Cloud

Assign public IP to your instance

50

Page 51: Setting up your virtual infrastructure using FIWARE Lab Cloud

Check the new instance

51

Page 52: Setting up your virtual infrastructure using FIWARE Lab Cloud

Storage functionalities

52

Page 53: Setting up your virtual infrastructure using FIWARE Lab Cloud

FIWARE Lab Cloud Hosting: storage functionalities

• Create volumes

• Attach volume to servers

• Configure the instance to detect the new volume

• Create containers in the object storage

• Upload objects into your containers

• Object Storage API

53

Page 54: Setting up your virtual infrastructure using FIWARE Lab Cloud

Create a volume

54

Page 55: Setting up your virtual infrastructure using FIWARE Lab Cloud

Attach a volume to an instance

55

Page 56: Setting up your virtual infrastructure using FIWARE Lab Cloud

Volume attached

56

Page 57: Setting up your virtual infrastructure using FIWARE Lab Cloud

See the new volume with fdisk

57

Page 58: Setting up your virtual infrastructure using FIWARE Lab Cloud

Create a partition table on our new volume.

Execute sudo fdisk /dev/vdb

58

Page 59: Setting up your virtual infrastructure using FIWARE Lab Cloud

Create a ext3 file system

59

Page 60: Setting up your virtual infrastructure using FIWARE Lab Cloud

Mounting our new volume.

• Now, we have to create a mount point called /data and mount /dev/vdb1. $ sudo mkdir /data

$ sudo mount /dev/vdb1 /data

• At this point, the volume’s storage is accessible to Linux.

• We’ll also modify /etc/fstab to insure that our instance remounts the volume on restarts.

60

Page 61: Setting up your virtual infrastructure using FIWARE Lab Cloud

Check the created volume

61

Page 62: Setting up your virtual infrastructure using FIWARE Lab Cloud

Object Storage: Create a container

62

Page 63: Setting up your virtual infrastructure using FIWARE Lab Cloud

Upload an object into the container

63

Page 64: Setting up your virtual infrastructure using FIWARE Lab Cloud

Object Storage API

• http://forge.fi-ware.org/plugins/mediawiki/wiki/fiware/index.php/Object_Storage_-_User_and_Programmers_Guide

• Authentication to get initial token

username='[email protected]' password='mypassword' curl -d '{"auth": {"passwordCredentials": {"username":"'$username'", "password":"'$password'"}}}' \ -H 'Content-type: aplication/json' \ http://cloud.lab.fi-ware.org:4730/v2.0/tokens \ -vvv

• Use initial token to get tenant

curl -H 'x-auth-token: '$token http://cloud.lab.fi-ware.org:4730/v2.0/tenants

• Authenticate tenant to get token for Object Storage

curl -d '{"auth": {"passwordCredentials": {"username":"'$username'", "password":"'$password'"}, "tenantId":"'$tenantId'"}}' \ -H 'Content-type: aplication/json' \http://cloud.lab.fi-ware.org:4730/v2.0/tokens

• Object Storage URL

http://130.206.82.9:8080/v1/AUTH_tenantId

64

Page 65: Setting up your virtual infrastructure using FIWARE Lab Cloud

Blueprint functionalities

65

Page 66: Setting up your virtual infrastructure using FIWARE Lab Cloud

FIWARE Lab Cloud Hosting

• Deploying components for your application.

• Create blueprint templates.

• Create Tiers on a blueprint template.

• Launch blueprint templates -> create blueprint instances

• See details of the blueprint instance

• Check the SW installed on the blueprint instance.

66

Page 67: Setting up your virtual infrastructure using FIWARE Lab Cloud

Real scenario

• Users want to define lots of parameters.– Password, ports, default installation.

• Users want to install several things in the same server.– Tomcat + git, tomcat + java + git, …

• Users need to deploy complex environment.– One server for Tomcat, another for MySQL, …

• Some parameters are unknown before instantiate the system.

67

Page 68: Setting up your virtual infrastructure using FIWARE Lab Cloud

Deploying components for your application

68

• Deploying applications and not only Servers.• Ad hoc installation (not template usage).

• Managing applications in Servers (install, uninstall, configure, snapshot…).

• Deploying different environments for that applications.

Page 69: Setting up your virtual infrastructure using FIWARE Lab Cloud

Deploy example

Blueprint template: fiware1

• Blueprint Template: platform specification to be deployed.

• Tier: Each kind of software and server to be deployed.

• Each Tier can be deployed in one or several servers (e.g. tomcat, 2-5 servers).

• Blueprint Instance: Deployed in the testbed.Tier 1: Tomcat

Tier 2: Context Broker Tier 3: MongoDB

Server: 1 Server: 1

Servers: 2-5

Context Broker

Context Broker

69

Page 70: Setting up your virtual infrastructure using FIWARE Lab Cloud

Create a new blueprint template

70

Press the option“Blueprint Templates”

from menu

You can open the Catalog of Blueprint Template or create one

from the scratch.

Page 71: Setting up your virtual infrastructure using FIWARE Lab Cloud

Create a new blueprint template

71

You should introduce the “Name” and the “Description”.

Page 72: Setting up your virtual infrastructure using FIWARE Lab Cloud

Add tiers

72

To add new Tier,press “hh-template” name.

Page 73: Setting up your virtual infrastructure using FIWARE Lab Cloud

Add tiers

73

After press “Add Tier” you seethis windows to define the servers of this tier.

You must select a Keypairto access to those servers.

You should specify the maximum, minimum and current

number of servers

Page 74: Setting up your virtual infrastructure using FIWARE Lab Cloud

Add software in tier

74

Install software pressingthe mouse right click.

Page 75: Setting up your virtual infrastructure using FIWARE Lab Cloud

Add software in tier

75

Edit special attributes like default port.

Page 76: Setting up your virtual infrastructure using FIWARE Lab Cloud

Add software in tier

76

Page 77: Setting up your virtual infrastructure using FIWARE Lab Cloud

Connect network

77

Drag&Drop the network to connect the tier..

Introduce an alias to connect together several tiers.

Page 78: Setting up your virtual infrastructure using FIWARE Lab Cloud

Topology

78

Page 79: Setting up your virtual infrastructure using FIWARE Lab Cloud

Launch a Blueprint Template -> Blueprint Instance

79

Press “Action” and select “Launch Template” to launch

the Instance.

Page 80: Setting up your virtual infrastructure using FIWARE Lab Cloud

Launch a Blueprint Template -> Blueprint Instance

80

You should specify the “Name” and “Description” for

your blueprint.

Page 81: Setting up your virtual infrastructure using FIWARE Lab Cloud

Demo

81

Firstly, the deploymentof infrastructure.

Page 82: Setting up your virtual infrastructure using FIWARE Lab Cloud

Demo

82

Secondly, the installationof the software.

Page 83: Setting up your virtual infrastructure using FIWARE Lab Cloud

Demo

83

Finally, if all was ok.Pressing the name you can

see the tiers of this blueprint.

Page 84: Setting up your virtual infrastructure using FIWARE Lab Cloud

Demo

84

Press it to get informationof your server.

Page 85: Setting up your virtual infrastructure using FIWARE Lab Cloud

Demo

85

Page 86: Setting up your virtual infrastructure using FIWARE Lab Cloud

Demo

86

Page 87: Setting up your virtual infrastructure using FIWARE Lab Cloud

Demo

87

Page 88: Setting up your virtual infrastructure using FIWARE Lab Cloud

Documentation

• FIWARE Cloud Portal:– Documentation: http://catalogue.fi-ware.org/enablers/self-

service-interfaces-cloud-portal-upm

• FIWARE Cloud Infrastructure– Account: http://catalogue.fi-ware.org/enablers/identity-

management-keyrock– SDC: http://catalogue.fi-ware.org/enablers/software-

deployment-configuration-sagitta– PaaS Manager: http://catalogue.fi-ware.org/enablers/paas-

manager-pegasus

• FIWARE eLearning Platform– http://edu.fi-ware.org/

88

Page 89: Setting up your virtual infrastructure using FIWARE Lab Cloud
Page 90: Setting up your virtual infrastructure using FIWARE Lab Cloud

If you have any question or problem contact to

[email protected]

You can go to stackoverflow and ask question with the tag fiware and/or filab.

90

Page 91: Setting up your virtual infrastructure using FIWARE Lab Cloud
Page 92: Setting up your virtual infrastructure using FIWARE Lab Cloud

Thanks!Thanks!

(Slides: http://tinyurl.com/fiwarelab-cloud)