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

Cannot call method "getAllVmFolders" of null

$
0
0

Hello All,

 

I have a vRO action generates a dynamic dropdown list using a script I found here:  http://2vsteaks.com/use-dynamic-populated-drop-list-vra-7-default-iaas-blueprints/.  Using these instructions, I created the vRO action without issue and then set up a property definition in my vRA blueprint to point to that action.  When I try to run the blueprint, though, I get the following error:

 

Unable to refresh request form from the server

Unable to start action 'com.vmware.util/displayTemplatesFromFolderId'. Reason 'Action 'displayTemplatesFromFolderId' in module 'com.vmware.util' failed : TypeError: Cannot call method "getAllVmFolders" of null (unnamed script#4)'.

 

I am using not sure where to go at this point to troubleshoot the issue.  Can anyone offer any assistance?  I have attached relevant portion of the /var/log/vco/app-server/server.log file.

 

Thanks,

Ann

↧

Internal Error: Channel is not opened when using session.executecommand

$
0
0

Hi,

I am intermittently getting InternalError: channel is not opened when I am using SSHSession.executecommand.

I am establishing a connection using 

var session = new SSHSession(ServerName, username);

var connect = session.connectWithIdentity("../conf/server_key");

 

And then executing multiple commands using session.executeCommand. It was working fine in my development envrionment without any issues. But as soon as I promoted my code to UAT environment, I am getting failures intermittently due to above mentioned error.

Also, error doesn't come on a specific command, sometime it comes while executing first command itself, sometime it executes few commands and then occurs in between. 

 

I have make sure in my workflow (at every possible place i.e. end of script of whenever any exception is thrown out etc) that I am closing the session before I finish my workflow. Not sure what else is causing this.

 

Any idea, thoughts on this? Really appriciate your responses.

 

Sushant

 

var session = new SSHSession(gpfsServerName, username);
        var connect = session.connectWithIdentity("../conf/gpfs_key");
        //var connect = session.connectWithPassword("abcd1234");
↧
↧

vRO + Get-Tag issue

$
0
0

Hey guys,

 

I havnt been able to find an answer to this question so i thought i would see if anyone here has tried this before. I am currently trying to get an action going to do dynamic input off a script i am writing. When i run this script on the PS server itself it does exactly what i would like it to do, that is display all the names only under the get-tag command. Whats odd is that when i set an script in vRO to launch an external script it always errors out on the Get-Tag command saying " Get-Tag      Value cannot be null.". To trouble shoot my issue I have been doing some log sending on the PS side to see what the variable looks like when it gets sent from vRO, and to me it looks normal. I have tried various combinations to get it to stop with this error but at the end i cant seem to get past it. It is basically the same issue this person is experiencing https://communities.vmware.com/thread/509103?start=0&tstart=0 but with no answers. The goal is to have an action that queries for all the user names in presentation mode and after the user selects the name it would than set the tag for that VM created. Thanks guys for your help with this!! I am also using vRO 7.2 with the latest PowerCli.

 

Error:

