VMware Cloud Community
clabman
Contributor
Contributor
Jump to solution

Register vCO workflow as a task in vCloud

Hi,

I' m working on an extension service for vCloud. I call an URL via a POST request and then orchestrator run a workflow, this workflow send results via amqp to my vCloud.

This solution works great ! But when my workflow is running more than 10 seconds, vCloud api return this error : GATEWAY_TIMEOUT failed to respond in the specified timeout (10 SECONDS).

So my idea to avoid this problem is to create a task in vCloud when the workflow is running and return to the api an url which allows to consult the workflows state (running, completed, ...)

Do you think there is a way to do this ?

Thanks for your help !

Reply
0 Kudos
1 Solution

Accepted Solutions
cdecanini_
VMware Employee
VMware Employee
Jump to solution

Have you first ran the workflow to create the Workflow run service, then the one to create the custom service, then the one to add an operation to this custom service ?

If you get https://IP/api/workflows/id_workflow/executions/

Do you see the execution ID you are looking for ?

In the inventory / REST do you see the vCO host with its REST operations ?

Christophe.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter

View solution in original post

Reply
0 Kudos
10 Replies
cdecanini_
VMware Employee
VMware Employee
Jump to solution

It does so because you did not reply back in time.

If you look at the document tab there is a full implementation of this called "vCloud Service Builder" I have created.

You should definitely have a look at the included presentation. It explains how it works and all the features.

The way I decided to implement the reply is to return the workflow token as soon as I get it and set the location header to its URL in a similar way the vCO REST API is doing.

Christophe.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
Reply
0 Kudos
clabman
Contributor
Contributor
Jump to solution

Yes I'm not replying in time, because my workflow is running more than 10 seconds.

Are you talking about his documentation :  http://communities.vmware.com/docs/DOC-21726

Thanks for your reply !

Reply
0 Kudos
cdecanini_
VMware Employee
VMware Employee
Jump to solution

Yes, check the linked online presentation for more details and get the package to check how this is implemented.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
Reply
0 Kudos
clabman
Contributor
Contributor
Jump to solution

Thanks for your solution, That's a very nice work !!!

So I managed to make it work on my workflow. It runs and I received via amqp a url to manage workflow execution :

HTTP/1.1 202 Accepted
Date: Wed, 10 Apr 2013 14:41:03 GMT
Host: IP
x-vcloud-authorization: token
User-Agent: curl/7.27.0
Accept: application/*+xml;version=1.5
Content-Length: 0
Date: Wed Apr 10 2013 16:36:29 GMT+0200 (CEST)

But when i make a GET on this Location, i have this kind of error :

HTTP/1.1 404 Not Found

Date: Wed, 10 Apr 2013 14:38:32 GMT

Host: IP

x-vcloud-authorization: token

User-Agent: curl/7.27.0

Accept: application/*+xml;version=1.5

Content-Length: 1003

<html><head><title>vCloud Director vCenter Orchestrator Service 0.1 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The requested method is not available.</u></p><HR size="1" noshade="noshade"><h3>vCloud Director vCenter Orchestrator Service 0.1</h3></body></html>

Have you got any idea why ?

PS : My workflow is running without error.

Reply
0 Kudos
cdecanini_
VMware Employee
VMware Employee
Jump to solution

Have you first ran the workflow to create the Workflow run service, then the one to create the custom service, then the one to add an operation to this custom service ?

If you get https://IP/api/workflows/id_workflow/executions/

Do you see the execution ID you are looking for ?

In the inventory / REST do you see the vCO host with its REST operations ?

Christophe.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
Reply
0 Kudos
clabman
Contributor
Contributor
Jump to solution

Have you first ran the workflow to create the Workflow run service, then the one to create the custom service, then the one to add an operation to this custom service ?

=> Yes I followed this order ! And every of these operations are successful

If you get https://IP/api/workflows/id_workflow/executions/

Do you see the execution ID you are looking for ?

=> If I get this URL, I also have a 404 error !

In the inventory / REST do you see the vCO host with its REST operations ?

=> Yes I see severals operations in the vCO host :

Get a workflow run event logs, Get an user interaction, get a workflow run state, ....

THanks for your help !

Reply
0 Kudos
clabman
Contributor
Contributor
Jump to solution

It seems that it is the mapping between orchestrator and vCloud that do not work.

I can access to all workflow executions via orchestrator IP but not via vCloud IP !!

Reply
0 Kudos
cdecanini_
VMware Employee
VMware Employee
Jump to solution

I could reproduce your issue:

To fix it I had to GET

https://vcdServer/api/workflows/workflowID/executions/executionId

No trailing /

Please test this.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
Reply
0 Kudos
cdecanini_
VMware Employee
VMware Employee
Jump to solution

I have updated the package so the workflow service accept as well URLs finishing with /

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
Reply
0 Kudos
clabman
Contributor
Contributor
Jump to solution

Nice, I will test it as soon as possible.

For now I made my on map rules and workflow listener and it works.

Thanks a lot for your help !!

Regards

Reply
0 Kudos