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

Getting an error when I try to use worfklow.changeCredential() function

$
0
0

I have a WF that uses the following code block:

 

//  Change the running credential:
System.log("Workflow started running as: " + Server.getCredential().username);

System.log("Changing to: " + newCredential.username);
workflow.changeCredential(newCredential);
System.log("Credential is changed.");

System.log("Workflow is now running as: " + Server.getCredential().username);

 

Line 5 errors out with a NULL error.  I get nothing descriptive at all:

 

2017-09-20 12:56:11.301] [E] Workflow execution stack:

***

item: 'Credential Test/item1', state: 'failed', business state: 'null', exception: 'null'

workflow: 'Credential Test' (670d0b4c-b6d8-46c8-8471-6853dbf08413)

|  'attribute': name=errorCode type=string value=

|  'input': name=newCredential type=Credential value=newUser:newPassword123

|  'no outputs'

*** End of execution stack.

 

I would just use the "Change Credential" built-in action, but as you see above the credential you pass into it gets exposed in plain text to any user running the workflow.  My workaround was to create a new credential in the script and use workflow.changeCredential() to change to it.

 

For some reason, I can't call workflow.changeCredential though.  The "CHange Credential" action DOES work, and as far as I can see, it uses the same javascript code.

 

Does anyone know how to change the running credential with code?

 

I'm running VRO 7.3.0.


create multiple orchestrator configuration elements

$
0
0

Hello,

I try to automate the création of ElementCategory but cannot find the way to do it

the aim is to add networks configuration parameters in a category path called network

 

network

element 1     element 2       ....

name            name

elementref    elementref

range            range

gateway        gateway

...

 

I have seen actions to create attributes on existing elements but not actions to create an element in a cofigurationElementPath

I have seen WF to import elements but the vco server must be a remote one I have only one vco server

 

does someone have an idea on how to create elements ?

Reference search error

$
0
0

On vRO 7.2.1.6436335. I am getting some sort of timeout when trying to use reference search

references search error.png

Nothing in the server.log that explains this problem. Application is fine and fully functional otherwise.

Workflow library is fairly large, more than 1500 just for workflows alone.

Any known issues or other pointers?

Search list for vCAC:HostMachine not working in workflow input vRO 7.3

$
0
0

Trying to use a list or dropdown for vCAC:HostSystem doesn't return any matches.  I need to leave it blank and hit enter which returns a long unsorted list.  Tree view takes forever in our environment.  I'm coding around it but this seems like a bug.

vCD Provider vDC not returned after creation.

$
0
0

Hello,

 

I have workflow which creates a Provider vDC in vCloud Director. After that it creates an Organization and then an Organization vDC.

To create the Org vCD I need the provider vDC. I query the API for it, but it is not returned. However if I have the code loop it eventually shows up in about 20 minutes. Here is a sample of the code.

 

while (sleepCounter < maxSleep) {

  //Update the vcdHost from vRO to vCD

  vcdHost.updateInternalState();

  // Find Provider vDC

  var vdcs = vcdHost.toAdminObject().getProviderVdcs();

 

 

  System.debug("Provider VDC count: "+vdcs.length);

  for each (var vdc in vdcs) {

      System.debug("Have a Provider vdc: "+vdc.name);

   if (vdc.name.indexOf(providerVdcName) != -1) {

   providerVDC = vdc;

   System.log("Found Provider vDC: " + providerVDC.name);

     break;

    }

  }

  sleepCounter += 1;

  if (providerVDC == null) {

   System.log("Did not find the provider VDC, sleep 1 minute");

   System.sleep(sleepTime);

  } else {

    //Found it, exit loop

    sleepCounter += maxSleep;

  }

}

 

I have had stale data issues in the past, but the updateInternalState() call on the vCD connection, seemed to resolve that.

 

I am running vRO 7.2 with vCD 8.0.2.  Any ideas? Is there an API call I can use to force the data refresh to happen sooner?

Password validation not working

$
0
0

Hi,

 

I have a workflow that requires the user to define a new password that must meet complexity requirements. The workflow uses custom validation on a field within the form based on the below action:

 

var length = /^[\s\S]{8,32}$/,

upper = /[A-Z]/,