(com.vmware.library.powershell/invokeScript) Error in (Dynamic Script Module name : invokeScript#14) PowerShellInvocationError: Errors found while executing script

VMware.VimAutomation.Sdk.Types.V1.ErrorHandling.VimException.VimException: 11/29/2016 12:29:04 PM   Get-Tag      Value cannot be null.

Parameter name: collection    ---> System.ArgumentNullException: Value cannot be null.

Parameter name: collection

   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)

   at VMware.VimAutomation.ViCore.Impl.V1.Service.ViCoreObjectInteropCoreServiceProviderImpl.GetObn(IList`1 connectionIdList, IList`1 objectNameList, IList`1 objectInterfaceTypeList, IList`1 contextList)

   at VMware.VimAutomation.Sdk.Impl.V1.CoreServiceImpl.GetObn(IList`1 connectionIdList, IList`1 objectNameList, IList`1 objectInterfaceTypeList, IList`1 contextList, String contextRelationName)

   at VMware.VimAutomation.Sdk.Util10Ps.BaseCmdlet.ObnSelector.GetObjectsByNameCore(PropertyInfo parameter, String objectName)

   at VMware.VimAutomation.Sdk.Util10Ps.BaseCmdlet.ObnSelector.SelectObjectByNameCore(PropertyInfo parameter, String objectName)

   at VMware.VimAutomation.Sdk.Util10Ps.BaseCmdlet.ObnSelector.SelectObjectByName(PropertyInfo parameter)

   at VMware.VimAutomation.Sdk.Util10Ps.BaseCmdlet.ObnSelector.SelectObjectsByName()

   at VMware.VimAutomation.Sdk.Util10Ps.BaseCmdlet.BaseCmdlet.ProcessRecordErrorHandled()

   at VMware.VimAutomation.ViCore.Util10Ps.BaseCmdlet.BaseCmdlet.ProcessRecordErrorHandled()

   --- End of inner exception stack trace ---

   at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord)

 

Snippet of my powercli script:

 

param(

$TagType

)

 

$tag = [String]$TagType

$tag | Out-File D:\Scripts\Logs\tags.txt -Append

if($tag -ne $null){

$TagName = New-Object System.Collections.ArrayList

$TagArray = Get-Tag -Category $tag | select -ExpandProperty Name | ? {$_}

    foreach ($IndTag in $TagArray) {

 

 

    $TagName.Add($IndTag)

    }

}

 

Snippet of the vRO script:

 

