VMware Cloud Community
rszymczak
Hot Shot
Hot Shot

vCO sample plugin "SolarSystem" and custom resources in vCAC

Hi guys,

i'm fiddeling around using the SolarSystem sample plugin for vCO. Compilation works when done using the eclipse plugin and the import is successfull. I see my SolarSystem plugin in vCO and i'm able to run workflows using it.

Now i want to use it for an advanced service in vCAC - so basically I build a custom workflow which provisions a new SolarSystem:Planet object. From the java source files as far as i know a SolarSystem:Planet object needs 4 parameters: id, name, gravity and circumference. So my workflow simply collects those parameters as input parameters and binds them to the SolarSystem:Planet output parameter object.

I double-checked the object is created by printing the object properties in the system console after creation. So next I created a custom ressource (type: SolarSystem:Planet) and a new service for planet creation, which takes my vCO createPlanet workflow and is bound to the SolarSystem:Planet custom ressource as output of the service.

The problem is that when a user runs the advanced service, the vCO workflow is run (and finished successfully ) but within vCAC it gets stuck. When looking at the "requests" panel i see that the advanced service is "in progress" but no object (or in vCAC terminology "item" ) is created.

I checked some default workflows (vm copy) for any difference - no luck so far. Now the question remains if it may be something within the custom vCO-Plugin (SolarSystem) that is missing some kind of "object return" which is used by vCAC. Since this was my first shot i have no knowledge about the detailed plugin structure requirements needed for vCAC compatible plugins.

Any ideas what I'm missing here?

greets robert

8 Replies
cdecanini_
VMware Employee
VMware Employee

I had a similar issue with another plug-in. To make sure we have the same issue you may want to check the catalina.out log file of the vCAC server and check for an error at the request time.

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
rszymczak
Hot Shot
Hot Shot

Well it looks like vCAC is unable to find the object after it's created:

WARN : com.vmware.vcac.designer.service.impl.ExecutionStatusChecker - Error checking state for [ff8080814530e74a014530f9f98d0013] and possibly updating state for [e221c5ab-af53-46ba-847a-7dea8415c2b8]

WARN : com.vmware.vcac.platform.rest.RestTemplateIpv6 - GET request for "https://vcac-01.vmware.local:8281/vco/api/catalog/SolarSystem/Planet/OmegaPrime/" resulted in 404 (com.vmware.o11n.sdk.queryservice.QueryResultNotFoundException: Unable to find object of type 'SolarSystem:Planet' with id 'OmegaPrime'); invoking error handler

WARN : com.vmware.vcac.designer.service.vco.VcoInventoryTypeUtil - Can't load object by URI[https://vcac-01.vmware.local:8281/vco/api/catalog/SolarSystem/Planet/OmegaPrime/]

java.lang.NullPointerException

        at com.vmware.vcac.designer.service.vco.mapper.LinkToVcoInventoryItem.map(LinkToVcoInventoryItem.java:67)

        at com.vmware.vcac.designer.service.vco.VcoInventoryTypeUtil.findObject(VcoInventoryTypeUtil.java:166)

        at com.vmware.vcac.designer.service.impl.InventoryTypeServiceImpl.findObject(InventoryTypeServiceImpl.java:182)

        at com.vmware.vcac.designer.service.catalog.request.CatalogRequestAdapter.publishResource(CatalogRequestAdapter.java:116)

        at com.vmware.vcac.designer.service.impl.ExecutionStatusChecker.publishResource(ExecutionStatusChecker.java:246)

        at com.vmware.vcac.designer.service.impl.ExecutionStatusChecker.access$400(ExecutionStatusChecker.java:27)

        at com.vmware.vcac.designer.service.impl.ExecutionStatusChecker$WorkflowExecutionStatusCheckWorker.updateExecutionState(ExecutionStatusChecker.java:135)

        at com.vmware.vcac.designer.service.impl.ExecutionStatusChecker$WorkflowExecutionStatusCheckWorker.call(ExecutionStatusChecker.java:97)

        at com.vmware.vcac.designer.service.impl.ExecutionStatusChecker$WorkflowExecutionStatusCheckWorker.call(ExecutionStatusChecker.java:85)

        at java.util.concurrent.FutureTask.run(Unknown Source)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

        at java.lang.Thread.run(Unknown Source)

WARN : com.vmware.vcac.designer.service.impl.ExecutionStatusChecker - Error checking state for [ff8080814530e74a014530ff63b30017] and possibly updating state for [b53847f5-9169-44a0-a5a4-b966d2d76b36]

....

WARN : com.vmware.vcac.designer.service.vco.VcoInventoryTypeUtil - Can't load object by URI[https://vcac-01.vmware.local:8281/vco/api/catalog/SolarSystem/Planet/OmegaPrime/]

java.lang.NullPointerException

  at com.vmware.vcac.designer.service.vco.mapper.LinkToVcoInventoryItem.map(LinkToVcoInventoryItem.java:67)

  at com.vmware.vcac.designer.service.vco.VcoInventoryTypeUtil.findObject(VcoInventoryTypeUtil.java:166)

  at com.vmware.vcac.designer.service.impl.InventoryTypeServiceImpl.findObject(InventoryTypeServiceImpl.java:182)

  at com.vmware.vcac.designer.service.catalog.request.CatalogRequestAdapter.publishResource(CatalogRequestAdapter.java:116)

  at com.vmware.vcac.designer.service.impl.ExecutionStatusChecker.publishResource(ExecutionStatusChecker.java:246)

  at com.vmware.vcac.designer.service.impl.ExecutionStatusChecker.access$400(ExecutionStatusChecker.java:27)

  at com.vmware.vcac.designer.service.impl.ExecutionStatusChecker$WorkflowExecutionStatusCheckWorker.updateExecutionState(ExecutionStatusChecker.java:135)

  at com.vmware.vcac.designer.service.impl.ExecutionStatusChecker$WorkflowExecutionStatusCheckWorker.call(ExecutionStatusChecker.java:97)

  at com.vmware.vcac.designer.service.impl.ExecutionStatusChecker$WorkflowExecutionStatusCheckWorker.call(ExecutionStatusChecker.java:85)

  at java.util.concurrent.FutureTask.run(Unknown Source)

  at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

  at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

  at java.lang.Thread.run(Unknown Source)

