I am trying to make the "Rename Virtual Machine" workflow available but hit one major snag. When a user runs the workflow they are able to everything in vCenter. Is there anyway to prevent that from happening. If it helps the VMs are in folders as you can see in the picture within vCenter. This may be a basic question but im still quite new to Orchestrator.
Stop Users seeing all VMs
Java Scripts in VRO action
Hi ,
I created a java script which will to get network profile value as string . but it is not working .i am not getting any value return .
==============================================================================
if (clusterName == null || tenantName == null) return ;
var networkProfiles ;
var host = vCACCAFEHostManager.getDefaultHostForTenant(tenantName, true);
var reservations = vCACCAFEEntitiesFinder.getReservations(host);
var res;
for each (reservation in reservations) {
if (reservation.name == "Res-" + clusterName) res = reservation;
}
var data = res.getExtensionData();
var reservationNetworks = data.get("reservationNetworks");
for each(network in reservationNetworks.getValue()) {
if(network.getValue().get("networkProfile").label.indexOf('BUN') == 0) {
var backupNetworkProfile = network.getValue().get("networkProfile").label;
break
}
return networkProfiles;
}
Previously i was able to get value as Array not as a string . Can someone help ?
vRO Plugin Development - 'https://vro-server-fqdn:8281/vco-repo/archetype-catalog.xml' is not supported anymore
I am trying to get started with learning vRO Plugin Development, and are have issues setting up my "dev-machine".
I have deployed a vRO Appliance version 7.3.0.21553 Build 5521409
I have a Windows Server 2012 R2, where I have installed JDK, JRE and Maven in the following locations:
C:\Java\jdk1.8.0_144
C:\Java\jre1.8.0_144
C:\Maven\apache-maven-3.5.0
I have added a User Environment Variable for %JAVA_HOME% pointing to "C:\Java\jdk1.8.0_144" and I have added "C:\Maven\apache-maven-3.5.0\bin" to the %PATH% System Enviroment Variable.
Going to my vRO Appliance's Development site, I get a instruction like this:
mvn archetype:generate -DarchetypeCatalog=https://vro-server-fqdn:8281/vco-repo/archetype-catalog.xml -DrepoUrl=https://vro-server-fqdn:8281/vco-repo -Dmaven.repo.remote=https://vro-server-fqdn:8281/vco-repo -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true
I have created a work folder: C:\vROPluginDevelopment
Been in that folder while executing the above instruction from the vRO Appliance's Development site, results in this:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.0.1:generate (default-cli) on project standalone-pom: archetypeCatalog 'https://vro-server-fqdn:8281/vco-repo/archetype-catalog.xml' is not supported anymore. Please read the plugin documentation for details. -> [Help 1]
Anyone have an idea why this is happening?
The "plugin documentation" I have been able to find, does not include anything about this.
vRO 7.3 REST HoK / SSO Authentication using vCenter 6.5 CIS
So with the last releases of vRO the authentication model was changed in many parts. We've moved from LDAP and SSO based to "vSphere" based (whatever that means is yet unclear to me. "Vsphere" knows multiple auth. methods and the methods vary in the vCenter version used).
Altought this was changed, when using the vRO REST API we're still presented with the "old" and very limited documentation on how to authenticate. It tells us 3 methods:
- LDAP credentials using basic auth (was already disabled by default some versions ago. I believe it's gone compleatly now since LDAP is not an valid auth provider option as of vRO 7.3)
- SSO authentication using a HoK token
- Oauth 2.0 authentication using a Bearer token
However: there's no example how to obtain a SSO or Oauth token from the possible authentication providers (vSphere / vRA). The one example found in the documentation is using a old Java based example which just "magicly" get's a valid token out of nowhere and passes it to vRO.
Now with vSphere 6.5 it's ridiculously simple to use the new CIS REST API to get a session token (/rest/com/vmware/cis/session) which then can be passed on every call to the vSphere REST API using a vmware-api-session-id cookie header. This is great and we get a valid vSphere session but unfortunately vRO can't handle that authentication type (yet, I guess).
So, my question would be: is CIS yet complatible with any vRO authentication mechanism? If so: how should a call to the vRO REST API look like once I have my CIS session token?
If not: what's the recommanded method to authenticate against the REST API (given: vRO 7.3, VCSA 6.5U1 and "vSphere" authentication provider configured in vRO).
list of mounted datastore
Hi,
How can I (with the vmware orchestrator) query datastores which are mounted form specific host?
same datastore can be unmount in other host in the same datacenter.
I attached a print screen.
Thanks!
Where to find the meaning of syntax error codes in vRO 7 IDE.
I am working on a vRO script and the IDE keep complaining about various syntax errors, e.g. "syntax error (script#7)". Where do I find the reference for all of these errors? I have looked in "vrealize_orchestrator_coding_design_guide.pdf" (MARCH 2016, VERSION 1.0), "vrealize_orchestrator_plug-in_development_guide.pdf" (DECEMBER 2016, VERSION 1.0), "vrealize-orchestrator-73-developers-guide.pdf" and "vrealize-orchestrator-73-develop-web-services-guide.pdf" and didn't find anything.
Java and Powershell
Im trying to execute a powershell script from a Scriptable task and passing input parameters as variable into my script for execution. I have posted the information below, I have no clue on this one. Any help would be appreciated.
My script is like this:
var session = PSHost.openSession()
// ------------------------
session.addCommandFromString("c:\\PowerShell\\ServerConfig.ps1 -IP ivo")
session.addCommandFromString("c:\\PowerShell\\ServerConfig.ps1 -Mask ivo")
session.addCommandFromString("c:\\PowerShell\\ServerConfig.ps1 -Gateway ivo")
session.addCommandFromString("c:\\PowerShell\\ServerConfig.ps1 -name ivo")
session.addCommandFromString("c:\\PowerShell\\ServerConfig.ps1 -username ivo")
//----------------------------
var cmd = session.addCommandFromString("c:\\PowerShell\\ServerConfig.ps1")
cmd.addParameter('IP');
cmd.addParameter('Mask');
cmd.addParameter('Gateway');
cmd.addParameter('name');
cmd.addParameter('username');
//----------------------------
res = session.invokePipeline();
System.error(res.getErrors());
System.log(res.getHostOutput());
PSHost.closeSession(session);
Here is my visual binding
Here is the error im getting when I get to this step:
[2017-10-03 12:25:19.569] [E] Error in (Workflow:Server Build Test / Scriptable task (item3)#9) java.lang.NullPointerException
[2017-10-03 12:25:19.579] [E] Workflow execution stack:
***
item: 'Server Build Test/item3', state: 'failed', business state: 'null', exception: 'java.lang.NullPointerException (Workflow:Server Build Test / Scriptable task (item3)#9)'
workflow: 'Server Build Test' (72804cdd-160b-4044-a23f-9934d1be193f)
| 'attribute': name=vmFolder type=VC:VmFolder value=dunes://service.dunes.ch/CustomSDKObject?id='tr01vpsvcntr002%2Cid:group-v517104'&dunesName='VC:VmFolder'
| 'attribute': name=powerOn type=boolean value=true
| 'attribute': name=template type=boolean value=false
| 'attribute': name=datastore type=VC:Datastore value=dunes://service.dunes.ch/CustomSDKObject?id='tr01vpsvcntr002%2Cid:datastore-467241'&dunesName='VC:Datastore'
| 'attribute': name=host type=VC:HostSystem value=dunes://service.dunes.ch/CustomSDKObject?id='tr01vpsvcntr002%2Cid:host-322517'&dunesName='VC:HostSystem'
| 'attribute': name=pool type=VC:ResourcePool value=dunes://service.dunes.ch/CustomSDKObject?id='tr01vpsvcntr002%2Cid:resgroup-320564'&dunesName='VC:ResourcePool'
| 'attribute': name=thinProvision type=boolean value=false
| 'attribute': name=vm type=VC:VirtualMachine value=dunes://service.dunes.ch/CustomSDKObject?id='tr01vpsvcntr002%2Cid:vm-519330'&dunesName='VC:VirtualMachine'
| 'attribute': name=ADOU type=AD:OrganizationalUnit value=dunes://service.dunes.ch/CustomSDKObject?id='%23_v2_%23%2C%23OU%23%2C%234506f67e-1d33-4e35-a5af-510ea148b5cb%23%2C%23OU%3DVR%20Orchestrator%2COU%3DUSFS%20Servers%2CDC%3Dshoremortgage%2CDC%3Dcom%23'&dunesName='AD:OrganizationalUnit'
| 'attribute': name=Domain type=string value=shoremortgage.com
| 'attribute': name=PSHost type=PowerShell:PowerShellHost value=dunes://service.dunes.ch/CustomSDKObject?id='407d66be-5db4-41c8-8fa6-94609e3fb5c4'&dunesName='PowerShell:PowerShellHost'
| 'input': name=name type=string value=vrotest004
| 'input': name=IP type=string value=10.8.6.100
| 'input': name=Mask type=string value=255.255.255.0
| 'input': name=Gateway type=string value=10.8.6.1
| 'input': name=username type=string value=myuseraccount
| 'output': name=newComputer type=AD:ComputerAD value=dunes://service.dunes.ch/CustomSDKObject?id='%23_v2_%23%2C%23Computer%23%2C%234506f67e-1d33-4e35-a5af-510ea148b5cb%23%2C%23CN%3Dvrotest004%2COU%3DVR%20Orchestrator%2COU%3DUSFS%20Servers%2CDC%3Dshoremortgage%2CDC%3Dcom%23'&dunesName='AD:ComputerAD'
*** End of execution stack.
Problem with Method restOperation.createRequest encoding.
I am having a problem with the Method restOperation.createRequest. I created an action to make a query to the Storage Array Isilon. It is working fine when the folder that I am querying doesn't contain any spaces, if the folder contain a space the method converts the space to a "+" sign and the method does not found the folder and gives me and 404 error.
If I use the function encodeURI to convert the spaces into %20 before call restOperation.createRequest , the Method convert the "%20" to "%2520".
Here is the vRO System log:
Any help will be very appreciated.
[2017-01-17 12:41:02.097] [I] CETAD\CETAD04\
[2017-01-17 12:41:02.101] [I] O resultado do newDirPath na criação do diretório é: /ifs/DCPARMAZNA1/ZONECORP/Arquivos/CETAD/CETAD04/VPLEX e RP
[2017-01-17 12:41:02.106] [I] ISILON DTC
[2017-01-17 12:41:02.108] [I] GET Quota Operation by path
[2017-01-17 12:41:02.109] [I] /ifs/DCPARMAZNA1/ZONECORP/Arquivos/CETAD/CETAD04/VPLEX%20e%20RP
[2017-01-17 12:41:02.110] [I] Request: DynamicWrapper (Instance) : [RESTRequest]-[class com.vmware.o11n.plugin.rest.Request] -- VALUE : com.vmware.o11n.plugin.rest.Request@429d94cb
[2017-01-17 12:41:02.111] [I] Request URL: https://customerisilon.com:8080/platform/1/quota/quotas?query&path=%2Fifs%2FDCPARMAZNA1%2FZONECORP%2FArquivos%2FCETAD%2FCETAD04%2FVPLEX%2520e%2520RP
[2017-01-17 12:41:02.326] [I] Response: DynamicWrapper (Instance) : [RESTResponse]-[class com.vmware.o11n.plugin.rest.Response] -- VALUE : com.vmware.o11n.plugin.rest.Response@1f290f0c
[2017-01-17 12:41:02.328] [I] Status code: 404
[2017-01-17 12:41:02.329] [I] Content as string:
{
"errors" :
[
{
"code" : "AEC_NOT_FOUND",
"message" : "Path not found '/ifs/DCPARMAZNA1/ZONECORP/Arquivos/CETAD/CETAD04/VPLEX%20e%20RP'"
}
]
}
[2017-01-17 12:41:02.330] [E] Error in (Dynamic Script Module name : findQuotaHardSubdirectory#55) TypeError: Cannot read property "0" from undefined
[2017-01-17 12:41:02.339] [E] Workfow execution stack:
item: 'Find Quota Hard Subdirectory/item1', state: 'failed', business state: 'null', exception: 'TypeError: Cannot read property "0" from undefined (Dynamic Script Module name : findQuotaHardSubdirectory#55)'
workflow: 'Find Quota Hard Subdirectory' (3ebf23df-cce1-4d7e-9974-e128e42baaef)
| 'input': name=subtenantName type=string value=\arquivos.caixa\CETAD\CETAD04\
| 'input': name=subDirName type=string value=VPLEX e RP
| 'output': name=actionResult type=string value=null
| 'no attributes'
*** End of execution stack.
HTTPS REST Plug in encoding special characters VRO 7.3
I am running VRO 7.3 with HTTPS-REST Plug-in 2.2.2. Apparently this issue was/is fixed in the latest VRO.
This is what the release note says:
The REST API client does not encode and decode space characters correctly.
- When querying scripting actions by their fully qualified names with the REST API client, the space characters are incorrecly encoded as
%2B
or a plus (+
) character. As a result, the request fails with anScript module not found
error message.
But I am still having this issue.
I have two workflows.
1. Authenticating the user so that I get a token to make my REST API calls
2. Using my token to perform other API calls like search for a IP address.
Here is the log that contains my current issue from the 2nd workflow:
This is what the original token looks like:
Here is the javascript. I am pretty sure that the attribute fullUrl is encoding my token to that "%253D%253D" which obviously invalidates the token.
-The only workaround I've found was to hardcode it to the restOperation template, but that defeats the purpose since tokens expire.
Do you guys happen to have a workaround or something?
Any help will be greatly appreciated!
OOTB - Destroy A Computer
As part of my retirement process, I want to remove the VM from AD. I created a WF with a scriptable task in which I pass the VM name and convert it to an AD:ComputerAD object and attempt to pass that variable to the OOTB Destroy a Computer WF.
The script is pretty simple.
var machine = payload.get("machine") ;
var vCACVmProperties = machine.get("properties") ;
var vm = machine.get("name");
computer = ActiveDirectory.getComputerADRecursively(vm);
System.log("Computer count: "+computer.length);
for each (pc in computer){
System.log("Checking computer: "+pc.name);
if (vm.toLowerCase() == pc.name.toLowerCase()){
System.log("Found Computer: "+pc.name);
}
}
When the WF is executed I end up with a Bad Syntax 'Array" error.
[2017-10-05 08:28:28.089] [I] Computer count: 1
[2017-10-05 08:28:28.090] [I] Checking computer: XXXX
[2017-10-05 08:28:28.091] [I] Found Computer: XXXX
[2017-10-05 08:28:28.092] [I] Computer Object: DynamicWrapper (Instance) : [AD_Computer]-[class ch.dunes.ad.object.Computer] -- VALUE : #_v2_#,#Computer#,#012827d2-77fb-435f-bf6e-8fff3fcf4e76#,#CN=XXXX,OU=XXXX,OU=XXXX,OU=XXXX,DC=XXXX,DC=XXXX#
[2017-10-05 08:28:28.093] [I] Retiring: XXXX
[2017-10-05 08:28:28.095] [E] Workflow:Retire Server v2 / Scriptable task (item1) : ch.dunes.model.type.ConvertorException: Unable to convert object, '[Ljava.lang.Object;@7a9c14c9' plugin unexcepted exception : Bad type syntax 'Array'
[2017-10-05 08:28:28.122] [E] Workflow execution stack:
***
item: 'Retire Server v2/item1', state: 'failed', business state: 'null', exception: 'Unable to convert object, '[Ljava.lang.Object;@7a9c14c9' plugin unexcepted exception : Bad type syntax 'Array''
workflow: 'Retire Server v2' (98ada173-7bf4-485f-aeb0-5a893c34eef4)
| 'attribute': name=computer type=AD:ComputerAD value=__NULL__
Has anyone experienced this error before?
vAPI Plugin - "This method requires authentication" error
Hi
I have previously used the vAPI Plugin to do vCenter tags (properly against a vCenter 6.0) at one of my customers.
Now at another customer I am having issues with the vAPI Plugin and authentication.
I am running:
vRO 7.3.0.5481809 (Embedded in vRA 7.3)
vCenter Server 6.5.0.5973321
vAPI Plugin 7.4.0.5546687 (from here: Technical Preview version of VMware vRealize Orchestrator plug-in for vAPI))
I have added the vAPI Endpoint and vAPI Metamodel, and the objects are shown in the Inventory.
I can see all the scripting classes and methods related to vAPI in the API Explorer"List all tagging categories" I get the following error:
com.vmware.vapi.std.errors.unauthenticated => {data=<unset>, messages=[com.vmware.vapi.std.localizable_message => {args=[], default_message=This method requires authentication., id=vapi.method.authentication.required}]} (Workflow:List all tagging categories / Scriptable task (item1)#7)
If I duplicate the "List all tagging categories" workflow, and modify it, so that the line:
var client = endpoint.client();
Becomes:
var client = endpoint.client(myUsername, myPassowrd);
The workflow works.
So it seems as if the "session" created when adding the vAPI Endpoint / vAPI Metamodel, is not stored or at least not used.
Any way to get this to work properly, so I don't have to pass the username and password, to every workflow that needs to use the vAPI Plugin?
Import workflow via REST API
I'm trying to come up with a solution to do branching for vRO development so we can stop stomping all over our workflows. There isn't any native functionality in vRO to do this, nor does it seem there ever will be.
How can I import a workflow via the REST API? My thought is to pull a workflow via REST from the developer vRO instance, pull the gold vRO workflow, upload them both to a staging vRO server, putting the gold one in as version 0.0.1 and the dev version in as 0.0.2 so we can use native vRO diff functionality to allow the developer to resolve any issues that may have been pushed into Gold by another developer. I can easily download one and hit the upload URL, but I don't see any documentation around how i can modify the version, name, or destination folder.
Alternatively if someone has a great way to do branching to prevent a bunch of vRO developers stomping on each other, i'm all ears.
Editor Question
The vRO editor leaves something to be desired. I have some scripting that does not require any input from vRA and I would like to test it. I like seeing the console pane of powershell ise. Does anything exist that would let me do something similar with vRO scripts?
enable DRS rule
Hi,
With vmware orchestrator, how can I enable a specific DRS rule?
Thanks!
Actions in presentation layer
I have several workflows that have a number of drop down menu selections on the presentation layer that are populated based on selections for other menus (eg. Selecting a customer from one menu will populate the next with all the VMs in that customers folder). However, I am finding that I am having to repeat lots of script in the actions attached to these menu items or in the workflow itself.
For example, when selecting a VM from the menu mentioned previously the action I have attached to it will return an array of all VM objects and then push the name property from each into another array and then return this as an array of strings to create the drop down menu. When the workflow starts I then have to convert the string back into a VM object in order to work with the VM. Given that I already created the array of VM objects, is there any way to reuse it when created in the presentation layer? Can I pass that array of objects to another parameter on the presentation layer for manipulation by another action?
Thanks,
Chris.
Passing token as query parameter to REST Host
I'm attempting to pass a token as a query parameter in my POST call. I am not able to get vRO to interpret my query parameter I have configured in my REST Operation call.
Note: I cannot pass the authentication token as a header, as the only allowed headers by this REST API are: Origin, X-Requested-With, Content-Type, Accept
I created the REST Operation as follows that is giving me the error: POST "https://pronghorn.internal/getNetworkStats?token={{token}}"
FYI: Pronghorn (by itential) is the REST Host I am working with.
I am hoping this is simply a syntax issue. I have yet to figure out the proper syntax to make this work however.
My REST Operation is: https:/pronghorn.internal/getNetworkStats?token="{{token}}"
My error log shows the Request URL as: https:/pronghorn.internal/getNetworkStats?token="}" with a message of "Illegal character in query at index xx.
I have attempted single brackets which errors out with a message token must be passed as a query parameter.
Here is the flow of my workflows as an FYI:
My workflow is as follows: (Using JSON with headers set appropriately)
Get Token Workflow:
- Capture username and password from input and format into json string.
- Pass credentials to REST Operation Workflow of "POST 'https://pronghorn.internal/login"
- Parse response as output attribute called 'token'
Call to Get Network Stats Workflow:
- Capture network input from user and format into json string (body).
- Pass json string (body) and token to execute REST Operation Workflow of POST "https://pronghorn.internal/getNetworkStats?token={{token}}"
- Parse response and display network stats
This attempt fails on attempting the POST.
I have logging enable to verify the steps along the way.
The Request URL shows as: https:/pronghorn.internal/getNetworkStats?token="}" with a message of "Illegal character in query at index xx.
Any help would be greatly appreciated. I've been banging my head against the wall on this for a while!
Thanks,
Jerry
Using Guest Script Manager Package
Hi All,
I have some issues while retrieving variables specified in a script, using the Guest Script Manager Package.
Example of my script:
Bash:
myVar = "Hello World"
echo $myVar
When I execute the "Run in Script VM Guest", I noticed that the $myVar is empty/null
Any idea how can I retrieve this variable in the script?
vRA support for Azure Managed Disks
It doesn't appear that managed disks are currently supported through the Azure plugin. Does anyone know if this is on the roadmap? Thanks.
Change to 64bit application when using start program in guest
I am trying to figure out how to get VRO to run the 64 bit version of a program versus the 32 bit. When I have UAC on and try to run powershell.exe from c:\windows\system32\windowspowershell\v1.0\powershell.exe it defaults to running the syswow64 version instead. From there I can't seem to get it to run the system 32 bit version. I have tried specifying the sysnative folder but still have had no success.
Changing lease based on the custom property as soon as end user place a catalog request in VRA 7 with EBS
I have a requirement to set the initial lease based on the custom property such as if company.custom.env= prod { set __Cafe.Request.VM.LeaseDays = 365} else if company.custom.env= eng { set __Cafe.Request.VM.LeaseDays = 65}
But i got stuck in updating this hidden properties run time , Please let me know if you have some idea to update a hidden property using vRO workflow
#vRAVmProperties.get("__Cafe.Request.VM.LeaseDays")