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

TOC

BacktoTop

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 applies to EMC ViPR 2.0.

This article is part of a series

vCenters can be added to ViPR at anytime, however, if you are setting up the ViPR Controller virtual data center for the first time, complete these steps before continuing to provision storage.
  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:

BacktoTop

VMware vCenter and ESX/ESXi version support

Operating System Supported versions
VMware ESX/ESXi 5.0.x 5.1.x, 5.5.x
VMware vCenter 5.0.x, 5.1.x, 5.5.x

BacktoTop

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:

Note Image
Some of the REST API calls in the following procedure are sent to port 4443, and others to port 443. The port number is included in the examples for clarity.

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> <associated_resources/> <description>DISCOVER_VCENTER</description> <op_id>f4818162-85ac-4f90-b5b3-8ab1f9ba7007</op_id> <resource> <id>urn:storageos:Vcenter:2a3116de-7f09-4572-9a99-2d7ee49e2921:vdc1</id> <link rel="self" href="/compute/vcenters/urn:storageos:Vcenter:2a3116de-7f09-4572-9a99-2d7ee49e2921:vdc1"/> <name>vcenter_west</name> </resource> <link rel="self" href="/compute/vcenters/urn:storageos:Vcenter:2a3116de-7f09-4572-9a99-2d7ee49e2921:vdc1/tasks/f4818162-85ac-4f90-b5b3-8ab1f9ba7007"/> <start_time>1399764617109</start_time> <state>pending</state> </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 . However, you will not be able to fully manage the vCenter until you discover it.
    Request

    GET https://<ViPR_VIP>:4443/compute/vcenters/urn:storageos:Vcenter:2a3116de-7f09-4572-9a99-2d7ee49e2921:vdc1/tasks/f4818162-85ac-4f90-b5b3-8ab1f9ba7007 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> <associated_resources/> <description>DISCOVER_VCENTER</description> <end_time>1399764623713</end_time> <message>Operation completed successfully</message> <op_id>f4818162-85ac-4f90-b5b3-8ab1f9ba7007</op_id> <resource> <id>urn:storageos:Vcenter:2a3116de-7f09-4572-9a99-2d7ee49e2921:vdc1</id> <link rel="self" href="/compute/vcenters/urn:storageos:Vcenter:2a3116de-7f09-4572-9a99-2d7ee49e2921:vdc1"/> <name>vcenter_west</name> </resource> <link rel="self" href="/compute/vcenters/urn:storageos:Vcenter:2a3116de-7f09-4572-9a99-2d7ee49e2921:vdc1/tasks/f4818162-85ac-4f90-b5b3-8ab1f9ba7007"/> <start_time>1399764617109</start_time> <state>ready</state> </task>

  4. Get the URN of the new vcenter from the response to the vcenter create call, and call the following REST API to discover the vCenter.

    POST https://<ViPR_VIP>:443/admin/api/vcenters/urn:storageos:Vcenter:2a3116de-7f09-4572-9a99-2d7ee49e2921:vdc1/discover Content-Type: application/xml X-SDS-AUTH-TOKEN: <AUTH_TOKEN>

  5. Check the user interface to see if the host has completed discovery, or check the vcenter resource using the REST API. It should contain the information shown in the following example.
    Request

    GET https://<ViPR_VIP>:4443/compute/vcenters/urn:storageos:Vcenter:2a3116de-7f09-4572-9a99-2d7ee49e2921: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"?> <vcenter> <creation_time>1399764617095</creation_time> <global>false</global> <id>urn:storageos:Vcenter:2a3116de-7f09-4572-9a99-2d7ee49e2921:vdc1</id> <inactive>false</inactive> <internal>false</internal> <link rel="self" href="/compute/vcenters/urn:storageos:Vcenter:2a3116de-7f09-4572-9a99-2d7ee49e2921:vdc1"/> <name>vcenter_west</name> <remote>false</remote> <tags/> <vdc> <id>urn:storageos:VirtualDataCenter:440b70de-fd36-4361-a455-b6ca65fb8228:vdc1</id> <link rel="self" href="/vdc/urn:storageos:VirtualDataCenter:440b70de-fd36-4361-a455-b6ca65fb8228:vdc1"/> </vdc> <native_guid></native_guid> <compatibility_status>COMPATIBLE</compatibility_status> <job_discovery_status>COMPLETE</job_discovery_status> <last_discovery_run_time>1399764623710</last_discovery_run_time> <last_discovery_status_message></last_discovery_status_message> <last_metering_run_time>0</last_metering_run_time> <job_metering_status>CREATED</job_metering_status> <next_discovery_run_time>1399768217205</next_discovery_run_time> <next_metering_run_time>0</next_metering_run_time> <registration_status>REGISTERED</registration_status> <success_discovery_time>1399764623710</success_discovery_time> <success_metering_time>0</success_metering_time> <tenant> <id>urn:storageos:TenantOrg:6c7dde31-ec48-4028-8672-5e74f5754656:global</id> <link rel="self" href="/tenants/urn:storageos:TenantOrg:6c7dde31-ec48-4028-8672-5e74f5754656:global"/> </tenant> <ip_address>192.168.0.0</ip_address> <os_version>5.1.0</os_version> <port_number>443</port_number> <user_name>admin_user</user_name> </vcenter>

BacktoTop

Network configuration requirements for vCenters

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

BacktoTop

Important REST API calls to manage vCenters and clusters

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