0 Kudos
rszymczak
Hot Shot
Hot Shot

So, no ideas? So far I was not able to find out what's causing the error.

0 Kudos
cdecanini_
VMware Employee
VMware Employee

Sorry I have been traveling last week and I am attempting to catch up on several requests / projects / admin tasks ATM. I will try to verify if you have the same issue I reported ASAP.

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
0 Kudos
cdecanini_
VMware Employee
VMware Employee

OK so the error is not exactly the same but similar.

Please check if your workflow execution (https://vcoserver:8281/vco/api/workflows/yourWorkflowId/executions/yourWorkflowExecution/) output-parameters section. The issue I have here is that the sdk-object is not set.

If this is the case for you as well and if you run vCO < 5.5.1 then I would recommend trying with 5.5.1.

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
0 Kudos
rszymczak
Hot Shot
Hot Shot

Indeed, for some reason the output was not set.  However the reason why remains unclear - or do you have further information?

Oh btw, i was unable to call https://vcoserver:8281/vco/api/workflows/yourWorkflowId/executions/yourWorkflowExecution/ since it requires authentication but never asks for it. Using a REST client and submitting some basic auth didn't work aswell (tried using the vco configuration admin, appliance admin and a vco administrator account) - i guess i'm using the wrong credentials?

0 Kudos
cdecanini_
VMware Employee
VMware Employee

In my case I was not creating properly the object.

vCO API uses basic authentication. Here I can browse the workflow executions with a simple web browser (no REST plug-in).

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
rszymczak
Hot Shot
Hot Shot

Hmm,

I'm not sure what i'm doing wrong. Currently I'm unable to troubleshoot because everytime I visit the vco/api/workflows page I get a HTTP 401 ("full authentication required to access this resource"). Maybe I should note I'm using the vcac integrated vco (vcac 6.0.1).

so the link I'm trying to visit looks like this:

https://vcac.local:8281/vco/api/workflows/19c610ca5af84162bd955a955ab961d2/executions/ff808081457f00...

No basic auth popup (tried ie, firefox, chrome) nothing. Just 401. Also I tried submitting a basic auth header - no luck (not sure which credentials exacly are needed to visit this ...)

Well but let's get focused on the problem here:

I was able to resolve the issues using a different object from the solarsystem example (star instead of planet). I looked at the source code of the example, but i'm not sure what's different for the star / planet objects that could cause the star being provisioned and the planet not to be.

So I tried to build my own custom object using some aspect oriented programming. Source looks like this:

package com.testlab.o11n.plugin.TESTPLUG;

import java.io.Serializable;

public abstract class AbstractObject implements Serializable{

    private static final long serialVersionUID = 1L;

    private String id;

   

  public AbstractObject() {

  // Not exacly sure what this is used for in vco / vcac and how unique this should be

  id = this.toString();

  }

  /* Serialize the object's content as Base64 encoded string.

  *

  * @return the the serialized content of the object as an UTF-8 string

  */

    public String getId() {

        return id;

    }

}

//----------------------------------------------------------------------

package com.testlab.o11n.plugin.TESTPLUG;

import com.vmware.o11n.plugin.sdk.annotation.*;

@VsoObject(name = "TestObject", description="Some Test for the API browser here")

// What exacly is the "idAccessor" needed for?

@VsoFinder(name = "TestObject", idAccessor = "getId()", hidden = false, image = "images/item-16x16.png", description="Some Test for the API browser here")

public class TestObject extends AbstractObject{

  private static final long serialVersionUID = 1L;

  @VsoProperty(readOnly = false, description = "The name of the object.")

  private String objName;

  @VsoProperty(readOnly = false, description = "The owner of the object.")

  private String objOwner;

  @VsoConstructor(description="Creates a object.")

  public TestObject(@VsoParam(description="The object name as a String")String objName, @VsoParam(description="The object owner as a String")String objOwner) {

  // call parent constuctor

  super();

  this.objName = objName;

  this.objOwner = objOwner;

  }

  public String getObjOwner() {

  return objOwner;

  }

  public void setObjOwner(String objOwner) {

  this.objOwner = objOwner;

  }

  public String getObjName() {

  return objName;

  }

  public void setObjName(String objName) {

  this.objName = objName;

  }

  @VsoMethod(description="A test method which dosn't do anything.")

  public void objMethod()

  {

  }

}

Within vCO I just created a workflow which has a single scripting task which basiclly creates a new object as output parameter (of type TestObject) like this:

myObject = new TESTPLUGTestObject(objName,objOwner);

The workflow runs successfully, the object is created within the script task (checked by system.log printout accessing the object properties) but when the workflow finishs, the variables result set shows "Not Found" - "The linked element cannot be found" for the output parameter.

So far I'm not sure what is causing this.

Sooooo. The documentation is note quite clear what the ID of a custom object is used for. However, from the examples it seems like a unique id is needed for vCO to locate the object - which could be the reason why  my workflow isn't working

I'm also not sure what the requirements for custom objects are - specially when using annotation based creation. And last but not least I don't know yet how and where custom created objects are stored in vCO and how they're retreived by vcac.

Do you have any information about that for me?

0 Kudos