Jump to: navigation, search

Difference between revisions of "Occi"

(added details on implementation.)
Line 5: Line 5:
  
 
== Summary ==
 
== Summary ==
This will implement the open cloud compute interface within nova/api.  Specification for the OCCI API can be found here: http://forge.ogf.org/sf/go/projects.occi-wg/wiki
+
This will implement the Open Cloud Computing Interface (OCCI) within nova/api.  The specification of OCCI can be found here: http://www.occi-wg.org
  
 
== Implementation details ==
 
== Implementation details ==
Most probably we gonna use the pyocci module from http://pyssf.sf.net. It is a WSGI compliant service currently running on Tornado - but that can/should be changed for an [[OpenStack]] implementation.
+
The OCCI interface is integrated using an WSGI application - it can coexist to the current APIs but offers a rich, flexible interoperable way to interact with [[OpenStack]] through a standardized interface.
  
We are targetting the Bexar release of [[OpenStack]] for a first shot of an OCCI implementation for [[OpenStack]]. Most probably full support of OCCI will be available in the following release. Ideal would be if this work is in aligmnent with an CDMI implementation in [[OpenStack]].
+
== How to use the OCCI interface ==
 +
The following sections demonstrate how OCCI can be used - it just shows the general operations - not the full feature set.
  
Next steps:
+
=== Get Authentication Credentials from Keystone ===
  
* Workout integration of pyocci in [[OpenStack]] (Messaging - Input coming from Soren)
+
<pre><nowiki>{
* Create branch and start working on a simple first provisioning of VMs
+
curl -d '{"auth":{"passwordCredentials":{"username": "admin", "password": "<password>"</nowiki></pre>
* Integrate CDMI with OCCI
+
' -H "Content-type: application/json"
* Interop testing with help of jClouds
+
export $KID=<Token from Keystone>
 +
</nowiki></pre>
 +
}
 +
=== Get the Tenant ID from [[OpenStack]] ===
 +
There are two ways to get your Tenant id: through the dashboard or the command line. After retrieving it:
  
== Release Note ==
 
