VMware Cloud Community
efelton
Contributor
Contributor

Multiple vCloud Hosts, choose one using REST

Hello,

This is my first post so please bear with me as I learn all the proper terminology.

I have gone through Orchestrator training and know a little about workflows and vApps etc.. Now I am trying to control the workflows using the REST API through Java.

My problem stems from the fact that my current vCloud has multiple Hosts on the same host and port, the only difference is the Name of the Host

Using Chrome to hit the Orchestrator REST site when I go to

https://orch-00:8281/api/catalog/vCloud

I see this response

<inventory-item xmlns="http://www.vmware.com/vco" href="https://orch-00-ah:8281/api/catalog/vCloud/">

<relations>

<link rel="down" href="https://orch-00-ah:8281/api/catalog/vCloud/Host/561028bce25f7c284438cd9b3d41b0c8e91617fc96774299788a...">

<attributes>

<attribute name="enabled" value="true"/>

<attribute name="organization" value="test-org"/>

<attribute name="maxConnections" value="600"/>

<attribute name="username" value="morade"/>

<attribute name="sessionMode" value="SHARED_SESSION"/>

<attribute name="useSamlAuthentication" value="false"/>

<attribute name="connectionTimeout" value="20000"/>

<attribute name="@type" value="Host"/>

<attribute name="name" value="https://vcdirectort-01-ah.mathworks.com:443 (morade@test-org)"/>

<attribute name="dunesId" value="561028bce25f7c284438cd9b3d41b0c8e91617fc96774299788a1156c7b////https://vcdirectort-01-ah.mathworks.com:443"/>

<attribute name="type" value="Host"/>

<attribute name="url" value="https://vcdirectort-01-ah.mathworks.com:443"/>

</attributes>

</link>

<link rel="down" href="https://orch-00-ah:8281/api/catalog/vCloud/Host/a0fd15b787b056aec0db1954d6ad294923dd1ab447af1d2ef69a...">

<attributes>

<attribute name="enabled" value="true"/>

<attribute name="organization" value="development_QE"/>

<attribute name="maxConnections" value="600"/>

<attribute name="username" value="morade"/>

<attribute name="sessionMode" value="SHARED_SESSION"/>

<attribute name="useSamlAuthentication" value="false"/>

<attribute name="connectionTimeout" value="20000"/>

<attribute name="@type" value="Host"/>

<attribute name="name" value="https://vcdirectort-01-ah.mathworks.com:443 (morade@development_QE)"/>

<attribute name="dunesId" value="a0fd15b787b056aec0db1954d6ad294923dd1ab447af1d2ef69ad1aa4775328a////https://vcdirectort-01-ah.mathworks.com:443"/>

<attribute name="type" value="Host"/>

<attribute name="url" value="https://vcdirectort-01-ah.mathworks.com:443"/>

</attributes>

</link>

</relations>

<attributes>

<attribute name="name" value="vCloud Director"/>

</attributes>

</inventory-item>


As you can see there are 2 vClouds with different dunesID, different names, etc.

Sometimes when I hit

https://orch-00-ah:8281/api/catalog/vCloud/vApp

I will get the vApps from one of the Hosts

<inventory-items xmlns="http://www.vmware.com/vco" total="14">

<link rel="down" href="https://orch-00-ah:8281/api/catalog/vCloud/VApp/a0fd15b787b056aec0db1954d6ad294923dd1ab447af1d2ef69a...">

<attributes>

<attribute name="id" value="urn:vcloud:vapp:7c4f60f9-46a9-469e-aa4a-6a4e73e0eaeb"/>

<attribute name="status" value="8"/>

<attribute name="description" value=" IT training"/>

<attribute name="@type" value="VApp"/>

<attribute name="name" value="vApp_IT_training"/>

<attribute name="dunesId" value="a0fd15b787b056aec0db1954d6ad294923dd1ab447af1d2ef69ad1aa4775328a////https://vcdirectort-01-ah.mathworks.com/api/vApp/vapp-7c4f60f9-46a9-469e-aa4a-6a4e73e0eaeb"/>

<attribute name="deployed" value="false"/>

<attribute name="dateCreated" value="2013-05-06T13:54:39.640-04:00"/>

<attribute name="vappStatusDescription" value="The object is powered off."/>

<attribute name="type" value="application/vnd.vmware.vcloud.vApp+xml"/>

