Difference between revisions of "Occi"
Line 5: | Line 5: | ||
== Summary == | == Summary == | ||
− | This will implement the Open Cloud Computing Interface (OCCI) within nova/api. | + | This will implement the Open Cloud Computing Interface (OCCI) within nova/api. OCCI is one of the first standards in Cloud Computing. The specification of OCCI can be found here: http://www.occi-wg.org |
== Implementation details == | == Implementation details == |
Revision as of 09:09, 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. OCCI is one of the first standards in Cloud Computing. 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