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

Start SSH on ESXi host

$
0
0

Hi Guys,

 

I'm trying to get a scriptable task to start SSH on an ESXi host and its not quite happening. I'll try to explain briefly what I've done so far.

 

So I've created an attribute / array of ESXi hosts and created an input to use the array as predefined objects. Next I have a scriptable task as follows where its going wrong.

 

// Start SSH service on ESXi host
var myVcHostServiceSystem = new VcHostServiceSystem() ;
myVcHostServiceSystem.startService("TSM-SSH")

 

System.log ("Starting SSH service on: " + host.name);

 

This keeps on failing saying

 

Unable to create object : VcHostServiceSystem : com.vmware.vmo.plugin.vi4.model.VimHostServiceSystem

 

Can anybody shed some light?

 

Thanks

 

Mr G


upgrade orchestrator - error invalid credentials

$
0
0

Hi,

 

I have upgraded my Orchestrator from version 5.5 to 7.1

After the upgrade all my connected vCenters entered to status: "Invalid credentials"

 

I try to re-add them without success.

 

any idea?

Export logs and application settings - Error

$
0
0

Hi,

 

I have orchestrator 7.2.0.4629841

 

I try to run Export logs and application settings workflow but I receive the following error:

 

2017-02-12 11:47:10.873] [E] Not a directory

[2017-02-12 11:47:10.890] [E] Workflow execution stack:

***

item: 'Export logs and application settings/item1', state: 'failed', business state: 'null', exception: 'Not a directory'

workflow: 'Export logs and application settings' (A18080808080808080808080808080808080808001231146624761b79546544c2)

|  'attribute': name=zipFileName type=string value=vCO_troubleshooting

|  'input': name=localPath type=Path value="/var/run/vco"

|  'no outputs'

*** End of execution stack.

 

First I ran this workflow with no directory input.

The second try I ran the workflow with directory path: /var/run/vco

 

any idea?

pass powershell results to output variables

$
0
0

Hello,

I wrote a scriptable task that will execute PS (powershell) commands to access my active directory.

to be able to invoke-command from my PS host to my active directory, I must user the credSSP  workflow.

I've created a workflow that running the PS commands with credSSP and I have the results.

my next step that I want to establish and don't know how, is passing the result I got on credSSP  to some output variable, so I can play with this output on next steps.

 

thanks in advanced.

Storing PowerShell Scripts With Input Parameters as Resource Element

$
0
0

I'm trying to find the best way to store my various PowerShell scripts in a single location rather than on each of the PowerShell Hosts' local filesystem. I've been able to create a ResourceElement with the script but if the script has input parameters, how do you pass those in? 

 

For example, resource element has this script contents:

param (    [string] $server
)

return $server

 

And a workflow retrieves the contents of the resource element into say variable named script and then used with invokeScript:

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

 

How do you input the $server parameter?

Right way of creating a vRO plugin

$
0
0

Hi All,

 

As part of our plugin development we have created our workflows using vRO client. Now the question comes is, what's the right way create a vRO plugin out of these workflows so same can be shipped to the customers?

 

The approach we are thinking of so far in this direction is:

 

1. Created a eclipse project for vRO plugin using maven

2. Command that let us import the workflows from vRO appliance. Do we have any such command?

3. Create a plugin using mvn install

 

Please let me know if that's the right approach to create a plugin from workflows and also request you to help with the commands if there are any.

 

Thanks and Regards,

Salil

StringLiteral not a StringLiteral?

$
0
0

So I'm trying to update a vRA Reservation - specifically a Custom Property item in the extension data.

 

I have fetched the vCACCAFEReservation, and it's extension data object (a vCACCAFELiteralMap). In there is an item, say 'AcctNum' which is currently set to '1234' (string I believe) and I wish to set to '0987'.

 

So I remove the item from the extension data:

 

resExtData.remove("AcctNum");

 

This works.

