This is a static archive of the previous Open Grid Forum GridForge content management system saved from host forge.ogf.org file /sf/wiki/do/viewPage/projects.occi-wg/wiki/ScenarioSet1 at Sun, 06 Nov 2022 12:20:14 GMT SourceForge : View Wiki Page: ScenarioSet1

Project Home

Tracker

Documents

Tasks

Source Code

Discussions

File Releases

Wiki

Project Admin

Web Site
Search Wiki Pages Project: occi-wg     Wiki > ScenarioSet1 > View Wiki Page
wiki2473: ScenarioSet1

Open Issues

  • Review request/response renderings - these were created ~1-2 months ago

Scenario Set 1

Initial VM Creation Request. There are three main ways to do this using OCCI. 1. Take the provider defaults. To do this send a request as shown in the 1st example. This is the minimum of information required by clients to supply. A provider must always provision its cheapest VM if this method is used. 2. Select a preset configuration offered by the provider. Some providers may choose to this. If they do, they must create categories that correspond to the preset VM configurations. For example, for Amazon EC2 who offers a number of preset configurations (instance types) would create the following categories:
  • Small Instance (m1.small) = Category: m1.small; scheme="http://amazon.com/ec2/compute#"; title="Small Instance"
  • Large Instance (m1.large) = Category: m1.large; scheme="http://amazon.com/ec2/compute#"; title="Large Instance"
  • Extra Large Instance (m1.xlarge) = Category: m1.xlarge; scheme="http://amazon.com/ec2/compute#"; title="Extra Large Instance"
  • High-Memory Extra Large Instance (m2.xlarge) = Category: m2.xlarge; scheme="http://amazon.com/ec2/compute#"; title="High-Memory Extra Large Instance"
  • High-Memory Double Extra Large Instance (m2.2xlarge) = Category: m2.2xlarge; scheme="http://amazon.com/ec2/compute#"; title="High-Memory Double Extra Large Instance"
  • High-Memory Quadruple Extra Large Instance (m2.4xlarge) = Category: m2.4xlarge; scheme="http://amazon.com/ec2/compute#"; title="High-Memory Quadruple Extra Large Instance"
  • High-CPU Medium Instance (c1.medium) = Category: c1.medium; scheme="http://amazon.com/ec2/compute#"; title="High-CPU Medium Instance"
  • High-CPU Extra Large Instance (c1.xlarge) = Category: c1.xlarge; scheme="http://amazon.com/ec2/compute#"; title="High-CPU Extra Large Instance"

3. Customise the request. To do this send a request as shown in the 2nd example. Only send the attributes you wish to customise. There is no need to send attributes with default values. If a provider does not support this mechanism it must return a HTTP code 400 in the response response.

Below we show examples of creating compute resources in the three way defined above.

1. Provider Defaults Provisioning

POST /compute HTTP/1.1

Host: example.com
Authorization: Basic xxxxxxxxxxxxxxxxxxx
User-Agent: occi-client/1.0 (linux) libcurl/7.19.4 OCCI/1.0
Category: compute; scheme="http://purl.org/occi/kind#"; label="Compute Resource"

Content-Length: 0

2. Preset Configuration Provisioning

POST /compute HTTP/1.1
Host: example.com
Authorization: Basic xxxxxxxxxxxxxxxxxxx
User-Agent: occi-client/1.0 (linux) libcurl/7.19.4 OCCI/1.0
Category: m2.2xlarge; scheme="http://example.com/ec2/compute#"; title="High-Memory Double Extra Large Instance"
Content-Length: 0

3. Customised Configuration

POST /compute HTTP/1.1
Host: example.com
Authorization: Basic xxxxxxxxxxxxxxxxxxx
User-Agent: occi-client/1.0 (linux) libcurl/7.19.4 OCCI/1.0
Category: compute; scheme="http://purl.org/occi/kind#"; label="Compute Resource"
Category: myimage; scheme="http://example.com/user/categories/templates#"; label="My very specical server"

Content-Length: 0

occi.compute.cores=4
occi.compute.memory=16

Provisioning Response

HTTP/1.1 202 Accepted 
Server: occi-server/1.0 (linux) OCCI/1.0
Date: Wed, 27 Jan 2010 17:26:42 GMT
Location: /jobs/123
Content-Length: 0

Each creation requests will result in the same response. The virtual machine is now in a state of provisioning. Note that the result contains a URL to allow a client check on the provisioning status.

Check the provisioning status...

GET /jobs/123-123-123 HTTP/1.1
Host: example.com
Authorization: Basic xxxxxxxxxxxxxxxxxxx
User-Agent: occi-client/1.0 (linux) libcurl/7.19.4 OCCI/1.0
Date: Wed, 27 Jan 2010 17:28:40 GMT
Content-Length: 0