try{

  session = PSHost.openSession();

  System.log(session);

 

  var arguments = TagType; <---- This is just an input string using the word Owner

  System.log(arguments);

 

 

  var script =  '& "' + ScriptPath + '" ' + arguments;

  System.log(script);

 

  Output = System.getModule("com.vmware.library.powershell").invokeScript(PSHost,script,session.getSessionId());

 

On the log side of the PS server this is what it appends to a txt file for me:

 

Owner

utlvcend

utlvcenp

utlvcenp

↧

Unable to import Custom Hostname workflow from Sid Smith

$
0
0

Running a new vRO 7.2 appliance and tried to import this workflow.  I have imported it in the past with no issue however now I am getting an invalid workflow error.  Has anyone seen this / have a work around?

 

Thanks

↧

vra7.0 embedded vco? And a Chef workflow error.

$
0
0

I have built out a medium environment using the embedded vco. When i log into the VRA appliance and look at the registered services i see multiple vco  com.vmware.vco.o11n  services and (7) and of the services only 5  have the status of registered. I am new to vra and really do not understand why i have so many vco services and then to have 2 services not registered is a bit concerning. Especially when i have the Chef plug in that is not working correctly with this error "403 Forbidden (Workflow:Create / Update Property Group / create property group (item1)#52)" when i try to run this workflow " Create Property Group for Chef EBS Workflows"   I have other Chef work flows that complete correctly and a IPAM solution that also works as designed. Hopping that someone can push me in the correct direction to get this resolved. Not sure if the first issue is connected to the Chef issue. Thanks

↧
↧

Remove Computer Object from AD Group

$
0
0

Hi Guys,

 

We use AD Groups to manage SCCM Patching and Reboot windows, and I need to write a workflow to remove an AD Computer objectfrom a particular AD group as part of a wider workflow.  Seems simple enough, but i'm having an issue with it.  I have 2 inputs:


computerGroup - Type: AD:UserGroup

computer - Type: AD:ComputerAD

 

I'm trying to use the removeElements method of the AD:UserGroup object:

 

computerGroup.removeElements(computer);

 

but am seeing an error:

 

rror in (Workflow:Remove computer from groups / Remove members (item0)#7) Cannot convert #_v2_#,#Computer#,#6cc0881b-5a46-48a1-8038-a1be10e7f46c#,#CN=<REMOVED>,OU=<REMOVED>,OU=<REMOVED>,DC=net,DC=<REMOVED>,DC=<REMOVED>,DC=<REMOVED># to ch.dunes.ad.object.interfaces.IADBase[]

[2016-11-30 13:43:40.562] [E] Workfow execution stack:

***

 

I use a very similar script to remove user objects from AD groups without any issues.  I can return allAttributes of the computerGroup object, and enumerate it's members etc.

 

Any ideas?


Thanks,


Dan

↧

vRO vCenter 6 Tagging plug-in

$
0
0

Overview

This is a plug-in to handle vCenter tags.

It works with leveraging vCenter 6 vAPI. vCenter 6 is the first vCenter version providing a public API for tagging. Earlier versions only supported PowerCLI commandlets or private APIs (that James reverse engineered here : Native vRO vCenter Tagging - No Powershell).

 

See the video to see what it can do.

 

 

The plug-in was generated using the Dynamic Types plug-in generator package (check latest version in Flowgrab "All versions") and can be extended with it.

It can be used with vRealize Automation "Anything as a service" (For example attaching a tag to an object that would enable a given service).

 

Known limitations

The workflows are not checking if you attach a particular object type to a tag that has a parent category not supporting it.

The install workflow may fail to delete the resource element that were imported. It is not affecting the plug-in functionality but may affect a future upgrade. I have a bug opened about this with engineering. You can delete these resource elements with renaming them in the vCO client and deleting them.

 

I only tested it with vRO 6 + vCenter 6 (since vCenter 6 is required and since passing vCenter objects to the plug-in is likely a requirement if you need to tag vCenter objects).

 

Use at your own risk. I made this as a first step to learn how to use vAPI and provide native vCenter tag orchestration.

Download and installation instructions

The plug-in can be downloaded from Sample Exchange

↧

vRO 7.1 - Inventory vCenter Server displays ( incorrect ) Version of 6.5

$
0
0

We have been using vCenter 6.0 and vRO 7.1 for a few weeks now. I don't recall what it stated when the configuration was originally made but when I look at vCenter Server > General Tab it's showing 6.5.0 as the Version.

 

Anyone else confirm their vCenter 6.0 with vRO 7.1 is showing 6.5 rather than 6.0 ?

 

 

Thanks.

↧

Remove Network Adapter Workflow

$
0
0

Hello,

 

I am using vra 7.0.1 and Orchestrator 7. I want to learn something.

 

I provisioned machine from VRA Catalog. This machine has 2 Network adapter. I want to remove Second network adapter after machine provisioned. I could not find a workflow associated with it.

 

Is it possible to make this workflow ? Is there any sample about this ?

 

Thanks.

↧
↧

Manipulating Host Syslog with vRO

$
0
0

Hello everyone,

 

I'm currently working on a vRO Workflow to set new Syslog servers on every host.

This manipulation works fine but I'm not able to figure out how to reload the syslog configuration on the host.

I only found an esxcli command but I want to avoid any actions via SSH.

Any idea how to realize this in vRO?

 

Regards,

Fabian

↧

VDS in clusters

$
0
0

Hello,

 

I would like to retrieve the VDSs of all the clusters configured in 'vSphere Datacenter'.

 

Could someone provide with some JavaScript lines to help me getting started?

 

Thanks a lot,

 

Fred

↧

Timeout issue during Create file from Resource

$
0
0

Hello!

 

I hope you can help me to find the solution related my issue.

 

Details:

     - I have a file (as a Resource) what I would like to copy form the vRO to the guest OS (Windows)

     - filesize is 400kb

     - error message: "java.net.SocketTimeoutException: connect timed out"

 

The code (I have bolded the mentioned section):

// Copy file to VM

System.log("Copying file to " + vm.name + " as " + targetFile);

var fileManager = guestOperationsManager.fileManager;

var attr = new VcGuestFileAttributes();

file = new File(tempLocalFile);

var uri = fileManager.initiateFileTransferToGuest(vm , guestAuth ,targetFile, attr, file.length, true);

   System.log("putFile URI is " + uri);

if (fileManager.putFile(tempLocalFile, uri)) {

    System.log("File successfully created on VM");

} else {

    System.log("Error creating file on VM");

}

 

The timeout is 30sec and I couldn't find any relevant information regarding where can I increase this.

 

My question is that where can I increase this "counter" OR how can I create a script or how can I modify this code for that the OUT will be VC:Task to vim3WaitTaskEnd and not to boolean?

 

Thanks in advance!

↧

BLOG: Securing Your PowerShell Execution and Password in vRO (SKKB1035)

↧
↧

Optimizing results from PS actions

$
0
0

Hey guys,

 

I am wanting to know if this is a normal occurrence or if i need to change my strategy, since this is the first time i have done this any advice is appreciated. I know the speed wont be nearly as fast as running straight JavaScript but there are somethings i may want to select a choice based on running a powercli command. When i start a workflow with something simple as locating a cluster and choosing a host based on cluster selection the presentation box and information is available almost immediately. Where if i run a single action to get-tag information for names only and send that to the presentation screen it can take around 40-60 seconds just to appear. If i had to run several actions that use this script it could be painful (this list is about 50 names long). Is this the correct method of doing things? Am i doing something wrong that would result in much quicker results? Is there a way to cache this data and have it manually pull in increments?

 

One thing to note is that when I run the script before conversion at least on the .getHostOutput() it appears in around 15-20 seconds to the log screen.

 

I know my lack of comments in the code is bad, and i have a lot of logging. Just things i am using to verify the process and it will get cleaned up a lot before use.

 

 

Thanks guys!

↧

Inputs values, properties in presentation

$
0
0

Hello,

 

Anyone has ever tried to do a workflow with input values that the same value could be used over 30 workflows for different purpose, but still I'd like to control the input values.

So far we weren't controlling input values, but I'm trying to do that now, and I was thinking to use a Configuration Element to store my possible value for that input parameter. Is that possible ?

So far I haven't found out how to do that.

 

Thanks!

↧

Seeing this error. Could someone point me in the right direction? Using Guest script manager.

$
0
0

item: 'Run script in VM guest/item13', state: 'failed', business state: 'null', exception: 'Exception binding empty'

 

 

<edited>

 

--workflow: 'Run script in VM guest' (24c23d4c-12be-4889-aa66-29b8a450f1cd)

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

  |  'attribute': name=overwrite type=boolean value=true

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

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

  |  'attribute': name=scriptType type=string value=powershell

  |  'attribute': name=guestOperationsReady type=boolean value=true

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

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

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

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

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

  |  'attribute': name=scriptOutputText type=string value=null

  |  'attribute': name=scriptExitCode type=number value=null

↧

vcHostSystem.configManager.userDirectory returns null

$
0
0

Hi All

 

I am trying to search for a local user on a ESXi Host (VcHostSystem), and would have thought to use .retrieveUserGroups() of VcUserDirectory

 

But I am have trouble just getting the VcUserDirectory object

 

Providing a VcHostSystem as input to the below code, just returns "null"

 

var vcUserDirectory = vcHostSystem.configManager.userDirectory
System.log(vcUserDirectory)

 

Any idea on how to get VcUserDirectory of a VcHostSystem?

 

vCenter Server Appliance 5.5.0 (4180647)

ESXi Host 5.5.0 ((3116895)

vRO Appliance 7.1.0 (4262825)

↧
↧

Unable to properly make an API call to Redhat Satellite 6 via HTTP-REST/Operation Workflow

$
0
0

Hi

 

I am trying to make an API call to the Redhat Satellite 6 API (Forman API) to create a new host entry.

 

URL: https://xx.xx.xx.xx/api/v2/hosts

METHOD: POST

Content-Type: application/json

Accept: application/json

 

I have been using Postman to construct the JSON payload that I have working by sending raw JSON data:

{

  "name": "gs-test01",

  "mac": "00:50:56:a9:4f:d6",

  "hostgroup_id": "13",

  "location_id": "3",

  "organization_id": "1",

  "ptable_id": "107",

  "content_facet_attributes": {

      "content_view_id": "2",

      "lifecycle_environment_id": "2"

  },

  "managed": "true",

  "build": "true"

}

 

I get a response from the API and the host is created.

 

I am now trying to do the same using Orchestrator. I have created the REST host and the REST operation and submit the same JSON data as the 'content' payload but always get this response: (I have reduced the payload to just 3 elements for this test)

 

[2016-12-06 09:46:29.246] [I] Content is: {"name": "gs-test01","mac": "00:50:56:a9:4f:d6","hostgroup_id": "13"}

[2016-12-06 09:46:29.248] [I] Request: DynamicWrapper (Instance) : [RESTRequest]-[class com.vmware.o11n.plugin.rest.Request] -- VALUE : com.vmware.o11n.plugin.rest.Request@4a7c8e73

[2016-12-06 09:46:29.249] [I] Request URL: https://xx.xx.xx.xx/api/v2/hosts

[2016-12-06 09:46:29.418] [I] Response: DynamicWrapper (Instance) : [RESTResponse]-[class com.vmware.o11n.plugin.rest.Response] -- VALUE : com.vmware.o11n.plugin.rest.Response@39cdf59a

[2016-12-06 09:46:29.420] [I] Status code: 404

[2016-12-06 09:46:29.422] [I] Content as string: {"message":"Hostgroup not found by id '13'"}

 

On the Postman request, I changed the hostgroup_id to "99" (which doesn't exist) and it comes back with a response like the above, which is valid because 99 doesn't exist.

 

So I am scratching my head with why when I send the request via Orchestrator that the forman API returns a not found when it does exist.

 

has anyone else had any experience with the above?

 

Thanks,

 

Gavin

↧

how to authenticate for rest api with vCenter 6.5 appliance

$
0
0

Hello,

vCenter Appliance 6.5 has a feature to create a backup that can be restored with the installer gui. To create this backup one must access the appliance portal at port 5480. I would like to automate and schedule that backup. It can be accessed with the API's from the SDK. It must be possible to execute this via REST API. A bash sample is documented:

https://pubs.vmware.com/vsphere-65/index.jsp#com.vmware.vsphere.vcsapg-rest.doc/GUID-222400F3-678E-4028-874F-1F83036D2E85.html

I have tried to authenticate to vCenter to invoke a rest operation from Orchestrator but I have not had any success.

I think that I can't use the right authentication mechanism, when I try to invoke the REST operation i get a 401 error. I have tried the basic authentication and I have looked at using the other mechanisms that are listed when adding a REST host in Orchestrator but can't figure out what to use.

If anyone has earlier connected with vCenter Appliance via REST and could share how to authenticate that information would be greatly appreciated.

↧

org.dojotoolkit.dojo.json serialize

$
0
0

I ran into an issue while migrating our workflow library into vRO 7.1. We have a dependency on a serialize JSON piece of code that seems to have been imported from into one of our previous Orchestrators and adopted for use. When running on vRO 7.1 appliance I get the following:

[E] (org.dojotoolkit.dojo.json/serialize) Error in (Dynamic Script Module name : serialize#82) TypeError: escapeString is not a function, it is undefined.

 

I am not sure if original package installation required any type of activity to enable this function. I know some of javascripts may need further definition in Orchestrator configuration but I can;t find any evidence of that on our original machines. Has anyone faced with this type of error? I would appreciate some help.

 

EDIT: I may have found the issue. I am completely missing another dojo toolkit action for escapeString function. Apparently it is not being pulled into an export package and I was relying on Orchestrator package creation to pull everything that's used in the workflow library. I may have to re-consider my package creation approach.

↧
Viewing all 10285 articles
Browse latest View live