<attribute name="href" value="https://vcdirectort-01-ah.mathworks.com/api/vApp/vapp-7c4f60f9-46a9-469e-aa4a-6a4e73e0eaeb"/>

<attribute name="inMaintenanceMode" value="false"/>

</attributes>

</link>

<link rel="down" href="https://orch-00-ah:8281/api/catalog/vCloud/VApp/a0fd15b787b056aec0db1954d6ad294923dd1ab447af1d2ef69a...">

<attributes>

<attribute name="id" value="urn:vcloud:vapp:b07e13b0-0083-4e0e-a9cd-dd9e8dacf794"/>

<attribute name="status" value="8"/>

<attribute name="description" value=""/>

<attribute name="@type" value="VApp"/>

<attribute name="name" value="vApp_pvasudev_16"/>

<attribute name="dunesId" value="a0fd15b787b056aec0db1954d6ad294923dd1ab447af1d2ef69ad1aa4775328a////https://vcdirectort-01-ah.mathworks.com/api/vApp/vapp-b07e13b0-0083-4e0e-a9cd-dd9e8dacf794"/>

<attribute name="deployed" value="false"/>

<attribute name="dateCreated" value="2013-06-20T13:46:13.217-04:00"/>

<attribute name="vappStatusDescription" value="The object is powered off."/>

<attribute name="type" value="application/vnd.vmware.vcloud.vApp+xml"/>

<attribute name="href" value="https://vcdirectort-01-ah.mathworks.com/api/vApp/vapp-b07e13b0-0083-4e0e-a9cd-dd9e8dacf794"/>

<attribute name="inMaintenanceMode" value="false"/>

</attributes>

</link>

<link rel="down" href="https://orch-00-ah:8281/api/catalog/vCloud/VApp/a0fd15b787b056aec0db1954d6ad294923dd1ab447af1d2ef69a...">

<attributes>

<attribute name="id" value="urn:vcloud:vapp:e2315f11-ec68-48aa-bdc0-b3ac018c0c6c"/>

<attribute name="status" value="8"/>

<attribute name="description" value=""/>

<attribute name="@type" value="VApp"/>

<attribute name="name" value="vApp_mltest"/>

<attribute name="dunesId" value="a0fd15b787b056aec0db1954d6ad294923dd1ab447af1d2ef69ad1aa4775328a////https://vcdirectort-01-ah.mathworks.com/api/vApp/vapp-e2315f11-ec68-48aa-bdc0-b3ac018c0c6c"/>

<attribute name="deployed" value="false"/>

<attribute name="dateCreated" value="2013-05-14T13:37:25.760-04:00"/>

<attribute name="vappStatusDescription" value="The object is powered off."/>

<attribute name="type" value="application/vnd.vmware.vcloud.vApp+xml"/>

<attribute name="href" value="https://vcdirectort-01-ah.mathworks.com/api/vApp/vapp-e2315f11-ec68-48aa-bdc0-b3ac018c0c6c"/>

<attribute name="inMaintenanceMode" value="false"/>

</attributes>

</link>

<...> and many more</...>

Sometimes when I visit the same URL I get the other Host's vApps

<inventory-items xmlns="http://www.vmware.com/vco" total="1">

<link rel="down" href="https://orch-00-ah:8281/api/catalog/vCloud/VApp/561028bce25f7c284438cd9b3d41b0c8e91617fc96774299788a...">

<attributes>

<attribute name="id" value="urn:vcloud:vapp:ae108620-27a7-4928-878f-af9440e08c79"/>

<attribute name="status" value="4"/>

<attribute name="description" value=""/>

<attribute name="@type" value="VApp"/>

<attribute name="name" value="win7test"/>

<attribute name="dunesId" value="561028bce25f7c284438cd9b3d41b0c8e91617fc96774299788a1156c7b////https://vcdirectort-01-ah.mathworks.com/api/vApp/vapp-ae108620-27a7-4928-878f-af9440e08c79"/>

<attribute name="deployed" value="true"/>

<attribute name="dateCreated" value="2013-07-09T17:53:06.980-04:00"/>

<attribute name="vappStatusDescription" value="The object is powered on."/>

<attribute name="type" value="application/vnd.vmware.vcloud.vApp+xml"/>

<attribute name="href" value="https://vcdirectort-01-ah.mathworks.com/api/vApp/vapp-ae108620-27a7-4928-878f-af9440e08c79"/>

<attribute name="inMaintenanceMode" value="false"/>