This section should include a paragraph describing the end-user impact of this change.  It is meant to be included in the release notes of the first release in which it is implemented.  (Not all of these will actually be included in the release notes, at the release manager's discretion; but writing them is a useful exercise.)
 
  
It is mandatory.
+
<pre><nowiki>
 +
export TEN_ID=<tenant ID>
 +
</nowiki></pre>
 +
 
 +
 
 +
=== Get a valid Tenant User ===
 +
 
 +
<pre><nowiki>
 +
export OS_USER=<open stack user name>
 +
</nowiki></pre>
 +
 
 +
 
 +
Note: this requirement will go by having an OCCI-specific authentication middleware
 +
 
 +
=== See What Can be Provisioned ===
 +
The following command will use the query interface to query the capabilities of the service provider:
 +
 
 +
<pre><nowiki>
 +
curl -v -H 'X-Auth-Token: '$KID -H 'X-Auth-Tenant-Id: '$TEN_ID -H 'X-Auth-User: '$OS_USER -X GET localhost:8787/-/
 +
</nowiki></pre>
 +
 
 +
 
 +
=== Create a VM ===
 +
 
 +
<pre><nowiki>
 +
curl -v -X POST localhost: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 'X-Auth-Tenant-Id: '$TEN_ID -H 'X-Auth-User: '$OS_USER -H 'Category: m1.tiny; scheme="http://schemas.openstack.org/template/resource#"; class="mixin"' -H 'Category: cirros-0.3.0-x86_64-blank; scheme="http://schemas.openstack.org/template/os#"; class="mixin"'
 +
</nowiki></pre>
 +
 
 +
 
 +
For ease of this OCCI exercise, place the VM id into a shell variable e.g.
 +
 
 +
 
 +
<pre><nowiki>
 +
export VM=d54b4344-16be-486a-9871-2c566ef2263d
 +
</nowiki></pre>
 +
 
 +
 
 +
=== Get a Listing of VMs ===
 +
 
 +
 
 +
<pre><nowiki>
 +
curl -v -X GET localhost:8787/compute/ -H 'Content-Type: text/occi' -H 'X-Auth-Token: '$KID -H 'X-Auth-Tenant-Id: '$TEN_ID -H 'X-Auth-User: '$OS_USER
 +
</nowiki></pre>
 +
 
 +
 
 +
=== Get an Individual VM's Details ===
 +
 
 +
 
 +
<pre><nowiki>
 +
curl -v -X GET localhost:8787/compute/$VM -H 'Content-Type: text/occi' -H 'X-Auth-Token: '$KID -H 'X-Auth-Tenant-Id: '$TEN_ID -H 'X-Auth-User: '$OS_USER
 +
</nowiki></pre>
 +
 
 +
 
 +
=== Execute a Stop Action Upon a VM ===
 +
 
 +
<pre><nowiki>
 +
curl -v -X POST "localhost:8787/compute/$VM?action=stop" -H 'Content-Type: text/occi' -H 'X-Auth-Token: '$KID -H 'X-Auth-Tenant-Id: '$TEN_ID -H 'X-Auth-User: '$OS_USER -H 'Category: stop; scheme="http://schemas.ogf.org/occi/infrastructure/compute/action#"; class="action"'
 +
</nowiki></pre>
 +
 
 +
 
 +
=== Execute a Start Action Upon a VM ===
 +
 
 +
<pre><nowiki>
 +
curl -v -X POST localhost:8787/compute/$VM?action=start -H 'Content-Type: text/occi' -H 'X-Auth-Token: '$KID -H 'X-Auth-Tenant-Id: '$TEN_ID -H 'X-Auth-User: '$OS_USER -H 'Category: start; scheme="http://schemas.ogf.org/occi/infrastructure/compute/action#"; class="action"'
 +
</nowiki></pre>
 +
 
 +
 
 +
=== Scale Up a VM ===
 +
Scalling up the VM from m1.tiny (128 RAM, 1 Core) to a m1.tiny flavour (256 RAM, 1 Core).
 +
 
 +
 
 +
<pre><nowiki>
 +
curl -v -X POST localhost:8787/compute/$VM -H 'Content-Type: text/occi' -H 'X-Auth-Token: '$KID -H 'X-Auth-Tenant-Id: '$TEN_ID -H 'X-Auth-User: '$OS_USER -H 'Category: m1.tiny; scheme="http://schemas.openstack.org/template/resource#"; class="mixin"'
 +
</nowiki></pre>
 +
 
 +
 
 +
=== Confirm the Scaled Up VM ===
 +
 
 +
<pre><nowiki>
 +
curl -v -X POST "localhost:8787/compute/$VM?action=confirm_resize" -H 'Content-Type: text/occi' -H 'X-Auth-Token: '$KID -H 'X-Auth-Tenant-Id: '$TEN_ID -H 'X-Auth-User: '$OS_USER -H 'Category: confirm_resize; scheme="http://schemas.openstack.org/instance/action#"; class="action"'
 +
</nowiki></pre>
 +
 
 +
 
 +
=== Delete a VM ===
 +
 
 +
<pre><nowiki>
 +
curl -v -X DELETE localhost:8787/compute/$VM -H 'Content-Type: text/occi' -H 'X-Auth-Token: '$KID -H 'X-Auth-Tenant-Id: '$TEN_ID -H 'X-Auth-User: '$OS_USER
 +
</nowiki></pre>
 +
 
  
== Rationale ==
+
== Release Note ==
== User stories ==
+
TBD
== Assumptions ==
 
== Design ==
 
You can have subsections that better describe specific parts of the issue.
 
  
 
== Implementation ==
 
== Implementation ==
This section should describe a plan of action (the "how") to implement the changes discussed. Could include subsections like:
+
The integration will use the pyssf software package which delivers a OCCI WSGI application. This code will be used to integrate the OCCI interface.
  
 
=== UI Changes ===
 
=== UI Changes ===
Should cover changes required to the UI, or specific UI that is required to implement this
+
Does not affect any GUI elements.
  
 
=== Code Changes ===
 
=== Code Changes ===
Code changes should include an overview of what needs to change, and in some cases even the specific details.
+
These are the changes we would love to see in the [[OpenStack]] compute api:
 +
 
 +
* Specify the size of a volume as float
 +
* A way to retrieve the speed of an CPU
  
 
=== Migration ===
 
=== Migration ===
Include:
+
* N/A
 
 
* data migration, if any
 
* redirects from old URLs to new ones, if any
 
* how users will be pointed to the new way of doing things, if necessary.
 
  
 
== Test/Demo Plan ==
 
== Test/Demo Plan ==
This need not be added or completed until the specification is nearing beta.
+
Unittests have been implemented and will be extended. Code is checked on a regularly basis to verify it meets the [[OpenStack]] coding guidelines.
  
 
== Unresolved issues ==
 
== Unresolved issues ==
This should highlight any issues that should be addressed in further specifications, and not problems with the specification itself; since any specification with problems cannot be approved.
+
* N/A
 
 
== BoF agenda and discussion ==
 
Use this section to take notes during the BoF; if you keep it in the approved spec, use it for summarising what was discussed and note any options that were rejected.
 
  
 
----
 
----
 
[[Category:Spec]] [[Category:Nova]]
 
[[Category:Spec]] [[Category:Nova]]

Revision as of 09:06, 1 March 2012

  • Launchpad Entry: NovaSpec:bexar-open-cloud-compute-interface
  • Created: 11/10/2010
  • Contributors: Thijs Metsch (tmetsch), Andy Edmonds (dizz)

Summary

This will implement the Open Cloud Computing Interface (OCCI) within nova/api. The specification of OCCI can be found here: http://www.occi-wg.org

Implementation details

The OCCI interface is integrated using an WSGI application - it can coexist to the current APIs but offers a rich, flexible interoperable way to interact with OpenStack through a standardized interface.

How to use the OCCI interface

The following sections demonstrate how OCCI can be used - it just shows the general operations - not the full feature set.

Get Authentication Credentials from Keystone

{
curl -d '{"auth":{"passwordCredentials":{"username": "admin", "password": "<password>"

' -H "Content-type: application/json" export $KID=<Token from Keystone> </nowiki></pre> }

Get the Tenant ID from OpenStack

There are two ways to get your Tenant id: through the dashboard or the command line. After retrieving it:


export TEN_ID=<tenant ID>


Get a valid Tenant User

export OS_USER=<open stack user name>


Note: this requirement will go by having an OCCI-specific authentication middleware

See What Can be Provisioned

The following command will use the query interface to query the capabilities of the service provider:

curl -v -H 'X-Auth-Token: '$KID -H 'X-Auth-Tenant-Id: '$TEN_ID -H 'X-Auth-User: '$OS_USER -X GET localhost:8787/-/


Create a VM

curl -v -X POST localhost: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 'X-Auth-Tenant-Id: '$TEN_ID -H 'X-Auth-User: '$OS_USER -H 'Category: m1.tiny; scheme="http://schemas.openstack.org/template/resource#"; class="mixin"' -H 'Category: cirros-0.3.0-x86_64-blank; scheme="http://schemas.openstack.org/template/os#"; class="mixin"'


For ease of this OCCI exercise, place the VM id into a shell variable e.g.


export VM=d54b4344-16be-486a-9871-2c566ef2263d


Get a Listing of VMs

curl -v -X GET localhost:8787/compute/ -H 'Content-Type: text/occi' -H 'X-Auth-Token: '$KID -H 'X-Auth-Tenant-Id: '$TEN_ID -H 'X-Auth-User: '$OS_USER


Get an Individual VM's Details

curl -v -X GET localhost:8787/compute/$VM -H 'Content-Type: text/occi' -H 'X-Auth-Token: '$KID -H 'X-Auth-Tenant-Id: '$TEN_ID -H 'X-Auth-User: '$OS_USER


Execute a Stop Action Upon a VM

curl -v -X POST "localhost:8787/compute/$VM?action=stop" -H 'Content-Type: text/occi' -H 'X-Auth-Token: '$KID -H 'X-Auth-Tenant-Id: '$TEN_ID -H 'X-Auth-User: '$OS_USER -H 'Category: stop; scheme="http://schemas.ogf.org/occi/infrastructure/compute/action#"; class="action"'


Execute a Start Action Upon a VM

curl -v -X POST localhost:8787/compute/$VM?action=start -H 'Content-Type: text/occi' -H 'X-Auth-Token: '$KID -H 'X-Auth-Tenant-Id: '$TEN_ID -H 'X-Auth-User: '$OS_USER -H 'Category: start; scheme="http://schemas.ogf.org/occi/infrastructure/compute/action#"; class="action"'


Scale Up a VM

Scalling up the VM from m1.tiny (128 RAM, 1 Core) to a m1.tiny flavour (256 RAM, 1 Core).


curl -v -X POST localhost:8787/compute/$VM -H 'Content-Type: text/occi' -H 'X-Auth-Token: '$KID -H 'X-Auth-Tenant-Id: '$TEN_ID -H 'X-Auth-User: '$OS_USER -H 'Category: m1.tiny; scheme="http://schemas.openstack.org/template/resource#"; class="mixin"'


Confirm the Scaled Up VM

curl -v -X POST "localhost:8787/compute/$VM?action=confirm_resize" -H 'Content-Type: text/occi' -H 'X-Auth-Token: '$KID -H 'X-Auth-Tenant-Id: '$TEN_ID -H 'X-Auth-User: '$OS_USER -H 'Category: confirm_resize; scheme="http://schemas.openstack.org/instance/action#"; class="action"'


Delete a VM

curl -v -X DELETE localhost:8787/compute/$VM -H 'Content-Type: text/occi' -H 'X-Auth-Token: '$KID -H 'X-Auth-Tenant-Id: '$TEN_ID -H 'X-Auth-User: '$OS_USER


Release Note

TBD

Implementation

The integration will use the pyssf software package which delivers a OCCI WSGI application. This code will be used to integrate the OCCI interface.

UI Changes

Does not affect any GUI elements.

Code Changes

These are the changes we would love to see in the OpenStack compute api:

  • Specify the size of a volume as float
  • A way to retrieve the speed of an CPU

Migration

  • N/A

Test/Demo Plan

Unittests have been implemented and will be extended. Code is checked on a regularly basis to verify it meets the OpenStack coding guidelines.

Unresolved issues

  • N/A