lower = /[a-z]/,

number = /[0-9]/,

special = /[^A-Za-z0-9]/,

count = 0;

 

 

 

 

// Check password meets length requirement

if (length.test(password)) {

// Only need 3 out of 4 of these to match

if (upper.test(password)) count++;

if (lower.test(password)) count++;

if (number.test(password)) count++;

if (special.test(password)) count++;

}

else {

return "Password does not meet length requirements"

}

 

if (count < 3){

return "Password does not meet complexity requirements"

}

 

else {

return true

}

 

For the password input parameter call I am using #__current, which works through the vRO client but doesn't work via the vCenter plugin. In this instance, no matter what is entered it just returns "Password does not meet complexity requirements". Can someone assist with getting this working?

vm power state when Snapshot taken

$
0
0

Hi community ,

i am searching for a way to know what is the power state of the VM when a snapshot taken .

vcenter 6.5

thanks in advance

vRO 7 - user interaction predefined values from composite type?

$
0
0

I have a workflow that asks users for 4 input parameters (string arrays) during runtime. The parameters are predefined and selected from a drop down. The predefined values are prepared by a nested workflow, that runs shortly before it in the sequence.

Now I want to use the main workflow in vRA and for a better user experience the user interaction has to be loaded first, not during runtime. For this I have to feed the predefined values using an action. Since I do not want to build 4 separate actions to prepare the 4 values, I wanted to see if it is possible to use a composite type parameter (consisting of 4 x string arrays) as the return value of the action and then somehow "split" it when selecting the predefined value in the UI. Basically, the first UI input would have inputParams.param1 (first string array) as predefined answer, the second intput inputParams.param2 etc, with inputParams being the composite type return value of the action.

Is a solution like this possible?

 

What I have already tried is, to create a new input paramter which would take the composite type return value from the action, set the property to "hidden" and then try to bind the rest of the input parameters to it, but even when I set the input value to array\string, the composite type values are not recognized.

 

Edit: Nevermind, found the error. I've cross-checked with another ismilar workflow I worked on a long time ago and noticed, that the return parameter names in the action have to be the same as the names in the composite type, otherwise the value will be null. Also, choosing one of the composite type parameters in the UI works, but has to be done manually:

- first create an input parameter of type composite type and assign an action to it as "default value"

- then create other input parameters, where the type equals the type of the component type parameters. So in my case, where the comp type includes string arrays, the new input parameter is a string array and the value is mapped as predefined answer to #inputParams.param1.


I can't get used space value of "ORG VDC Storage Profile"

$
0
0

Hi all,

 

vCloud Director version : 8.1.0

vCO version  : 7.0.1

 

I can see used space of org vdc storage profile on web interface of vCloud Director as you can see below ;

 

usedDisk.JPG

 

Now, i need to get this information on vCO workflow. I created a lot of workflow related to this project but i'm stuck here. everything looks like fine but why it is not working i don't know. My code is ;

 

for each ( profile in vdc.vdcStorageProfiles.vdcStorageProfile.enumerate()) {     System.log("Tier Name : "+profile.name);     System.log("Used Space : "+profile.storageUsedMB);

}

 

Result ;

 

[2017-09-26 11:39:33.855] [I] Tier Name : SSD

[2017-09-26 11:39:33.866] [I] Used Space : undefined

[2017-09-26 11:39:33.870] [I] Tier Name : SAS

[2017-09-26 11:39:33.872] [I] Used Space : undefined

 

Also, I tried to get this information using Query Services as you can see below ;

 

profileRecord.JPG

 

var vdcHost = vdc.getHost();
var queryService = vdcHost.getQueryService();
var expression = new VclExpression(VclQueryAdminOrgVdcStorageProfileField.NAME, profileName, VclExpressionType.EQUALS);
var filter = new VclFilter(expression);
var params = new VclQueryParams();
params.setFilter(filter);


var resultSet = queryService.queryRecords(VclQueryRecordType.ADMINORGVDCSTORAGEPROFILE, params);
var storageProfile = new Array();


