Quantcast
Channel: VMware Communities : All Content - vRealize Orchestrator
Viewing all 10285 articles
Browse latest View live

REST > JSON > Workflow

$
0
0

I am learning vRO and I'm stuck trying to get a REST request to successfully complete a particular workflow. I followed the tutorial here (http://www.vcoteam.info/articles/learn-vco/268-how-to-use-the-rest-api-to-start-a-workflow.html) to successfully submit a REST request to my vRO server. I would now like to take it a step further and use the REST api to kick off one of the included workflows (Get VM Uuid).

 

Following the same steps outlined in the tutorial listed above, I can start the (Get VM Uuid) workflow via a REST call. However, it fails with the following error:

 

Workflow:Get VM Uuid / Get VM Uuid (item1) : java.lang.RuntimeException: ch.dunes.model.type.ConvertorException: Cannot convert to object , reason : finder not found for type : null

 

Now, based on my research I believe I need to convert/wrap the JSON data into an appropriate output/input format for the "Get VM Uuid" script but I am not sure how to do it. Any help would be greatly appreciated.

 

Thanks.

 

PS. here is the JSON data I am sending over:

 

{

  "parameters":

  [

    {

    "value":{"string":{"value": "testvm"}},

    "type": "VC:VirtualMachine",

    "name": "vm",

    "scope": "local"

    }

  ]

}

 

PPS. any book recommendations would also be appreciated.


Parse attributes/parameters to another workflow (which is scheduled from the first workflow)

$
0
0

Hello all,

 

Hope you can give me some input here.

 

I have migration project coming up and created a workflow to storage vmotion a VM onto a Transport Datastore. Then this workflow ends with scheduling another workflow to a user defined time (service window). The 1st workflow need to parse the vm (vc:virtualmachine) attribute and carry it over to the 2nd workflow, which then will run automated on the schedule time.

 

I cannot figure out how to parse these attributes on the 2nd workflow. I have created this "Schedule Task" script based on a script found on this blog  Create vCO/vRO scheduled workflow automatically | Chris Berry Blog

 

 

var workflowToLaunch = Server.getWorkflowWithId("b1ef0b7b-8ec6-4214-aa2d-df96b3202763");

if (workflowToLaunch == null) {

throw "Workflow not found";

}

 

var workflowParameters = new Properties();

workflowParameters.put("VM", vm);

System.log(workflowParameters.VM);

var scheduledTask = workflowToLaunch.schedule(workflowParameters,workflowScheduleDate);

 

System.log(workflowScheduleDate);

System.log(workflowParameters);

System.log(scheduledTask);

 

When I run this workflow, it run successfully, taking the VM and put it in the properties array. When I output the system.log entries you see - it all looks good.

 

The 2nd workflow is scheduled and will run on the time defined. However - it throws these errors:

 

[2015-07-15 11:47:11.073] [I] null

