ViPR 2.2 - Add vCenter and ESX/ESXi Clusters to ViPR using the ViPR REST API

Table of Contents

Overview

This article provides ViPR System and Tenant Administrators the ViPR support requirements, and prerequisite information to prepare vCenters for ViPR integration, the steps to add the host to ViPR, the important REST API calls used to manage vCenter and ESX/ESXi clusters.

This article is part of a series

vCenters to ViPR at anytime. If, however, you are setting up the ViPR Controller virtual data center for the first time, before you continue to provision storage, complete the following steps.
  1. Authenticate with the ViPR REST API
  2. Add physical assets to ViPR:
  3. Create ViPR virtual assets:
    1. Create and configure a virtual array
    2. Create virtual pools:

Back to Top

Add and discover a vCenter server

To manage a vCenter server in ViPR, you have to add the server to ViPR through the ViPR user interface or through the ViPR REST API, as in this example. ViPR automatically discovers the host, clusters and other resources managed by that server.

Before you begin

To complete this procedure:

The following steps describe how to add a vCenter server to ViPR using the REST API. To use the ViPR UI to add a vCenter to ViPR see the Add vCenters and ESX/ESXi Clusters to ViPR article.

Procedure

  1. Get the URN of your tenant.
    GET https://<ViPR_VIP>:4443/tenant
    Content-Type: application/xml
    X-SDS-AUTH-TOKEN: <AUTH_TOKEN>
  2. Use the tenant URN to create a vCenter.
    Request
    POST https://<ViPR_VIP>:4443/tenants/{Tenant_URN}/vcenters
    Content-Type: application/xml
    X-SDS-AUTH-TOKEN: <AUTH_TOKEN>
    
    <vcenter_create>
         <ip_address>192.168.0.0</ip_address>
         <name>vcenter_west</name>
         <port_number>443</port_number>
         <user_name>admin_user</user_name>
         <password>Password1</password>
    </vcenter_create>
    
    Response
    HTTP 202 Accepted
    Content-Type: application/xml
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <task>
         <creation_time>1423595062584</creation_time>
         <global>false</global>
         <id>urn:storageos:Task:e2a06ffe-1a96-4f54-9463-f426fc4083d8:vdc1</id>
         <inactive>false</inactive>
         <internal>false</internal>
         <link rel="self" href="/vdc/tasks/urn:storageos:Task:e2a06ffe-1a96-4f54-9463-f426fc4083d8:vdc1"/>
         <name>DISCOVER VCENTER</name>
         <remote>false</remote>
         <tags/>
         <vdc>
              <id>urn:storageos:VirtualDataCenter:99c5c185-ebb0-468a-8fe7-3ea6e65b7b57:vdc1</id>
              <link rel="self" href="/vdc/urn:storageos:VirtualDataCenter:99c5c185-ebb0-468a-8fe7-3ea6e65b7b57:vdc1"/>
         </vdc>
         <associated_resources/>
         <description>discover a vcenter</description>
         <op_id>c3eefcb2-5a13-4446-b31f-76a172dc7701</op_id>
         <progress>0</progress>
         <resource>
              <id>urn:storageos:Vcenter:316465e4-8661-4d73-a60d-c2132f0ff868:vdc1</id>
              <link rel="self" href="/compute/vcenters/urn:storageos:Vcenter:316465e4-8661-4d73-a60d-c2132f0ff868:vdc1"/>
              <name>vcenter_west</name>
         </resource>
         <start_time>1423595062583</start_time>
         <state>pending</state>
         <tenant>
              <id>urn:storageos:TenantOrg:c104b49e-4e6b-449c-b92b-a19b247a613b:global</id>
              <link rel="self" href="/tenants/urn:storageos:TenantOrg:c104b49e-4e6b-449c-b92b-a19b247a613b:global"/>
         </tenant>
    </task>
    
  3. Query the vCenter create task, using the task URL from the response body of the POST request, until the message attribute of the task is Operation completed successfully which indicates that the operation has completed and the vCenter has been added to ViPR and successfully discovered.
    Request
    GET https://<ViPR_VIP>:4443/vdc/tasks/urn:storageos:Task:e2a06ffe-1a96-4f54-9463-f426fc4083d8: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>1423595062584</creation_time>
         <global>false</global>
         <id>urn:storageos:Task:e2a06ffe-1a96-4f54-9463-f426fc4083d8:vdc1</id>
         <inactive>false</inactive>
         <internal>false</internal>
         <link rel="self" href="/vdc/tasks/urn:storageos:Task:e2a06ffe-1a96-4f54-9463-f426fc4083d8:vdc1"/>
         <name>DISCOVER VCENTER</name>
         <remote>false</remote>
         <tags/>
         <vdc>
              <id>urn:storageos:VirtualDataCenter:99c5c185-ebb0-468a-8fe7-3ea6e65b7b57:vdc1</id>
              <link rel="self" href="/vdc/urn:storageos:VirtualDataCenter:99c5c185-ebb0-468a-8fe7-3ea6e65b7b57:vdc1"/>
         </vdc>
         <associated_resources/>
         <description>discover a vcenter</description>
         <end_time>1423595086871</end_time>
         <message>Operation completed successfully</message>
         <op_id>c3eefcb2-5a13-4446-b31f-76a172dc7701</op_id>
         <progress>100</progress>
         <resource>
              <id>urn:storageos:Vcenter:316465e4-8661-4d73-a60d-c2132f0ff868:vdc1</id>
              <link rel="self" href="/compute/vcenters/urn:storageos:Vcenter:316465e4-8661-4d73-a60d-c2132f0ff868:vdc1"/>
              <name>vcenter_west</name>
         </resource>
         <start_time>1423595062583</start_time>
         <state>ready</state>
         <tenant>
              <id>urn:storageos:TenantOrg:c104b49e-4e6b-449c-b92b-a19b247a613b:global</id>
              <link rel="self" href="/tenants/urn:storageos:TenantOrg:c104b49e-4e6b-449c-b92b-a19b247a613b:global"/>
         </tenant>
    </task>
Back to Top

Network configuration requirements for vCenters

After a host is added to ViPR, configure the networks if required before using the host in a service.

Back to Top

Important REST API calls to manage vCenters and clusters

The table shows some important APIs that are used to manage vCenters and clusters.

Back to Top