Hi.I am working on automating vro workflows. Can you please tell me how to find the dunesId of any object in the inventory "vCenter Server"?
VRO Automation - Vcentre server
Create a dynamic list of vCenter 6.5 Folders for vRA 7.2
I need to have a drop down on my vRA blueprints that will list the folders in vCenter allowing the user to specify which one they want to build their VM in. I can manually input the folder list as a Property Definition however our operations group creates quite a number of folders. What I would like to do is call a vRO workflow that will dynamically build this list for me so its not updated almost daily.
I found this code from an earlier post by Ilian Iliev
- // Search index object for the first registered vCenter
- var index = VcPlugin.allSdkConnections[0].searchIndex;
- // Inventory path of the folder to search for (note: starts with datacenter name; replace datacenter123 with your datacenter name)
- var invPath = "/datacenter123/vm/site1/servers/critical/";
- var folder = index.findByInventoryPath(invPath);
- System.log("folder: " + folder);
I did change the DC name to /mydatacenter/mycluster/ under which I have several top level folders and subfolders. When I run this workflow I get the following error message in vRO. I have tried this by declaring invPath as an attribute and hardcoding the datacenter and added folder as an output. I seem to have no luck either way.
[2017-07-20 09:15:44.132] [E] Error in (Workflow:getFolderList / Scriptable task (item1)#6) TypeError: Cannot call method "findByInventoryPath" of null
[2017-07-20 09:15:44.140] [E] Workflow execution stack:
***
item: 'getFolderList/item1', state: 'failed', business state: 'null', exception: 'TypeError: Cannot call method "findByInventoryPath" of null (Workflow:getFolderList / Scriptable task (item1)#6)'
workflow: 'getFolderList' (16cedf47-3abc-4e1b-ba60-e390b995e1bc)
| 'attribute': name=invPath type=string value=/p10dcvcenterha.amwins.local/P10/
| 'output': name=folder type=string value=null
| 'no inputs'
*** End of execution stack.
Any assistance would be great.
Thanks
PS Script is started multiple times
Hi,
I have a problem with my workflow for creating a template form a selected VM.
My workflow consists of a "scriptable task"(IN parameter: VM, folder, resourcepool, name, OUT parameter: output). which formats the input objects to string and paste them to an "invoke external script" with a powershell script(IN parameter: host, externalscript, arguments, OUT parameter: output).
After execution the output is given to another "scriptable task" which has no programming yet.
The problem is that the ps script does its job and after the end, it is started another time but also aborted after a few steps and I can't figure out why.
The simplified start of my ps script looks like this:
param(
$vmfo,
$name
)
$log = "\\server_ip\D$\scripts\logs\wf_tpl_log.txt"
date
date >>$log
echo "VM or Folder:$vmfo, Name:$name"
echo "VM or Folder:$vmfo, Name:$name" >>$log
echo "Start Script..."
$zzah = get-random
echo "Import Module..."
echo "Import Module..." >>$log
Import-Module "C:\Program Files (x86)\VMware\Infrastructure\PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1"
if ($?){
echo "success!!!"
}
else{
echo "error???"
exit
}
echo "Connect VCenter Server..."
echo "Connect VCenter Server..." >>$log ==>>This is the last message I get in the log when it runs the 2nd time!
Connect-VIServer -server server_ip -User Administrator -Password password -force -WarningAction SilentlyContinue >>$log
if ($?){ echo "success" } else {echo "error"}
Everything is working fine, script ends with "exit 0" so I guess the problem comes from the workflow and not from the script itself.
Any ideas to this issue?
PS: I just tested with a simple workflow consisting only of the "invoke external script" plugin and an added ps script with an echo as content and also this is executed twice.
So it seems to be a general problem/bug within the orchestrator application.
Thanks and Regards
Alu
problem with timezone during sysprep
I deployed a remote vcenter (6.5) and vro (7.2) and when I create vms there, the timezone within the vms are not set correctly. (The VCSA/vRO appliances are independent and not linked to anything else)
For the sake of argument, lets say we're dealing with new york and paris timezone.
I was checking the management interface of the appliances (the stuff on port 5480). The VCSA is set to UTC and the vRO appliance was set to new york timezone. I have fixed the vRO appliance to be the paris timezone.
Within the OS the timezone is shown as new york instead of paris even though I'm setting timezone=105.0 as part of my customization. Anyone have any idea as to what could be wrong? (The time within the OS is also wrong but it's the same value as the VCSA so i'm guessing i need to change the timezone on the VCSA too? )
Thanks
Modify user interaction email
I am using the "user interaction" object in vRO. I'd like to customize the email that is sent to the user by the user interaction to include attributes of the workflow. Is that possible?
If not, is there an alternative way to create a user interaction where I can control the email content?
Thanks.
get datacenters
Hi,
How can I get all the datacenters in specific vCneter with VMWare Orchestrator?
Thanks!
vRO vCenter 6.5 Plugin build 6.5.0.5817435 - proactive object caching?
I've been tailing the server.log in vRO 7.2, using the Tech Preview vCenter 6.5.0.5817435 plugin, and noticed that it might be doing some kind of proactive caching of objects from what looks to be SDK connections that have recently been used. I say its proactive, because even after workflows have ended for a specific SDK connection, I still see vRO retrieving properties for objects I've just queried. Is this normal? This definitely does speed up workflows that traverse SDK connections, since some objects are cached, but the logging does go a bit nuts.
For instance, I have a workflow that takes a DRS cluster as input. It then traverses each host in the cluster and finds all VMs on each host, then eventually spits out an analysis of the vCPU + memory usage. The last execution of this workflow ended at 15:36:26 today:
2017-07-24 15:36:26.893+0000 [WorkflowExecutorPool-Thread-9] INFO {jchou@domain.net:Get Cluster Subscription Ratios:86503545-4851-45fd-a930-34d92f4729c9:token=8a828a815d74fec4015d7538803c0045} [WorkflowHandler] End of workflow 'Get Cluster Subscription Ratios' (8a828a815d74fec4015d7538803c0045), state: completed
But the server.log still shows vRO retrieving objects from that SDK connection afterwards. When I look at server.log after 15:36:26, I see thousands of object retrieval requests for the same SDK connection. Not sure how these are triggered?
2017-07-24 15:36:28.970+0000 [https-jsse-nio-0.0.0.0-8281-exec-7] INFO {} [ObjectRetrieverImpl] Object retrieving started in user@vcenter SDK of properties [] for type VirtualMachine and number of objects: 1
...
2017-07-24 15:39:31.051+0000 [https-jsse-nio-0.0.0.0-8281-exec-6] INFO {} [ObjectRetrieverImpl] Object retrieving started in user@vcenter SDK of properties [] for type ClusterComputeResource and number of objects: 1
From 15:36:28 until 15:39:31, there are 2243 requests for objects from this SDK connection: 2155 for VirtualMachine, 80 for HostSystem, and 8 for ClusterComputeResource. To me this seems excessive, but is this how it's supposed to work? I don't recall seeing this level of logging in earlier vCenter plugins in vRO 7.2.
Is someone able to comment if this is normal?
query hosts
Hi,
I get all the hosts from a cluster with the command:
var hosts = cluster.getAllHostSystemOfCluster();
I want to pass over the array of hosts, and check if the host is available and not in maintenance mode and get all the datastore from the host.
Thanks!
Property definition and property group tool kit. Adds copy, replace, and supports globally visible definitions and groups.
I figured I'd share some enhancements to the vRO plugin for vRA that I threw together as we are in the midst of migrating vRA 6 to 7. I had setup a lab where I was doing my testing and when I went to migrate my property definitions and groups I discovered the cloud client doesn't like items that are visible to all tenants. I like doing just about everything in orchestrator anyway so I'm putting together a sync utility and I needed some workflows that can move between environments. I also just wanted to flip all of the visibility to the tenant on everything I had already created so I put that into the workflows. You can grab the package here vRealize Automation property definition and property group tool kit - Samples - VMware {code} . Its far from perfect but pretty functional. I'll update it as I go along. Uploading a copy of the package here but any updates will be on the code.vmware.com site.
Invoke Workflow via REST API with Input Parameter of type Any
I'm running VRO 7.3.
Has anyone successfully invoked a workflow with an input parameter of type Any before? I'm trying it with this execution context and it's not working:
{
"parameters": [
{
"value": {
"properties": {
"property": [
{
"key": "p1",
"value": {
"number": {
"value": 1.0
}
}
},
{
"key": "p2",
"value": {
"string": {
"value": "two"
}
}
},
{
"key": "p3",
"value": {
"date": {
"value": 1501015223000
}
}
}
]
}
},
"type": "Any",
"name": "any",
"scope": "local"
}
]
}
It passes and executes the WF, but it fails with the following error:
"Unable to convert any type ()"
I see a difference between my execution via REST and the one VRO does using the GUI:
GUI:
Properties##[#p1#=#number#1.0#+p2#=#string#two#+#p3#=#Date#20170725164023-0400#]#
REST:
#[#p1#=#number#1.0#+p2#=#string#two#+#p3#=#Date#20170725164023-0400#]#
Note the "Properties#" is missing when I call the workflow via REST. I'm sure this is the issue, but given all of the examples I've seen I'm doing things correctly.
Any ideas are appreciated!
In case you run into this with a 7.3 upgrade -- Lost access to control center
thread - Locked myself out of vco-controlcenter
once you run that command un-register from authentication source and re-register, reboot
XML Node output from action
I'm building a lot of workflows invoking REST operations against NSX and other API's that uses XML for the request body, and I wanted to programmatically build the XML from an XMLManager document then convert to string to invoke against the API. The problem I'm running into is that if I run the code to build the object via a function in a scriptable task, it works fine... but if I take the same code and turn it into an action (with a return type set to ANY), the resulting variable in my scripting task is always set to null.. which is frustrating. What am I doing wrong?!
Inputs would be document (the XML document, type is set to ANY), parent (the root node for the new XML node, also set to type of ANY)... nodeName is a string input, as is nodeText.
Code looks like this:
var newNode = document.createElement(nodeName); parent.appendChild(newNode); if (nodeText!= null){ var newTxt = doc.createTextNode(nodeText); newNode.appendChild(newTxt); } return newNode;
Any help would be greatly appreciated!!!
How to setup VRO clustering
I would like to setup a VRO Clustering for my environment, Any document that helps with clear procedure.
Im getting uneditable error in few of the library workflows
Im getting uneditable error in few of the library workflows
For example Workflow :- Get a VirtualEthernetCard to change the network
May i Know the reason for it
Change Owner with Request a catalog resource action fails with 400 Bad Request
We've just upgraded to 7.3 and I am trying to re-assign ownership as part of a workflow where a service account does the request then flips ownership at the end. I am trying to use the "Request a catalog resource action" to do this but always get a 400 Bad Request. I am running this on the Change Owner op of the Deployment passing in just one value provider-NewOwner set to the desired user. I can reassign from the gui with no issues but am always hitting this error in vRO. HELP!
VCO workflow for thin/thick disk VM provisioning based on Condition
Hi,
please assist
I am trying to create a workflow for a new VM to have disk Thin/thick based on input.
For instance the workflow should build a VM with thick eager disk if the input is 'x'.. the workflow should build a VM with Thin disk if the input is 'y'.
please assist.. Any input or assistance is appreciated. Thank you
Empty "Requests" folder in vRA 7.3 plugin inventory
I see no items in the "Requests" folder in the vRA plugin inventory for 7.3... The user I am logged in with has full visibility to pretty much everything in vRA and I have also tried configuring a vRA server connection with that same user separate from what got setup during installation. I still see nothing. Are these in some other portion of the inventory now? I'm wondering if this is somehow related to my previous post today hitting issues with executing an owner change for the deployment.
How to pull the details of SCSi Controller from guest via vro
We have tried the possibilities to get the details by using below scripts..
//To print Disks Name
var vmDisks=myvm.guest.disk;
for (var i=0 in vmDisks)
{
var name=myvm.guest.disk[i].diskPath;
var guestdisk = new VcVirtualDisk();
var guestdisks =myvm.guest.disk[i];
System.log(guestdisk.guestdisks[i].ControllerKey);
System.log(name +": capacity : "+ myvm.guest.disk[i].capacity/1024 /1024 /1024 + " GB and FreeSpace: " + myvm.guest.disk[i].freeSpace/1024 /1024 /1024 + "GB");
}
We are not able to find the right scripting object to pull the SCSi controller details from the guest OS (windows).
Note :- from Vmlevel we are able to pull the scsi details, but we would like to pull from guest os, if i select the vm it should give E drive is connected to hardisk 1 and its SCSI details and present in this datastore.
Invoke Action with Custom Objects
Hello guys,
I am currently working on a vRO plug-in which needs to invoke an action (internally - in the Java client). My temporary workaround was to use REST and initially was fine, but now there is a problem that I struggling with.
First, making a REST call to a system which the plugin is currently part of seems like a bad idea. Second, some of the actions will need some custom objects to be passed as input paramaters - but these objects are notSDKObjects - they are available in the plugin.
Example:
ActionService actionService = new ActionService(session); ExecutionService executionService = new ExecutionService(session); ExecutionContext context = new ExecutionContextBuilder() .addParam("objA", objA) .addParam("objB", objB) .addParam("message", message) .build(); Action action = actionService.getAction(moduleName, actionName); executionService.execute(action, context);
Here, objA and objB are defined and they provide some methods which the action should use internally.
My question is: Is there any way of passing custom objects as input parameters when invoking vRO action?
Thanks for the help!
How to get detailed list in presentation in VRO 7.2
I am trying to figure out how I can get the same detailed information when I get a list of vm's or datastores that was available in VCO 5.5. When I display elements in a list I used to get more than just the objects name in 5.5. We have now moved to VRO 7.2 and now when I show elements as a list it only shows the name. Is there a way to change this?