ViPR 2.2 - Add Compute Images Using the ViPR REST API

Table of Contents

Overview

ViPR system administrators can learn the ViPR configuration requirements for compute images, and how to add compute images to ViPR.

Compute Images are operating system (OS) installation files (ISO images) that ViPR uses to deploy operating systems on Vblock compute elements that have been registered to ViPR. If ViPR is used to provisionESX clusters, ViPR can also be used to add the cluster to a vCenter datacenter that has been registered to ViPR.

Refer to Configure and Add Vblock Compute Systems to ViPR Using the ViPR REST API for information on registering a Vblock compute system to ViPR.

Back to Top

Add Compute Images

Add a compute image to ViPR using POST /compute/images.

Before you begin

Procedure

  1. Add the compute image to ViPR using POST /compute/images. A task is returned whose URI can be queried to determine the status of the task.
    Request
    POST https://<ViPR_VIP>:4443/compute/images
    Content-Type: application/xml
    X-SDS-AUTH-TOKEN: <AUTH_TOKEN>
    
    <compute_image_create>
      <name>MyImage</name>
      <image_url>ftp://MyServer/myimage</image_url>
    </compute_image_create>
    
    Response
    HTTP 202 Accepted
    Content-Type: application/xml
    
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <task>
         <creation_time>1421941720408</creation_time>
         <global>false</global>
         <id>urn:storageos:Task:2e97d85b-e160-45d7-99cf-0b57386a7974:vdc1</id>
         <inactive>false</inactive>
         <internal>false</internal>
         <link rel="self" href="/vdc/tasks/urn:storageos:Task:2e97d85b-e160-45d7-99cf-0b57386a7974:vdc1"/>
         <name>IMPORT IMAGE</name>
         <remote>false</remote>
         <tags/>
         <vdc>
              <id>urn:storageos:VirtualDataCenter:a2c45423-20a4-4d50-a8cc-f81175a4ee75:vdc1</id>
              <link rel="self" href="/vdc/urn:storageos:VirtualDataCenter:a2c45423-20a4-4d50-a8cc-f81175a4ee75:vdc1"/></vdc>
         <associated_resources/>
         <description>import an image.</description>
         <op_id>1e9e4280-d40f-44cd-94c6-b6114169fd59</op_id>
         <progress>0</progress>
         <resource>
              <id>urn:storageos:ComputeImage:c3c45b49-20ad-4b19-a4a0-5f72694cbcfe:vdc1</id>
              <link rel="self" href="/compute/images/urn:storageos:ComputeImage:c3c45b49-20ad-4b19-a4a0-5f72694cbcfe:vdc1"/>
              <name>MyImage</name>
         </resource>
         <start_time>1421941720407</start_time>
         <state>pending</state>
    </task>
  2. Query the add compute image task, using the task ID from the response body of the POST request. When the message attribute of the task is Operation completed successfully, the operation has completed and the compute image has been added to ViPR.
    Request
    https://<ViPR_VIP>:4443/vdc/tasks/urn:storageos:Task:2e97d85b-e160-45d7-99cf-0b57386a7974:vdc1
    Content-Type: application/xml
    X-SDS-AUTH-TOKEN: <AUTH_TOKEN>
    Response
    HTTP 200 OK
    Content-Type: application/xml
    
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <task>
         <creation_time>1421941720408</creation_time>
         <global>false</global>
         <id>urn:storageos:Task:2e97d85b-e160-45d7-99cf-0b57386a7974:vdc1</id>
         <inactive>false</inactive>
         <internal>false</internal>
         <link rel="self" href="/vdc/tasks/urn:storageos:Task:2e97d85b-e160-45d7-99cf-0b57386a7974:vdc1"/>
         <name>IMPORT IMAGE</name>
         <remote>false</remote>
         <tags/>
         <vdc>
              <id>urn:storageos:VirtualDataCenter:a2c45423-20a4-4d50-a8cc-f81175a4ee75:vdc1</id>
              <link rel="self" href="/vdc/urn:storageos:VirtualDataCenter:a2c45423-20a4-4d50-a8cc-f81175a4ee75:vdc1"/></vdc>
         <associated_resources/>
         <description>import an image.</description>
         <end_time>1421945593699</end_time>
         <message>Operation completed successfully</message>
         <op_id>1e9e4280-d40f-44cd-94c6-b6114169fd59</op_id>
         <progress>100</progress>
         <resource>
              <id>urn:storageos:ComputeImage:c3c45b49-20ad-4b19-a4a0-5f72694cbcfe:vdc1</id>
              <link rel="self" href="/compute/images/urn:storageos:ComputeImage:c3c45b49-20ad-4b19-a4a0-5f72694cbcfe:vdc1"/>
              <name>MyImage</name>
         </resource>
         <start_time>1421941720407</start_time>
         <state>ready</state>
    </task>
Back to Top

Additional REST API calls to manage your Compute Images

The table shows some additional APIs that are used to manage your Compute Images

Back to Top