Then I create a new value and place in the extensionData object:

 

var newValue = vCACCAFEStringLiteral.fromString("0987");

resExtData.put("AcctNum",newValue);

 

According to the link above, .put() takes a string Key and a com.vmware.vcac.platform.content.literals.Literal value - which vCACCAFEStringLiteral.fromString() should return.


Then I update the reservation object with the modified extension data:


resObj.setExtensionData(resExtData);


That appears to work.

Then I fetch the needed REST client service object(s) to communicate with vRA:


resClient = vCACCAFEHost.createReservationClient();

resService = resClient.getReservationReservationService();

 

And this all works.

But then, I apply the updated reservation extension data to the live reservation:

 

resService.updateReservation(resObj);

 

And I get an error at that point:

 

Error in (Workflow:ActionDev / Set Reservation Data (item3)#73) Invalid custom property: AcctNum. Supported datatypes are BooleanLiteral, StringLiteral and SecureStringLiteral.

 

The Custom Property exists and I believe I'm using a proper datatype - a StringLiteral. Plus, wouldn't the previous .put() or .setExtensionData() method calls fail if it was not an acceptable format/datatype? So I'm not sure what the issue is.

 

Any help would be appreciated.

Unable to download NSX-v Dynamic Types plug-in V2

$
0
0

Hello, i am trying to download NSX-v Dynamic Types plug-in V2 from flowgrab link but does not work @candenini


NSX-v Dynamic Types plug-in V2

$
0
0

The included plug-in is a solution I have built for providing NSX Network & Security as a Service in vCAC. This is the second edition. The first one was built mostly manually, this one was built with the plug-in generator V2.

The advantages are that this one:

  • Supports multiple NSX hosts
  • Support multiple object levels hierarchy
  • Is a lot more customizable than V1 : you can download the plug-in generator V2 package to add new objects and new methods

 

This plug-in is also a good way to learn more about the Dynamic Types technology. It is possible to extend the plug-in with REST operations that can be found in the NSX API guide.

 

 

Features:

 

Inventory objects:

Screen Shot 2015-03-30 at 12.35.01.png

 

Workflows :

Workflows are contextual to the inventory objects. You can right click on an object to run a workflow.

 

Sample workflows :

Screen Shot 2015-03-30 at 12.36.30.png

Screen Shot 2015-03-30 at 12.36.57.png

 

It can be easily extended with other operations and can use the workflows that are in the NSX plug-in delivered with vCO.

The advantage of using this plug-in is that it you have access to the source of the object definitions, the methods and can customize it at will.

 

 

Requisites:

  • vCO 5.5 U1 build 1617127 or greater
  • Dynamic Types plug-in 1951696 or greater
  • NSX 6.X

 

Download

Since Flowgrab has shutdown, this file is currently attached to this thread until Christophe Posts it to the Sample Exchange

 

Installation / Configuration:

  • Rename the downloaded package com.vmware.coe.plugin.dynamictypes.nsx.v2.package
  • Import the package
  • Run the "Plugin gen -1- Install plug-in" workflow, select the package you renamed
  • Run the "Plugin gen -2- Add new host" workflow. Enter a host URL starting with https:// (and not just the host name or http://. Choose basic authentication - upon validation the "Add a REST host" workflow may expect you to answer an user interaction if you did not imported the certificate before AND if you are running an old version of the HTTP-REST plug-in).
  • After a few minutes you can browse the inventory and right click on objects that have workflows associated with them

 

 

Disclaimers:

Material designed for PoC / educational / testing purposes. Use at your own risk.

registered vcenter marked (unusable) in vrealize orchestrator

$
0
0

Hi Everyone,

 

I am using vCenter 6.5 with external PSC. I try to connect this vCenter server from vRealize Orchestator 7.0.1. I received following message in VRO. "(Unusale) https://vcenter/sdk

 

And Error messages are,  "Axis Fault:; Nested exception is: org.xml.sax.SAXException:  Invalid element in com.vmware.vim.vi3.ServiceContent - vStorageObjectManager"

 

Thanks.

Deleting vRA 7.2 Entitlements from vRO 7.2

$
0
0

A new feature in vRA 7.2 is the ability to delete Entitlements (yaay, finally )

 

What seems to be missing is the ability to delete Entitlements using the vRA plugin in vRO.

 

Fortunately, they can be deleted directly from the vRA API

 

This bit of code can be used to create a vRO action for deleting Entitlements. 

 

I could not find anything on this topic when I searched for it, hoping this can help others

----

// Inputs to Action

// entitlementObject - vCACCAFE:Entitlement

 

//  Derive CAFE Host from Entitlement Object

var cafeHost = vCACCAFEEntitiesFinder.getHostForEntity(entitlementObject);

 

// Get Entitlement ID

var entID = entitlementObject.id

 

// Set API Endpoint and create Rest Client

var endpoint = "com.vmware.csp.core.cafe.catalog.api";

var restClient = cafeHost.createRestClient(endpoint);

 

// Create Resource URL by combining "entitlements" with the Entitlements GUID

resourceUrl = "entitlements/" + entID;

 

// Execute DELETE call

var response = restClient.delete(resourceUrl);

 

//Close REST Client Connection

restClient.close();

----

SNMP Trap Parse

$
0
0

Hello

 

I have a trap coming in from VROPS with no issues

 

I am able to get the trap output in the Logs tab of the workflow

 

But the workflow that accepts the trap is not passing the trapData to the next workflow to Parse it

 

 

 

var snmpResult = SnmpService.retrieveTriggerData(trigger);

var data = System.getModule("com.vmware.library.snmp").processSnmpResult(snmpResult);

trapData = data;

//System.log("Enterprise: " + snmpResult.enterprise);

System.getModule("com.vmware.library.snmp").logResult(trapData);

var wfId = "30c94852-008d-40ee-a31c-ac13e67289a4"

//Function to set variables to pass to workflow and start workflow

//Define variables early or set them here

// function to launch WF

function runWF(wfId,trapData)

{

var workflowToLaunch = Server.getWorkflowWithId(wfId);

if (workflowToLaunch == null)

{

throw "Workflow not found";

}

var workflowParameters = new Properties();

workflowParameters.put(trapData);

System.log("Launching Auto Grow VM Drives Workflow. Please refer to that workflow for specific logs.");

var wfToken = workflowToLaunch.execute(workflowParameters);

return wfToken;

}




I set the parameters like this

Attributes

trigger

device

MessageOID

wfId



Outputs

trapData

 

Looks like the trapData never gets any data

REST start a Workflow with Input-Parameter VC:VirtualMaschine

$
0
0

Hey everybody,

i'm trying to start a workflow via a REST-POST-Call to Start a Virtual Maschine.

I use the HTTP ContentType "text/XML" and call via

 

"https://{vmhost}:{port}/vco/api/workflows/{workflowID}/executions/ 

 

and send the following httpBody:

 

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

<parameters>

<parameter name="vm" type="VC:VirtualMaschine">

<VC:VirtualMaschine>vm04711</VC:VirtualMaschine>

</parameter>

</parameters>

</execution-context> 

 

 

but there are come back a Error-Message

"REST: HTTP POST request failed with error 400 (Bad Request)"

 

I don't know, if there parameters are in the httpBody are correct. The Input-Parameter in the Workflow has the Name "vm"  with the type "VC:VirtualMaschine".

In the Doc http://pubs.vmware.com/orchestrator-70/topic/com.vmware.ICbase/PDF/vrealize-orchestrator-70-develop-web-services-guide.p…

there is an example with string but with an VC:VirtualMaschine-Type, i don't know who are the Syntax is.

 

 

Could someone help me - thanks a lot

 

 

greetings

Configuring a Virtual IP as a PowerShell Host

$
0
0

Hello,
I created a VIP for a pool of two PowerShell hosts using NSX. This VIP should receive PS commands from vRO and pass them on to the actual PS hosts in a round-robin manner. I'm now trying to configure it as a PS host in vRO using the "Add a PowerShell Host" workflow with Kerberos authentication, but it keeps failing with the error "No valid credentials provided (Mechanism level: Server not found in Kerberos database(7))". I validated that the user credentials I used were correct and made sure I could add the actual servers as PS hosts. Also, since the VIP has no computer account in AD, I added several SPNs to the domain user I'm using for adding PS hosts, yet no change occurred.


I'm using vRO 7.1 with PowerShell plugin v1.0.9.3895943.
What am I missing?

 

Thanks in advance.

composite workflow - start existing workflow many times

$
0
0

HI ,

 

i'm working on a workflow that create a AD User and put it into a Group.

 

i need to modify it : i want to create a AD User and put it in MANY  group

 

it is possibile to insert a variable (filed) where i can insert the number of groups in wich my User should be, and the workflow ask me the name on the group many time as indicatad in the field?

 

 

than you


Parsing SNMP Trap

$
0
0

I have this SNMP Trap I am trying to parse

 

I can't seem to parse this one OID

 

Element 11:

=============

oid: 1.3.6.1.4.1.6876.4.5.1.2.9.0

type: String

snmp type: Octet String

value: symptomSet: ced42ef0-c2d2-4f3f-b5a5-c7d05e0b8f16

relation: self

totalObjects: 1

violatingObjects: 1

symptom: Guest file system overall disk space usage reaching immediate limit

active: true

obj.1.name: ACFILES01

obj.1.id: e52951cb-711d-4e8f-8c0c-6bd9e76604b7

obj.1.metric: guestfilesystem|percentage_total

obj.1.info: HT above 90.26897926688159 > 90

symptomSet: 3382b79b-a001-4a1f-af28-7bf1550f1ce8

relation: self

totalObjects: 1

violatingObjects: 1

symptom: Guest file system disk space usage

active: true

obj.1.name: ACFILES01

obj.1.id: e52951cb-711d-4e8f-8c0c-6bd9e76604b7

obj.1.metric: guestfilesystem:G:\|percentage

obj.1.info: HT above 58.29062177498754 > 0

symptom: Guest file system space usage at immediate level

active: true

obj.1.name: ACFILES01

obj.1.id: e52951cb-711d-4e8f-8c0c-6bd9e76604b7

obj.1.metric: guestfilesystem:F:\|percentage

obj.1.info: HT above 90.01059717339952 > 90

symptom: Virtual machine disk space time remaining low

active: true

obj.1.name: ACFILES01

obj.1.id: e52951cb-711d-4e8f-8c0c-6bd9e76604b7

obj.1.metric: diskspace|timeRemaining

obj.1.info: HT below 21 < 60

symptom: Guest file system space usage at critical level

active: true

obj.1.name: ACFILES01

obj.1.id: e52951cb-711d-4e8f-8c0c-6bd9e76604b7

obj.1.metric: guestfilesystem:C:\|percentage

obj.1.info: HT above 95.04038577323296 > 95

symptom: SymptomDefinition-VMWARE-GuestSpaceUsageDTAbove

active: false

obj.1.name: ACFILES01

obj.1.id: e52951cb-711d-4e8f-8c0c-6bd9e76604b7

 

 

I have tried this

 

 

var snmpResult = SnmpService.retrieveTriggerData(trigger);

 

var trapData = System.getModule("com.vmware.library.snmp").processSnmpResult(snmpResult);

 

//trapData = data;

 

//System.log("Enterprise: " + snmpResult.enterprise);

System.getModule("com.vmware.library.snmp").logResult(trapData);

 

var MessageOID = "1.3.6.1.4.1.6876.4.5.1.2.9.0";

var wfId = "ee5f566a-8177-4e00-bf4a-edff97a6f313";

 

// We extract the VM name out of the SNMP TrapData

var SNMPTrap;

for (var x = 0; x < trapData.length; x++) {

var prop = trapData[x];

if (prop.get("oid") == MessageOID) {

SNMPTrap = prop.get("obj.1.metric");

break;

}

}

System.log(SNMPTrap)

 

 

 

 

 

 

ALL I Get is Null but it works on other OIDs

Setting Variable

$
0
0

Hey Guys

I got a JavaScript question

-----------------------------------------------------------------------------------------------------------------

 

if ( psList instanceof Array ){

 

  for (idx in psList){

var item = psList[idx];

System.log( item.getProperty('Drive') );//extract value from result

System.log( item.getProperty('HD') );//extract value from result

 

------------------------------------------------------------------------------------------------------------------


produces this


2017-02-19 01:52:43.953] [I] C:

[2017-02-19 01:52:43.954] [I] Hard disk 1

[2017-02-19 01:52:43.956] [I] G:

[2017-02-19 01:52:43.957] [I] Hard disk 2

[2017-02-19 01:52:43.959] [I] F:

[2017-02-19 01:52:43.960] [I] Hard disk 3


--------------------------------------------------------------------------------------------------------------------


it want to add something like this


for item.getProperty('Drive') that equals variable (driveLetter) set variable diskNr


 

Guest script manager package

$
0
0

- 2016-11-01 - Please note that this package has been relocated to the VMware Sample Exchange due to the recent decommission of FlowGrab.com.

- 2015-03-24 - The package is now hosted on fowgrab to allow communities contributions

 

- Updated 2015-01-05 by Daniel Linsley:

  • Does not break anymore with UAC but UAC may still prevent some scripts to run.
  • Improved sleep for better handling of low script refresh

 

 

Running commands or scripts in VM guest is something that has been done with vCO for quite a while using different mechanisms. A popular way was to use the VIX plug-in for vCO. This plug-in is not needed anymore since the VIX functionality is part of the vCenter API since vCenter 5.0 and there are guest operations workflows to copy a script and run it into a VM guest OS since vCO 5.1

 

Using these library workflows requires to copy scripts from the vCO file system or include the scripts in your workflows. Getting the script output can be tricky and if part of the script include parameters that need to be replaced with your custom workflows inputs it requires a bit more coding.

 

The Guest Script Manager handle all of this for you so you do not have to reinvent the wheel. You can even create specific workflows to run existing scripts without having to do any vCO scripting !

 

Features

 

Script management : Add, edit, delete a script configuration. A script configuration contains:

  • Script type (bash, batch, Powershell) : Each type involve a different way of starting the script and getting the output.
  • Script content: The script itself. May contain parameters that will be replaced right before running the script.
  • Timeout: The time after the script execution is
  • Script interactivity: In case the script open a window that requires user interaction.
  • Script working directory: Where the script will run. Where the optional file will be copied.
  • File to copy: A file to be copied in addition to the script. For example a response file needed for the script.

 

 

The script configurations are stored as resource elements in the vCO database. This means :

  • Updating a script does not require updating a workflow
  • The scripts are in a much safer location compared to the file system
  • If you run a vCO cluster, the scripts are available for every vCO nodes
  • That you can export / import the script configurations in a package

 

The script configuration runner : "Run script in VM guest"

 

  • Search replace specified strings in the additional file, copy it to the guest (optional).
  • Search replace specified strings in the script, run it in the guest.
  • Get output code and output result, display these (including special characters supported by ANSI thanks to the included cmdAnsi.exe), fails the workflow if script failed.

 

There is also a workflow to run multiple scripts one after the other and a workflow to upload your files as resource elements.

 

 

Links

 

 

 

Credits

 

  • Reuben for the original guest Operations package.
  • vCO Engineering to make available guest operations workflows in vCO 5.1
  • Benoit for the included / modified "run script in guest" workflow
  • Pierre Torris for creating cmdAnsi. Donateware on www.ptorris.com
  • Burke / Henrik for testing early releases
  • Daniel Linsley for providing enhancements to the original package



Known issues

 

You must turn off UAC on Windows (2015-01-05) Package updated by Daniel

 

Use the package with the date to get the latest. The other one was kept for people needing the original.

 

Disclaimer: These samples workflows are provided AS IS and are not considered production quality and are not officially supported. Use at your own risk. Feel free to modify and expand and share your contributions.

VRO - AD Plugin - Clone User

$
0
0

Hi

 

i'm trying , without success, to create a workflow that can clone a AD user

 

how i should proceed?

 

i need to set the username (so user should enter firstname and last name)

outuput should be the newly created user

 

thank you for help!

vSphere SRM 6.1.1 API Integration with external Cloud MGMT Portal (CliQR)

$
0
0

Dear All,

 

I have this URGENT need of help on how the SRM API allows connection to the external Cloud MGMT Portal (CMP) such as CliQR from CISCO.

We have an issue with external CMP unable to connect to SRM, even with the appropriate vCenter Certificates export from the vCenter as enlisted in "Site Recovery Manager API Developer’s Guide for VMware Site Recovery Manager 6.1. (attached herewith).

 

The Goal is to have VM's provisioned by CMP to be protected by SRM if they are deployed on to a particular cluster.

 

The Objective achieved so far:-

  • We are able to connect from external CMP to vCenter to deploy workloads to respective Clusters in vCenter.
  • We are also able to perform all other relevant activities on a VM as per the options in the CMP.

 

 

The Issue: Unable to connect to SRM on port 9007 or 9086 from CliQR CMP to execute the VM protection task. As per the API Documentation

 

The SRM Web service listens by default on port 9007. It uses SSL to encrypt communications between a client application and the server. The SSL certificate of the target server must reside on the client machine. To access the Web service programmatically, use its URN from a Web services client application, for example: https://<FQDN.hostname.or.IP.Address>:9007

 

Accessing VMware Site Recovery Manager :    The SRM API provides language‐neutral interfaces to the VMware Site Recovery Manager (SRM) server management framework. Interfaces are provided for managing protection groups and recovery plans. Both array based replication and vSphere Replication are supported. Location of the API The SRM 6.0 API is located at the following endpoint and uses the 9086 listener port: https://<SrmServerName>:9086/vcdr/extapi/sdk.

 

    The port number changed again for this release. Since SRM 5.8 it increased by one integer. All services use this single network port, and all communications are TLS encrypted. SSL v3 is disabled for security reasons. The API is implemented as an industry‐standard Web service running on SRM Server. The API complies with the Web Services Interoperability Organization (WS‐I) Basic Profile 1.0, which includes XML Schema 1.0, SOAP version 1.1, and WSDL version 1.1. For details about WS‐I Basic Profile 1.0, see the http://www.ws‐i.org Web site. You can obtain the WSDL for SRM API by requesting file srm.wsdl from the server root path.  https://<SrmServerName>:9086/srm.wsdl

 

We are getting SAML Token authentication error while trying to connect.

 

Points to be Noted:-

 

  • There is NO Firewall in between the 3 Servers (vCenter, SRM and CMP). They are on the same VLAN.
  • SRM itself is working fine and both Main DC and DR sites are paired.
  • We are able to perform all the activities manually on SRM, (Creation of Protections Group, Recovery Plan, Configure Protection, Remove Protections, Test Recovery, Clean, Actual Recovery, Failover and Failback without any issues.

 

Looking for your expert advice on this issues as we are running out of relevant options to try and get this working.

 

Thanks,

-Yug

Viewing all 10285 articles
Browse latest View live


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