</attributes>

</link>

</inventory-items>

I don't know how to tell the REST API to get the vApps from one specific Host or another.

From my Java code I am creating a com.vmware.o11n.sdk.rest.client.stubs.SdkObject and populating it with ID, TYPE and HREF.

com.vmware.o11n.sdk.rest.client.stubs.SdkObject O = new SdkObject();

        O.setHref("https://orch-00-ah:8281/api/catalog/vCloud/VApp/a0fd15b787b056aec0db1954d6ad294923dd1ab447af1d2ef69a...");

        O.setId("a0fd15b787b056aec0db1954d6ad294923dd1ab447af1d2ef69ad1aa4775328a////https://vcdirectort-01-ah.mathworks.com/api/vApp/vapp-97dc7e62-453d-480f-a833-a705c912f617");

        O.setType("vCloud:VApp");

When the Java call to the REST API to start a Workflow with a specific vApp gets the correct HOST then the vApp is found and the workflow executes.  When the wrong HOST is chosen then the vApp is not found and the workflow fails.  As you can see from the code above I AM passing the full ID, with HOST-prefix.  Adding this information does not matter to the REST API, if the wrong Host is selected then the vApp will not be found.

I have looked at

http://pubs.vmware.com/vcloud-api-1-5/wwhelp/wwhimpl/js/html/wwhelp.htm#href=api_prog/GUID-DD7395C3-...

and

VMware vSphere 5.1

and I can not find any information that might help resolve this issue.

Thank you for you assistance

Erik

Tags (2)
0 Kudos
6 Replies
iiliev
VMware Employee
VMware Employee

Hello Erik,

The API you are using - https://host:port/api/catalog/[plugin]/[type] - should list all objects of the specified type. I'm not sure why you are getting different results each time you call the API. Looks like a bug to me.

Same for the issue when starting the workflow - I'd expect the correct host to be found.

I'll forward both issues to vCloud plug-in developers. Could you tell me the build numbers of vCloud plug-in / vCO server / vCloud you are using?

-Ilian

0 Kudos
efelton
Contributor
Contributor

Hello,

I have an official support request for this issue: Support Request # 13347786607


It looks like a bug to me too.


As for Versions, here's what I can find on my own:


https://orch-00-ah:8281/api/about

returns

<about-info xmlns="http://www.vmware.com/vco">

<build-number>2942</build-number>

<build-date>20130321-1246</build-date>

<version>5.1.1-2942</version>

<api-version>5.1.0</api-version>

</about-info>


https://orch-00-ah:8281/api/versions

returns


<supported-versions xmlns="http://www.vmware.com/vco">

     <version latest="true">5.1.0</version>

</supported-versions>


My Orchestrator Client tells me I'm using version 5.1.1.  And it tells me the version of the vCloud Plugin is 5.1


My vCloud Directors' web interface is not giving me a version number.  Neither is vCO's web interface.


If there are ways of getting the version out of the REST API I have not found them.


Thank you for your response

ERik

0 Kudos
alazarov
Contributor
Contributor

Hi,

I don't think it's a valid case to deploy two cloud cells on a single host.

I would recommend to keep the cells in a separated hosts.

Quote from the documentation:

"vCloud Director

A single instance of vCloud Director is known as a “cell.” A cell consists of the vCloud Director components

installed on a supported operating system (OS). In larger implementations, multiple cells can be deployed with a

front-end IP load balancer to direct end-user traffic to the correct cell. "

http://www.vmware.com/files/pdf/products/vCloud/VMware-vCloud-Director-51-Evaluation-Guide.pdf

So you'll have to add a load balancer and reconfigure.

Write back status when you apply it.

Regards,
Alex

0 Kudos
efelton
Contributor
Contributor

Is this what you mean by multiple "cells" on the same host (or at least the same URI)?

vCloudCells.png

How does Orchistrator differentiate between the two Directors when the REST API cannot?

0 Kudos
alazarov
Contributor
Contributor

Hi,

I'll suggest you to contact the GSS unit that's processed your SR and check the status. If needed they can log a bug to vCO -> vCO Plugins -> vCloud and they we can start working on it.

0 Kudos
thechaos
Enthusiast
Enthusiast

Ich bin vorraussichtlich ab dem 8.8.2013 wieder zu erreichen, E-Mails werden nicht weitergeleitet.

I'm not in the office till the 8.8.2013, E-Mails will not be forwarded

0 Kudos