occi-os tutorial

9
OCCI at OpenStack Álvaro López García 1 1 [email protected] Spanish National Research Council (CSIC) Instituto de Física de Cantabria (IFCA) CloudPlugFest EGI TF 2013 Septembrer 2013 - Madrid, Spain A. López García OCCI at OpenStack

Upload: alan-sill

Post on 12-May-2015

500 views

Category:

Technology


0 download

DESCRIPTION

Talk given by Álvaro López García of the Instituto de Física de Cantabria at the Cloud Interoperability Week tutorial session of Cloud Plugfest 10 in Madrid, Spain, 19 Sep 2013.

TRANSCRIPT

Page 1: OCCI-OS tutorial

OCCI at OpenStack

Álvaro López García 1

[email protected] National Research Council (CSIC)

Instituto de Física de Cantabria (IFCA)

CloudPlugFestEGI TF 2013

Septembrer 2013 - Madrid, Spain

A. López García OCCI at OpenStack

Page 2: OCCI-OS tutorial

OCCI at OpenStack

There is no official release of OCCI for OpenStack.OpenStack decided to only support their native API.The only exception is the EC2 Compatibility layer.

A. López García OCCI at OpenStack

Page 3: OCCI-OS tutorial

OCCI at OpenStack

OCCI-OS interface started by Thijs Metsch from Intel andAndy Edmonds with community contributions.Code locations:

Stackforge will become the official place (being migrated):https://github.com/stackforge/occi-osThjis repository (development):https://github.com/tmetsch/occi-osMy repo (development with additions):https://github.com/alvarolopez/occi-os/

stable/<release_name branches should contain stable codeto be deployed with the corresponding version.Usage documentationhttps://wiki.openstack.org/wiki/Occi

A. López García OCCI at OpenStack

Page 4: OCCI-OS tutorial

OCCI-OS Installation

Install the code and dependencies. You should ensure that youare using the correct branch from the code.

pip install pyssfgit clone https://github.com/alvarolopez/occi-os/cd occi-ospython setup.py install

Currently, use the master branch for Grizzly.No version for Havana so far.

A. López García OCCI at OpenStack

Page 5: OCCI-OS tutorial

OCCI-OS Configuration

Add it to the nova’s api-paste.ini configuration:

[composite:occiapi]use = egg:Paste#urlmap/: occiapppipe

[pipeline:occiapppipe]pipeline = authtoken keystonecontext occiapp# with request body size limiting and rate limiting# pipeline = sizelimit authtoken keystonecontext ratelimit occiapp

[app:occiapp]use = egg:openstackocci-grizzly#occi_app

Enable it in your nova.conf file:

enabled_apis=ec2,occiapi,osapi_compute,osapi_volume,metadata

Restart nova-api and you’re done.

A. López García OCCI at OpenStack

Page 6: OCCI-OS tutorial

Use it!

First get a keystone token first:

$ curl --insecure -H \"Content-type: application/json" -d ’{"auth": \{"tenantName": "whatever", "passwordCredentials": \{"username": "demo", "password": "secret"}}}’ \https://keystone.example.org:5000/v2.0/tokens

(...)"token": {

"expires": "2013-09-20T14:34:54Z","id": "ae6259e89fc8434a8d7122e1f9fdc0f0","issued_at": "2013-09-19T14:34:54.827264",(...)

Grab the token ID:

export KID=ae6259e89fc8434a8d7122e1f9fdc0f0

A. López García OCCI at OpenStack

Page 7: OCCI-OS tutorial

Use it!

See what you can provision:

$ curl -v -H ’Content-Type: text/occi’ \-H ’X-Auth-Token: ’$KID \-X GET http://cloudapi.example.org:8787/-/

A. López García OCCI at OpenStack

Page 8: OCCI-OS tutorial

Use it!

Spawn a virtual machine:

$ curl -v -X POST http://cloudapi.example.org:8787/compute/ \-H ’Category: compute; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind"’ \-H ’Content-Type: text/occi’ \-H ’X-Auth-Token: ’$KID \-H ’Category: m1-tiny; scheme="http://schemas.openstack.org/template/resource#"; class="mixin"’ \-H ’Category: 18d99a06-c3e5-4157-a0e3-37ec34bdfc24; scheme="http://schemas.openstack.org/template/os#"; class="mixin"’ \-H ’Category: public_key; scheme="http://schemas.openstack.org/instance/credentials#"; class="mixin"’

A. López García OCCI at OpenStack

Page 9: OCCI-OS tutorial

The end

¡Thank you very much!

A. López García OCCI at OpenStack