HTTP/1.1 200 OK
Server: occi-server/1.0 (linux) OCCI/1.0
Date: Wed, 27 Jan 2010 17:28:42 GMT
occi.status.state: running

occi.status.progress: 65

occi.status.message: "Resource is being provisioned"
Content-Length: 0

The virtual machine is 65% through the process of provisioning. We'll wait and check again...

GET /jobs/123-123-123 HTTP/1.1
Host: example.com
Authorization: Basic xxxxxxxxxxxxxxxxxxx
User-Agent: occi-client/1.0 (linux) libcurl/7.19.4 OCCI/1.0
Date: Wed, 27 Jan 2010 17:30:40 GMT
Content-Length: 0


HTTP/1.1 301 Found
Server: occi-server/1.0 (linux) OCCI/1.0
Date: Wed, 27 Jan 2010 17:30:42 GMT
Location: /compute/345-345-345
occi.status.state: completed

occi.status.progress: 100

occi.status.message: "Resource is now running"
Content-Length: 0

The virtual machine is now operational and running. Full details of the VM can be found at the URL pointed to by Location. Let's get information on the newly provisioned VM...

GET /compute/345-345-345 HTTP/1.1
Authorization: Basic xxxxxxxxxxxxxxxxxxx
User-Agent: occi-client/1.0 (linux) libcurl/7.19.4 OCCI/1.0
Host: example.com
Accept: */*


HTTP/1.1 200 OK 
Server: occi-server/1.0 (linux) OCCI/1.0
Date: Wed, 27 Jan 2010 17:26:40 GMT
Category: compute; scheme="http://purl.org/occi/kind#"; label="Compute Resource"
Category: ubuntu; scheme="http://purl.org/occi/template#"; label="Ubuntu"
Link: </compute/345-345-345/default>; rel="http://purl.org/occi/link#networklink"; title="Default Public Connection";
Link: </compute/345-345-345;start>; class="action"; rel="http://purl.org/occi/action#start"; title="Start"
Link: </compute/345-345-345;stop>; class="action"; rel="http://purl.org/occi/action#stop"; title="Stop"
Link: </compute/345-345-345;reboot>; class="action"; rel="http://purl.org/occi/action#reboot"; title="Reboot"
Link: </compute/345-345-345;suspend>; class="action"; rel="http://purl.org/occi/action#suspend"; title="Suspend"
summary="This VM runs a LAMP stack, serving my personal wordpress blog"
occi.compute.architecture=x64
occi.compute.cores=1
occi.compute.hostname=345-345-345.provider.com
occi.compute.speed=2.4
occi.compute.memory=4
occi.compute.status=active

This provider is security conscious and does not immediately connect the VM to the internet. To do this lets see what the Action is to perform the connection. To see the actions on the network link let's request the network link.

GET /compute/345-345-345/default HTTP/1.1
Authorization: Basic xxxxxxxxxxxxxxxxxxx
User-Agent: occi-client/1.0 (linux) libcurl/7.19.4 OCCI/1.0

Host: example.com
Accept: */*


HTTP/1.1 200 OK 
Server: occi-server/1.0 (linux) OCCI/1.0
Date: Wed, 27 Jan 2010 17:26:40 GMT
Link: </compute/345-345-345/default>; class="link"; rel="self"; title="type"
Link: </network/566-566-566>; class="link"
Link: </compute/345-345-345/default;up>; class="action"; rel="http://purl.org/occi/action#up"; title="UP"
Link: </compute/345-345-345/default;down>; class="action"; rel="http://purl.org/occi/action#down"; title="Down"
ip=DHCP
device=eth0
status=down

Retrieving the network link associated with the virtual machine we can see the attributes of the link but also the Actions that can be carried out. Currently the link is offline and we want to bring it online. To do this we issue the following request

POST /compute/345-345-345/default;up HTTP/1.1
Authorization: Basic xxxxxxxxxxxxxxxxxxx

Server: occi-server/1.0 (linux) OCCI/1.0
Date: Wed, 27 Jan 2010 17:28:40 GMT

This will result in the following response

HTTP/1.1 202 Accepted 
Server: occi-server/1.0 (linux) OCCI/1.0
Date: Wed, 27 Jan 2010 17:27:42 GMT
Location: /jobs/9987
Content-Length: 0

This will complete in the very same way as the provisioning of the compute resource. Once the GET call to /jobs/9987 completes the compute resource will be publicly available.

 




The Open Grid Forum Contact Webmaster | Report a problem | GridForge Help
This is a static archive of the previous Open Grid Forum GridForge content management system saved from host forge.ogf.org file /sf/wiki/do/viewPage/projects.occi-wg/wiki/ScenarioSet1 at Sun, 06 Nov 2022 12:20:17 GMT