while (resultSet != null)  {
var records = resultSet.getRecords(new VclQueryResultAdminOrgVdcStorageProfileRecord());
for each (var record in records) {
if (record.vdc == vdc.getReference().href) {
var storageProfileRef = new VclReference();
storageProfileRef.href = record.href;
storageProfileRef.name = record.name;
storageProfileRef.type = record.type;
var storageProfiles = vdcHost.getEntityByReference(VclFinderType.VDC_STORAGE_PROFILE, storageProfileRef);
if (storageProfiles != null) {
storageProfile.push(storageProfiles);

System.log("Tier Name : "+storageProfiles.name);
System.log("Used Space : " +storageProfiles.storageUsedMB);



}
}
}
    resultSet = resultSet.getNextPage();
}

 

Result ;

 

[2017-09-26 11:39:33.855] [I] Tier Name : SSD

[2017-09-26 11:39:33.866] [I] Used Space : undefined

[2017-09-26 11:39:33.870] [I] Tier Name : SAS

[2017-09-26 11:39:33.872] [I] Used Space : undefined

 

It is not working ! is there anybody who can help me related to this issue ?

modify standard portgroup of a vm network card

$
0
0

Hello,

I have a dificulty trying to modify the portgroup affected to a network card after having created a VM

 

in my workflow I have firstable created a network card,  the card type is created according to the OS type using the action createVirtualEthernetCardNetworkConfigSpec (the nic type is given by a configuration element attribute linked to the OS to deploy

 

after I need to reaffect the network card to the production network portgroup but that is very difficult cause when I get the device it does not tells me if it is type vmxnet3 or E1000 or something else

 

as I can see I need to do a reconfiguration of all network parameters not only "backing.network"

 

is the only solution to do a "case select" to get the device type of the existing card?

or is there a best way to have this information from the device itself?

 

or is it possible to reuse the deviceConfigSpec variable (result of the createVirtualEthernetCardNetworkConfigSpec action to reconfigure the network card? (I am on the same workflow )

 

I hope my question is clear

thanks

Editing a VM while it is online

$
0
0

Hi,

i want to edit my VM while it is running.

So I want to change the RAM Size of my virtual Machine. My first taught was to it with a ConfigSpec, but I got an expection, that it is not possible in this state.

It will generate my next try, but how can i manipulate the config over the API? Like vm.summary.config.memorySizeMB = 2048 ?

vRA and PowerCLI do not make any other way, they editing the vmx file over the API. How could the way be for the orchestrator.

Get all vCD VMs from vCD Host

$
0
0

Hello,

I need to get all vCloud Director VMs related to a vCD Host in vRealize Orchestrator.

 

I already created this Script:

var adminhost = host.toAdminObject();
var AdminOrganizations = adminhost.getAdminOrganizations();


var VcloudVms = new Array();
for each (AdminOrganization in AdminOrganizations){
var AdminVdcs = AdminOrganization.getAdminVdcs();
for each (AdminVdc in AdminVdcs){
var VApps = AdminVdc.getVApps();
for each (VApp in VApps){
var Vms = VApp.getChildrenVms();
for each (Vm in Vms){
VcloudVms.push(Vm);
}
}
}
}
System.log(VcloudVms.length + " vCloud Vms Found");


 

But I think this can´t be the most efficient way to do that... Any recommendations?

 

Best regards,

Markus

Task 'addHost' error: The operation is not supported on the object.

$
0
0

I have created a workflow that successfully deploys a new datacenter, then a cluster. Next it should add a host that is currently unmanaged by vCenter and is in maintenance mode. However, the workflow 'Add Host To Cluster' always fails with the following error (both directly and when used in my workflow):

 

[2017-09-27 17:46:24.407] [E] (com.vmware.library.vc.basic/vim3WaitTaskEnd) Error in (Dynamic Script Module name : vim3WaitTaskEnd#20) Task 'addHost' error: The operation is not supported on the object.

[2017-09-27 17:46:24.426] [E] Workflow execution stack:

***

item: 'Add host to cluster/item0', state: 'failed', business state: 'null', exception: 'Task 'addHost' error: The operation is not supported on the object. (Dynamic Script Module name : vim3WaitTaskEnd#20)'

workflow: 'Add host to cluster' (BD8080808080808080808080808080804EC180800122528313869552e41805bb1)

|  'attribute': name=task type=VC:Task value=dunes://service.dunes.ch/CustomSDKObject?id='snrvc01.sonar.lan%2Cid:task-9563'&dunesName='VC:Task'

|  'attribute': name=progress type=boolean value=false

|  'attribute': name=pollRate type=number value=1.0

|  'input': name=cluster type=VC:ClusterComputeResource value=dunes://service.dunes.ch/CustomSDKObject?id='snrvc01.sonar.lan%2Cid:domain-c766'&dunesName='VC:ClusterComputeResource'

|  'input': name=asConnected type=boolean value=true

|  'input': name=resourcePool type=VC:ResourcePool value=dunes://service.dunes.ch/CustomSDKObject?id='snrvc01.sonar.lan%2Cid:resgroup-767'&dunesName='VC:ResourcePool'

|  'input': name=force type=boolean value=true

|  'input': name=hostName type=string value=host01.mylab.lan

|  'input': name=port type=number value=443

|  'input': name=userName type=string value=root

|  'input': name=password type=SecureString value=__NULL__

|  'input': name=vmFolder type=VC:VmFolder value=dunes://service.dunes.ch/CustomSDKObject?id='snrvc01.sonar.lan%2Cid:group-v768'&dunesName='VC:VmFolder'

|  'input': name=license type=string value=

|  'output': name=newHost type=VC:HostSystem value=null

*** End of execution stack.

 

If I use the same details, I can successfully add the the host in the vSphere webclient using the same details as I use in the workflow.

 

Anyone have any ideas?

Storage policy path selection

$
0
0

Hi all, I would like to know what type of 'path selection' is configured on LUNs in every host I have.  I just need to make sure 'Round Robin' is configured everywhere. I cannot find relative Class/method in vCO API explorer ... :( Thanks  in advance, Fred

Programmatically move workflow to folder

$
0
0

I'm having trouble finding a way to programmatically move a workflow to a different folder, looking through the API explorer and the canned Library workflows. Can anyone point me in a direction?

 

Thanks


Search for Child OUs

$
0
0

Hello,

 

Was wondering if a fresh set of eyes could help me out please. I am trying to search for the child OUs of a parent OU. I am getting the results but I am unable to filter the attributes I need:

 

var parentOU = "Departments"; (this would be an input but I am hard settings this for testing purposes)
var ous = ActiveDirectory.search('OrganizationalUnit',parentOU);

var arrchildOUs = [];

for each (ou in ous){
arrchildOUs.push(ou.organizationalUnits);
}
System.log (arrchildOUs)

 

The results I get are as follows:

[2017-09-27 16:27:03.603] [I] DynamicWrapper (Instance) : [AD_OrganizationalUnit]-[class ch.dunes.ad.object.OU] -- VALUE : #_v2_#,#OU#,#257bfca1-a439-44b7-a9a2-c5a4b593fdb7#,#OU=Finance,OU=Departments,OU=vRA Self Service,DC=demo,DC=co,DC=uk#,

DynamicWrapper (Instance) : [AD_OrganizationalUnit]-[class ch.dunes.ad.object.OU] -- VALUE : #_v2_#,#OU#,#257bfca1-a439-44b7-a9a2-c5a4b593fdb7#,#OU=Sales,OU=Departments,OU=vRA Self Service,DC=demo,DC=co,DC=uk#,

DynamicWrapper (Instance) : [AD_OrganizationalUnit]-[class ch.dunes.ad.object.OU] -- VALUE : #_v2_#,#OU#,#257bfca1-a439-44b7-a9a2-c5a4b593fdb7#,#OU=Support,OU=Departments,OU=vRA Self Service,DC=demo,DC=co,DC=uk#

 

I was hoping to just return the OU names. Any advice greatly appreciated.

Find a vRA catalog resource by its request Id.

$
0
0

I'm trying to use this to lookup a catalog resource by its requestId but I get an error saying "Invalid data access API usage exception raised during retrieving data" .  This is how I put together the request:


var service = host.createCatalogClient().getCatalogConsumerResourceService();

var filter = new Array();

filter[0] = vCACCAFEFilterParam.equal("requestId", vCACCAFEFilterParam.string(requestId));

var query = vCACCAFEOdataQuery.query().addFilter(filter);

var items = service.getResourcesList(new vCACCAFEPageOdataRequest(query))

 

Any clue why this throws this error?  Seems like it should work.

 

I also tried using the request service

 

var requestService = host.createCatalogClient().getCatalogConsumerRequestService();

var resources = requestService.getResourcesProvisionedByRequest(requestId);

 

But I'm not sure where to go with the result.  The result is a com.vmware.vcac.platform.rest.client.services.PagedResourcesWrapper which I am not sure how to handle.

How to get Vdc storage profile information where catalog located.

$
0
0

Hi all,

 

I have some catalogs in organization. ( Windows, Linux etc...).  I want to get the Vdc storage profile information where catalog located.

 

 

var reference = catalog.toAdminObject().catalogStorageProfiles.vdcStorageProfile;
var storageProfiles = vdcHost.getEntityByReference(VclFinderType.VDC_STORAGE_PROFILE, reference);
System.log(storageProfiles.name);

 

System.log(reference); returns " DynamicWrapper (Instance) : [VclObjectList]-[class com.vmware.vmo.plugin.vcloud.model.VCloudExtensibleListDecorator] -- VALUE : com.vmware.vmo.plugin.vcloud.model.VCloudExtensibleListDecorator@35ac2905"

 

vdcStorageProfile is reffering VclObjectList when click.

 

 

But, I need to reference of vdc storage profile like this ;DynamicWrapper (Instance) : [VclVdcStorageProfile]-[class com.vmware.vmo.plugin.vcloud.model.VdcStorageProfile] -- VALUE : com.vmware.vmo.plugin.vcloud.model.VdcStorageProfile@c0e8b9d8

 

What is wrong ?

Custom VM Properties

$
0
0

I'm very new to vRO and I am tasked with a few objectives for automating the build of new VMs, I have successfully built a RunBook for a new VM but I have a couple other objective that im not having any luck with.

 

1. Need to assign the network properties after VM starts. The IDEAL method would be pulling an IP from SWinds IPAM, but manual IP from captured user input would also be acceptable in the interim while we try to build a case to get vRA

 

2. Computer Name - I need to check the VM structure or AD for the next available name in the sequence. For instance, our IIS servers are named TR01VDSIIS001, TR01VDSIIS002, 003, 004 etc.

 

3. Join our domain and the place the computer in an OU ( I already have the AD module connected, I just dont know how to get the results of the build workflow to perform the AD parts)

 

Ive spent a few hours on this so far but to no avail...some help would he GREATLY appreciated

 

Thanks

Adding a VM to an AD group during provisioning

$
0
0

We have a handful of AD groups used to patch Windows on various schedules.  I have a drop down that asks the user when they would like to patch and then I pass on the variables to a PS script. This works fine but it just bugs me that I have to use that PS script when I have everything else within vRO.  I did some googling and found one posting about this same thing back in 2015.  I took that code and some of my own and produced what I thought was a solid script.  However when it runs I get this message:

 

Error in (Workflow:JustTheProps / Scriptable task (item1)#74) TypeError: Cannot find function addElements in object DynamicWrapper (Instance) : [AD_UserGroup]-[class ch.dunes.ad.object.UserGroup] -- VALUE : #_v2_#,#UserGroup#,#012827d2-77fb-435f-bf6e-8fff3fcf4e76#,#XXXXXXXXXXXXXXXX

[2017-09-29 14:19:10.862] [E] Workflow execution stack:

***

item: 'JustTheProps/item1', state: 'failed', business state: 'null', exception: 'TypeError: Cannot find function addElements in object DynamicWrapper (Instance) : [AD_UserGroup]-[class ch.dunes.ad.object.UserGroup] -- VALUE : XXXXXXXXXX. (Workflow:Patching / Scriptable task (item1)#74)'

 

 

This is where the code bombs:

if (index == -1){

userGroup.addElements(computers);

System.debug(computerAD.name+" is added to group "+ userGroup.name);

}

else System.debug("Server is member of group "+userGroup.name);

 

Has anyone run into something similar and have an idea what needs to be looked at?

Viewing all 10285 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>