[2015-07-15 11:47:11.073] [I] TypeError: Cannot read property "VM" from null (Workflow:Test - Shutdown VM / Scriptable task (item2)#1)

 

In the 2nd script I have the following scriptable task with this code:

 

System.log(workflowParameters);

System.log(workflowParameters.VM);

System.log(workflowParameters.Cluster);

 

vm = workflowParameters.VM

 

System.log(vm);


After this a Shutdown VM workflow, that needs to VM as input.


I have used alot of system.logging for debugging.


One thing to notice. In the 1st workflow I use the variable "workflowParameters", which currently is not defined as an Out-parameter or Out-attribute. If I do define it as an out-parameter or attribute with type Array/Properties and run the workflow againit will throw the following error?

 

[2015-07-15 11:50:51.116] [I] Workflow:Test - start workflow / Scriptable task (item2) : ch.dunes.model.type.ConvertorException: Not an Array


Anyone can help me in the right direction?

 

Thanks in advance




Technical Preview Version of VMware vCenter Orchestrator Plug-In for VMware vCenter Chargeback Manager 2.6

$
0
0

Technical Preview Version of VMware vCenter Orchestrator Plug-In for VMware vCenter Chargeback Manager 2.6

This is a patch release of the plug-in.

 

Bug fix to work with vCO 6.x.

 

Please note, that the attached plug-in is verified, but still not a final version.

vRO Slave Offline

$
0
0

I have just added a vRO slave to my vRO master (both version 5.5.2).  The initial part of running the "Add a vCO Server" workflow went fine and the Master connected to the slave vCO.  However  When I go into "Create a Proxy Workflow" to test running a workflow on the slave from the master node, I see the slave node in there but it has a "status" of "offline".  It doesn't show me any workflows on the slave that I can run. 

 

However if I log into the slave directly, I can see and run workflows with no problem.

 

Any ideas?

 

 

Screen1:

Screen1.PNG

Screen 2:Screen2.PNG

cannot access vRO appliance web page with Firefox 39.0

$
0
0

I tried to access https://ipaddress:8281/vco/  and suddenly I'm greeted with the following error:

 

An error occurred during a connection to ipaddress:8281. SSL received a weak ephemeral Diffie-Hellman key in Server Key Exchange handshake message. (Error code: ssl_error_weak_server_ephemeral_dh_key)

 

I think Firefox updated itself between now and the last time I tried to access the web page.

 

I checked the release notes for version 39 and i see this: Removed support for insecure SSLv3 for network communications

 

Is that what's causing the problem? Anyone else have this problem?

How to customize a package after import to vCO....?

$
0
0

Dear Community,

Please anybody guide me how to customize and do the changes on the package after I import the packge to my vCO server.

I tried few of blogs,articles and book,I could nt get any direct way with steps to do that.

Appreciated your help.

Missing Values In Workflow

$
0
0

I copied the "Clone virtual machine, no customization" workflow and created a wrapper for it where I set all the values except the name of the VM that will be created. Next I used the Firefox REST Client plugin to do a POST to the REST endpoint of the workflow and included the value of the machine name like this:

 

{

  "parameters":

  [

    {

    "value":{"string":{"value": "newVM001"}},

    "type": "string",

    "name": "name"

    }

  ]

}

 

This all works as expected and a new VM is deployed with the name I specify. Awesome!

 

Now I take the exact code and drop it into my application, set all the needed values and test my REST call. The workflow is kicked off but it fails with the error:

Unable to create VcVirtualMachineRelocateSpec: TypeError: Cannot read property "parent" from undefined (Dynamic Script Module name : getRelocateSpec#8)

 

After hunting down the issue for some time I discovered that all of the values I set in my wrapper are reporting as undefined/null. So for example in the getRelocateSpec Action, "pool" and "host" are undefined when I send the request from my application, but they have the values set from the wrapper when I send the request via the FF REST Client.

 

Is this a bug or am I missing something here?

 

Just to be safe I tried with JSON and XML, same deal. I can see the new VM name being received by the workflow but all the values set by the wrapper have been wiped out for some reason.

 

Here is the XML code:

 

<execution-context xmlns="http://www.vmware.com/vco">

  <parameters>

    <parameter description="A virtual machine" type="string" name="name">

      <string>newVM001</string>

    </parameter>

  </parameters>

</execution-context>

Run Program in Guest / Linux / Domain user

$
0
0

I'm trying to use the Run Program in Guest workflow to run a linux bash script in a VM.  If I use a local login, it works, if I try and use a domain account, it fails with "failed to authenticate with the guest operating system using the supplied credentials".  I can login with the domain account manually.

 

I've tried svc_user, "domain\svc_user", "svc_user@domain", "svc_user@fqdn.domain.com" ... no go.

 

Anyone know how to use a non-local account here?


When the virtual machine vSphere replication, connect another site error,VR Version is 6.0

vCAC vCO plugin -- get vCACCAFECsResourceType for internal "IaaS VC VirtualMachine" resource type in workflow?

$
0
0

Hi -

 

I'm in vCO using the 6.0.1 vCO Plug-in for vCAC, trying to create a vCAC ADS resource action to run against a VC:VirtualMachine. When I manually register my action workflow in the vCAC UI, it finds the VC:VirtualMachine input parameter and maps it to an "IaaS VC VirtualMachine" resource type, and the action shows and runs correctly against VMs selected in the vCAC UI Items.

 

Now, in a workflow to create the resource action, I'm trying to use createResourceActionFromWorkflow() from the com.vmware.library.vcaccafe.asd.resourceaction package, which requires a vCACCAFECsResourceType (i.e. VCACCAFE:CustomResource) object. I want to point to the same "Infrastructure.Virtual" resource type which the vCAC UI uses, but I can't seem to find it in a safe fashion.

 

If I get a previously created VCACCAFE:ResourceAction and look at its getInputParameter().getResourceType() in a workflow, I can see an object that looks like:

 

[2014-08-11 16:14:50.094] [I] type.id=eaba1f37-6154-4c17-94ae-ea419cb9e14e

[2014-08-11 16:14:50.095] [I] type.name=IaaS VC VirtualMachine

[2014-08-11 16:14:50.095] [I] type.externalTypeId=Infrastructure.Virtual

[2014-08-11 16:14:50.095] [I] type.vcoType=VC:VirtualMachine

[2014-08-11 16:14:50.095] [I] type.vcoId=null

[2014-08-11 16:14:50.095] [I] type.providerId=asd.external

[2014-08-11 16:14:50.096] [I] type.tenantId=_internal

 

and if I do a new vCACCAFECsResourceType() and set the values (especially the id) in that object manually and use that in createResourceActionFromWorkflow(), it works. But, it doesn't feel safe to hard-code the type.id in my workflow -- will that work on other vCAC installs?

 

Also, I have been to get the corresponding vCACCAFEResourceType via:


vCACCAFEHost.createAdvancedDesignerClient().getAdvancedDesignerCsResourceTypeService().getResourceType('_internal', 'Infrastructure.Virtual');

 

but that's a different object class and I can't see how to get the corresponding vCACCAFECsResourceType.

 

I also tried doing a com.vmware.library.vcaccafe.asd.customresources.createCustomResourceFromInventoryType() for 'VC:VirtualMachine' and then using that vCACCAFECsResourceType to create the resource action. It creates and publishes just fine, but the action never shows in the vCAC UI (using the same entitlement as when using Infrastructure.Virtual).

 

Any ideas? Thanks,

Greg

My first steps with VEEAM RESTapi

$
0
0

Hello,

 

I started to play a little bit with the RESTapi of VEEAM Ent. Server.

But by question is not pointed to the Application. It’s more about the Handling of a RESTapi get results.

 

My Script:

 

var PostResponse = BRHost.createRequest("POST", "/sessionMngr/?v=v1_1", null).execute();
var TenantsResponse = BRHost.createRequest("GET", "/cloud/tenants", null).execute();
//System.log("Tenants " + TenantsResponse.contentAsString);
var XMLFile = XMLManager.fromString(TenantsResponse.contentAsString);
var XMLelement = XMLFile.documentElement.getElementsByTagName("Ref");

for(i=0;i<XMLelement.getLength();i++){  var Tenant = XMLelement.item(i).getAttribute("Name")
if ( Tenant == TenantName){  var UIDTenantFull = XMLelement.item(i).getAttribute("UID")  var UIDTenant = UIDTenantFull.slice(-36)  var RessourceResponse = BRHost.createRequest("GET", "/cloud/tenants/" + UIDTenant + "/resources", null).execute();  //System.log("Tenant Ressources: " + VMResponse.contentAsString);  //System.log("Content as string: " + RessourceResponse.contentAsString);  var RESdoc = XMLManager.fromString(RessourceResponse.contentAsString);  var RESlist = RESdoc.documentElement.getElementsByTagName("CloudTenantResource");  System.error(RESlist.getLength());  for(j=0;j < RESlist.getLength();j++){  var RessourceID = RESlist.item(j).getAttribute("Id");  System.log("Ressource ID: " + RessourceID);  var RessourceResponseDetail = BRHost.createRequest("GET", "/cloud/tenants/" + UIDTenant + "/resources/" + RessourceID, null).execute();  System.log("RessourceResponseDetail: " + RessourceResponseDetail.contentAsString);  }
}
}

 

A Result Example:

 

<CloudTenantResource xmlns="http://www.veeam.com/ent/v1.0" Type="CloudTenantResource" Href="http://localhost:9399/api/cloud/tenants/4f90635a-7ecc-49fe-beb6-60b37eb4bd89/resources/1c7c6cd7-0cd0-4e20-8d15-a94d23299a93" Id="1c7c6cd7-0cd0-4e20-8d15-a94d23299a93">  <Links>    <Link Rel="Delete" Type="CloudTenantResource" Href="http://localhost:9399/api/cloud/tenants/4f90635a-7ecc-49fe-beb6-60b37eb4bd89/resources/1c7c6cd7-0cd0-4e20-8d15-a94d23299a93" Name="Cloud repository 3" />    <Link Rel="Up" Type="CloudTenant" Href="http://localhost:9399/api/cloud/tenants/4f90635a-7ecc-49fe-beb6-60b37eb4bd89?format=Entity" Name="ABC Company" />    <Link Rel="Up" Type="BackupServer" Href="http://localhost:9399/api/backupServers/8ea5406b-a6e9-42d9-bca5-44b6a5d94af1?format=Entity" Name="localhost" />  </Links>  <RepositoryQuota>    <DisplayName>Cloud repository 3</DisplayName>    <RepositoryUid>urn:veeam:Repository:82db96c3-445c-4a7e-9587-f2d523e839f4</RepositoryUid>    <Quota>1024</Quota>    <UsedQuota>0</UsedQuota>  </RepositoryQuota></CloudTenantResource>

 

Source: http://helpcenter.veeam.com/backup/80/rest/_tenants_id_resources_2.html

 

My Result dos exactly look like that.

Now is the Question how to deal with the Result.

 

First I want to try to extract all “ <RepositoryQuota>” fields In to an array.

What is the best way to do that?

OGNL IF Statement

$
0
0

Please share if you have figured out how (if possible) to use a conditional statement before a GetAction runs.

 

For example... this works fine.

 

adUserSearch.jpg

 

But if I want to only call the action if the searchTerm length is 5 characters, I cannot figure out a proper syntax to make that happen.  (Tried lots of ways... just not the right way--if one exists.)

 

adUserSearch2.jpg

Strange Issues with VCO

$
0
0

Hello,

 

I am experiencing some strange results when using VCO. First off every once in awhile my Find Virtual Machines By Name Workflow will yield no results even though I know vms exist. I will reboot the appliance and when it comes back up and I run the same workflow it finds the vms. The other thing is often my Active Directory objects get removed. I do not know why this happens. I have to delete the configuration items and re create them. The configuration items are sitll there but my workflow that uses specific OU objects have them nulled out and I cannot re-add the values without re adding the AD servers.

 

Can anyone explain this or know why this is happening?

 

thanks,

Expand datastore/vmfs action/workflow?

$
0
0

I'm guessing this is another one of those "write a slew of code" questions and figured I'd ask around before firing up Onyx.  I'd like to have a workflow where I give it an LDEV id (LUN id on disk array) and then it expands it on the storage array, find the datastore in vCenter, and then expands it there.  I can easily do all of that except for the last part.  Anyone have code I can copy?

Workflow kicked off by script fails to obtain passed securestring parameter

$
0
0

Hi,

 

I am using a (linux) script to kick off a workflow (thanks to Defined by Software for the script;-) This mechanism works very well.

However, yesterday we removed an input parameter from a certain workflow (and also removed it from the script) and now it fails.

 

Before the change, the input parameters were: vmName (string), vmUser (string), vmPassword (SecureString)

After the change, the input parameters are: vmName (string), vmPassword (SecureString)

 

In the script I can add statements to prove that the password has a value and is being passed.

In the workflow I added a scriptable task that is executed first and shows that the value of the vmPassword input parameter is empty.

 

The xml output from the calling script also shows that the value setting is 'lost'...

See the correct parameter definition for vmName on lines 11 and 12.

See an incorrect parameter definition for vmPassword on line 13 - it is missing the "<SecureString>secret<\SecureString>" part...

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><workflow-execution  href="https://ehc3-vco2.ehc.ssev.local:8281/vco/api/workflows/fe59b484-ec21-4028-8a32-5e434b4139c2/executions/ff8080814e0272b6014eadc7c37424fb/"><relations><link href="https://ehc3-vco2.ehc.ssev.local:8281/vco/api/workflows/fe59b484-ec21-4028-8a32-5e434b4139c2/executions/" rel="up"/><link href="https://ehc3-vco2.ehc.ssev.local:8281/vco/api/workflows/fe59b484-ec21-4028-8a32-5e434b4139c2/executions/ff8080814e0272b6014eadc7c37424fb/" rel="remove"/><link href="https://ehc3-vco2.ehc.ssev.local:8281/vco/api/workflows/fe59b484-ec21-4028-8a32-5e434b4139c2/executions/ff8080814e0272b6014eadc7c37424fb/logs/" rel="logs"/><link href="https://ehc3-vco2.ehc.ssev.local:8281/vco/api/workflows/fe59b484-ec21-4028-8a32-5e434b4139c2/executions/ff8080814e0272b6014eadc7c37424fb/state/" rel="state"/></relations><id>ff8080814e0272b6014eadc7c37424fb</id><state>failed</state><input-parameters><parameter type="string" name="vmName" scope="local"><string>vm093</string></parameter><parameter type="SecureString" name="vmPassword" scope="local"/></input-parameters><output-parameters/><start-date>2015-07-20T19:23:46.932-04:00</start-date><end-date>2015-07-20T19:23:48.070-04:00</end-date><started-by>app_vmw_vco_adbind@domain.local</started-by><name>Add Agent</name><content-exception>; nested exception is:        java.io.IOException: java.io.IOException: Non nillable element 'password' is null. (Dynamic Script Module name : addAgent#32)</content-exception><current-item-display-name>Add Agent</current-item-display-name></workflow-execution>

 

Anybody seen this and -more importantly- able to fix it? :-)

 

Thanks,

Ed


How to add datastore to a datastore cluster

$
0
0

Hi All,

 

How to add a datastore to a datastore cluster. There is vc:datastore object but  not able to find javascript object for datastore cluster.

 

Any help appreciated.

Clone VM - assign IP address, but get invalid IP - 169.254.x.x

$
0
0

This workflow I'm trying to put together consists of the clone of a VM, selection of the OS, memory sizing, datastore selection, and input for the IP address, subnet mask, and default gateway.  Once the VM gets created and starts, it returns with an invalid IP of 169.254.x.x. 

 

I'm using the built-in workflows for "clone a virtual machine, no customization" and the action "getCustomizationIPSettings" in this workflow.  The Orchestrator version we are running is 5.1.

 

I suspect that one of the areas this is failing is the VM's ability to connect to the appropriate VLAN for the IP address.  What attribute/input and what setting(s) need to be included in this workflow for this to successfully connect to the appropriate VLAN and have that IP retain what is entered?

 

I'm slowly figuring things out with Orchestrator but have hit a roadblock with this static IP issue.

Get Linked Clones based on a given Snapshot or snapshotTree

$
0
0

I need to be able to delete all Linked clones based on a snapshot of a given name.  I can get the snapshot object by traversing the trees and searching for the name (which is ridicules), but I can't seem to find a link between VM and Snapshot.  I really, really really really, hope I don't have to get the backing for a snapshot and try and link up the VMs that way.

Persisting files and endpoint configurations to a vRO server

$
0
0

I am developing a plugin for vRealize Orchestrator, and I am trying to understand how files can/should be stored on the vRealize Orchestrator server. I am aware that a temporary directory is available for writing files, but is there a recommended way to store files long-term (e.g. backups and patch files for the orchestrated technology) on the Orchestrator server?

 

 

Additionally, there is an EndpointConfigurationService interface available within the Spring Maven archetype for a vRO plugin, but there does not appear to be any implementation of this interface within the archetype's dependencies. Is there a default implementation of this interface, or is it the developer's responsibility to implement it themselves?

Execute powershell script in VCO Workflow

$
0
0

Hi guys,

 

I'm pretty new to VCO and i'm facing some difficulties to get what i want. For you it will be a basic... but here is my question :

 

I have a WF that i use in the WFStubmachineprovisionning that can generate me a VM name based on user selection while he ask for a VM in VRA.

The provisionned VM name is like this : W203PKLXXX and i need to replace the XXX by a number that is available on the network.

 

To do this, i need to query the DNS to check if 001 is available, if not, 002... And so on... until one available, and i send the full VM name to the WF Stubprovisionning.

 

This my first try to interact between VCO and a Powershell script. I can run PS script on my configured host, but don't know how to send variable from the personalised WF that generate the name to the PS script, and send the VM Name from the PS script to the next step.

 

Can anyone give me a sample to manage variable ? I didn't find anything around the net

Viewing all 10285 articles
Browse latest View live