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

Create Transient RESTHost and RESTOperation.


Create REST Host Workflow

$
0
0

Hello,

 

I would like to build a workflow that only creates a REST host and writes it into an output parameter. I have defined the output parameter of type "REST: RESTHost". The log output shows the created REST host. But the output parameter "restHost" with the Type "REST: RESTHost" is empty. I do not want to use the Inventory of the REST plugin. Any Idea? Thanks for help!

 

#### Parameter

Input Paramater: restHostUrl (Type: String)                     -> https://api.test.de

Outut Parameter: restHost (Type: REST:RESTHost)       -> Not found

 

 

 

#### Scriptable Task

// Create REST Host

var restHostTemp = RESTHostManager.createHost("dynamicRequest");

restHost = RESTHostManager.createTransientHostFrom(restHostTemp);

restHost.operationTimeout = 60;

restHost.connectionTimeout = 30;

restHost.hostVerification = false;

restHost.url = restHostUrl;

System.log("REST Host: " + restHost);

 

 

 

#### Workflow Log Output

[2018-02-07 15:24:05.204] [I] REST Host: DynamicWrapper (Instance) : [RESTHost]-[class com.vmware.o11n.plugin.rest.RESTHost] -- VALUE : RESTHost [name=dynamicRequest, id=ffa9623a-7dab-4f65-9381-16a44487cffc, url=https://api.test.de, connectionTimeout=30, operationTimeout=60, hostVerification=false, proxyHost=null, proxyPort=-1, schemaRepo=null, resourceId=null, privateKeyId=null]

Run Scripts in Guest (Guest Script Manager) keeps running on a loop...

$
0
0

Hello,

 

I'm trying to run a powershell script in the guest that uninstalls the App Volumes Agent. When I run it manually outside of my VDI workflow it will run successfully and uninstalls the agent. However when I run it inside of a larger workflow, it seems to run more than once and then produce this error which halts the workflow:

 

Workflow execution stack:

***

item: 'Run script in VM guest/item13', state: 'failed', business state: 'null', exception: 'The guest process 2720 was not found. (Workflow:Kill process in guest / Scriptable task (item1)#8)'

 

When I log into the machine it's clear that app volumes was uninstalled, but for some reason the script re-executed...I'm not sure why it's doing this.

 

Here is the powershell I'm trying to run:

 

$app = Get-WmiObject -Class Win32_Product | Where-Object {

    $_.Name -match "App Volumes Agent"

}

$app.Uninstall();

Restart-Computer;

 

To me the error indicates it's trying to uninstall appvolumes but appvolumes has been uninstalled.

Adding VM to existing DRS rule?

$
0
0

Has anyone successfully modifed an existing DRS rule and added a new VM to a rule?  I can add a new one with a duplicate name, but I cannot seem to modify an existing rule.  If I run the following it does nothing to the DRS rule.

var antiaffinitySpec = new VcClusterAntiAffinityRuleSpec()
antiaffinitySpec.enabled = true
antiaffinitySpec.name = rulename
antiaffinitySpec.userCreated = true
antiaffinitySpec.vm = groupArray

var clusterRuleSpec = new Array(new VcClusterRuleSpec());
clusterRuleSpec[0] = new VcClusterRuleSpec()

// If I change this to VcArrayUpdateOperation.add it will add a rule with a duplicate name
clusterRuleSpec[0].operation = VcArrayUpdateOperation.edit;
clusterRuleSpec[0].info = antiaffinitySpec;

var clusterConfigSpec = new VcClusterConfigSpecEx();
clusterConfigSpec.rulesSpec = clusterRuleSpec;

att_task = cluster.reconfigureComputeResource_Task(clusterConfigSpec, true);

var affinitySpec = new VcClusterAntiAffinityRuleSpec()
affinitySpec.enabled = true
affinitySpec.name = rulename
affinitySpec.userCreated = true
affinitySpec.vm = groupArray
 
var clusterRuleSpec = new Array(new VcClusterRuleSpec());
clusterRuleSpec[0] = new VcClusterRuleSpec()
clusterRuleSpec[0].operation = VcArrayUpdateOperation.remove;
clusterRuleSpec[0].info = affinitySpec;
 
var clusterConfigSpec = new VcClusterConfigSpecEx();
clusterConfigSpec.rulesSpec = clusterRuleSpec;
//clusterConfigSpec.groupSpec =clusterGroupSpec;
 
//clusterConfigSpec.groupSpec[0].operation = VcArrayUpdateOperation.edit
 
att_task = cluster.reconfigureComputeResource_Task(clusterConfigSpec, true);

can I use Attributes of type ManageObject to store vswitch and portgroups specs?

$
0
0

Hello

I want to configure stadard portgroups ans vswitchs with VRO

for this the idea is to predefine the specs in configuration elements and attributes

 

as I have seen, those types of objects (for exemple VcHostVirtuaSwitchSpec) does not exist on the attributes types

 

my question is, can I use ManageObject type? if yes How can I affect an object of type VcHostVirtuaSwitchSpec to an attribute of type ManagedObject

 

or is it only possible to use attribute of type Any (but in this case I can not check if the object is not properly defined )

 

what is best practices for this need?

Error 1034

$
0
0

When running one of my workflows in the webclient the workflow does what it should but the webclient throws "Error 1034" (on vCenter and Orchestrator 5.5).

 

I've searched the Internet and even if some VMware related sites suggest that the problem might be disk space, or the lack of it. (That is not the case here as we have several hundred GB of free space.) Other sites says it is related to Flex, but I haven't found any solution to this problem.

 

Anyone else who have experienced this?

debugging, developing script blocks within vRO

$
0
0

I'm a scripter who has used other languages. How does a person develop / test, debug and validate script blocks that get put into script blocks. I'm still on the newbie side of vRO, but have written scripts in javascript, vbscript, powershell, some batch files etc.. This is a different thing.


When writing scripts, I try to write little "blocks of script" to ensure syntax is correct, debugged before making them more complex.  Is there a step by step feature like other tools?

vRA 7 multi machine blueprint get hostname IP details of Other VMs in deployment in blocking event

$
0
0

Hi

 

I have 3 tier blueprint and in last VM i am running machine provisioning event workflow. here i am getting vCACCAFE:CatalogResource of vm. After this i get its parent (which is deployment) and then its all child and then their hostname, ip. only issue is vCACCAFE:CatalogResource is only created when request is successful. if i create blocking event, vCACCAFE:CatalogResource can not be retrieved. So blocking events keeps request in progress state.

 

I tried to get other VM details from requestId as well, through below rest APIs. but in blocking event this rest api's also do not return information about other VMs. after vra request is successful, it returns all values. so question is how can i get other vm information even when request is in progress.

 

var client = vcachost.createCatalogClient();

 

var response = client.get("/consumer/requests/" + req.id + "/resources")

var response = client.get("/consumer/requests/" + req.id + "/resourceview")

var response = client.get("/consumer/requests/" + req.id )


Automating the creation of reservation

$
0
0

I am trying to automate my work of creating reservations.  I am leveraging the vco plug-in from flow grab (here) to do the basic creation of reservations.  With the plug-in i am able to create the base reservation, add the storage to the reservation and add the network mappings to the reservation.  I am missing just a few items i have been trying to create my own workflow with no progress to add the reservation policy.  Also, as a smaller item i need to setup the alerting tab.  How do i set the reservation policy for a reservation.

 

I am doing this as a small step of a greater workflow i am creating to create the entire business group in an automated fashion.

 

Steps in my busniess group creation master workflow:

  1. normalize business group name
  2. create ad groups for group manger and users
  3. create business group
  4. open helpdesk tickets to mail enable active directory groups.==aSync-Process==
  5. assign ad groups and email to business group
  6. create separate entitlements for Linux and Windows devices
  7. add actions and blueprint to entitlements.
  8. create reservation for each data center  ==> flow grab workflow
  9. assign storage to each reservation  ==> flow grab workflow
  10. assign networks appropriate to the data center  ==> flow grab workflow
  11. assign reservation policy to the reservation  -----  This is where i am stuck  ------
  12. Create custom group in vrops for the business group based on tags assign to requested machines.
  13. Send managers cheat sheet to Group managers
  14. Send users cheat sheet to the users

Create / update property on virtualMachine Entity - vCO Help

$
0
0

I'm trying to update a Custom property of a vCAC-provisioned VM using the subject Out-of-the-Box Workflow which is included in the vCAC Plugin Extensibility Package. Manually selecting a vCAC Host in the Common parameters window is not a problem. What I can't do is select/input anything in the virtualMachineEntity Field. Nothing appears in the Chooser/popup window and no data appears regardless of what I may enter in the vCAC:Entity Filter Box. Should this Field auto-populate with some type of data or is there a specific string I need to enter to target my VM?

 

 

 

Am I using the correct Workflow? I'd like to be able to replace the propertyValue of a Custom property of a specific/existing VM.

 

 

 

Thx. Ron

vRO & GIT - How to integrate vRO scripts/packages with Source Code Management (GIT)?

$
0
0

vRO & GIT - How to integrate vRO scripts/packages with Source Code Management (GIT)?

Managing code in VRO

$
0
0

Hello,

 

I was wondering how's everyone else is doing about managing the code in VRO when there is multiple developpers on the same node ?

Some of my team sometimes forget to increase the version of a workflow, sometime we are testing stuff on the same workflows and we overwrite each other.

 

So do you normally share VRO nodes ? Do you use a plugin ? Have you found a way to integrate it with Git ?

 

I'm working about integrating my workflows into Gitlab using CodeGuardian plugin, but still we will share the vro node and might overwrite each other.

 

So how do you work in VRO when in a team of devs ? And multiple environnement dev/preprod/prod ?

 

Thanks!

impossible to create nic teaming in portgroup

$
0
0

Hello,

I want to  modify portgroups in standard switchs of vCenter

Onyx 2.2.5 gave me the following javascript

 

// ------- QueryPnicStatus -------
managedObject.queryPnicStatus("vmnic4");  // IscsiManager
// ------- QueryVnicStatus -------
managedObject.queryVnicStatus("vmk1");  // IscsiManager
// ------- UpdatePortGroup -------
var portgrp = new VcHostPortGroupSpec();
portgrp.name = "vMotion";
portgrp.vlanId = 1430;
portgrp.vswitchName = "vSwitch0";
portgrp.policy = new VcHostNetworkPolicy();
portgrp.policy.security = new VcHostNetworkSecurityPolicy();
portgrp.policy.nicTeaming = new VcHostNicTeamingPolicy();
portgrp.policy.nicTeaming.failureCriteria = new VcHostNicFailureCriteria();
portgrp.policy.nicTeaming.nicOrder = new VcHostNicOrderPolicy();
portgrp.policy.nicTeaming.nicOrder.activeNic = System.getModule("com.vmware.onyx").array(String, 1);
portgrp.policy.nicTeaming.nicOrder.activeNic[0] = "vmnic4";
portgrp.policy.nicTeaming.nicOrder.standbyNic = System.getModule("com.vmware.onyx").array(String, 1);
portgrp.policy.nicTeaming.nicOrder.standbyNic[0] = "vmnic0";
portgrp.policy.offloadPolicy = new VcHostNetOffloadCapabilities();
portgrp.policy.shapingPolicy = new VcHostNetworkTrafficShapingPolicy();
managedObject.updatePortGroup("vMotion", portgrp);  // HostNetworkSystem
// ------- QueryVnicStatus -------
managedObject.queryVnicStatus("vmk1");  // IscsiManager

 

 

I transformed it in

 

networkSystem = vmHost.configManager.networkSystem;
var portgrp = new VcHostPortGroupSpec();
portgrp.name = "vMotion";
portgrp.vlanId = 1430;
portgrp.vswitchName = "vSwitch0";
portgrp.policy = new VcHostNetworkPolicy();
portgrp.policy.security = new VcHostNetworkSecurityPolicy();
portgrp.policy.nicTeaming = new VcHostNicTeamingPolicy();
portgrp.policy.nicTeaming.failureCriteria = new VcHostNicFailureCriteria();
portgrp.policy.nicTeaming.nicOrder = new VcHostNicOrderPolicy();
portgrp.policy.nicTeaming.nicOrder.activeNic = new Array();
portgrp.policy.nicTeaming.nicOrder.activeNic[0] = "vmnic4";
portgrp.policy.nicTeaming.nicOrder.standbyNic = new Array();
portgrp.policy.nicTeaming.nicOrder.standbyNic[0] = "vmnic0";
portgrp.policy.offloadPolicy = new VcHostNetOffloadCapabilities();
portgrp.policy.shapingPolicy = new VcHostNetworkTrafficShapingPolicy();

networkSystem.updatePortGroup("vMotion", portgrp); 

 

but the teaming is not configured, there is no error on the execution of the script the only thing is that vmnic4 and vmnic0 appear in the unused adapters of the portgroup

Choose Template from different DataCenter

$
0
0

Hello, 

I want my user can choose different Template from Datacenter. I have a first custom properties linked with action to show DataCenter Location and now I would like create another action vro linked from input parameter (Datacenter) to give possibility to choose Template

I modify the script with if and else condition but when I choose my first custom properties DataCenter the information is not sent in the condition if and goes directly to the "else"

var sdkConnection;

var vcFolderId;

if(Datacenter){

switch(Datacenter){

case "TOULOUSE": 

var sdkConnection = "aixmqvcenter01.aixmq.local"

var vcFolderId = "group-v265";

case "CANNES": 

var sdkConnection = "aixmqvcenter01.aixmq.local"

var vcFolderId = "group-v262";

}

}

else {

return["Please select a Datacenter"];

};

var sdk = Server.findForType("VC:SdkConnection",sdkConnection);

// Search for vcfolder with the id of vcFolderId 

var vcfolder = sdk.getAllVmFolders(null,"xpath:id='"+vcFolderId+"'"); 

// vcfolder contains an array of folders. The first element of this array will be stored in theVmFolder as a VcVmFolder object 

var theVmFolder = vcfolder[0]; 

// Stores the vm name 

var vmsInFolder = theVmFolder.vm; 

// Array to store the vms with the status template from a vcfolder 

var templatesInFolder = []; 

// Temporary variable to find out if one of the vms in the vcfolder has the status of a template 

var vmsAvailable = 0;   

 

// Checks if the vcfolder is empty

if (theVmFolder.vm == 0 && vmsAvailable == 0){

System.log("NO VMs in Folder at all"); 

templatesInFolder.push("NO TEMPLATES"); 

 

else {

// Loops through all vms in the vcfolder and stores only vms with the status template in an array of strings 

if (vmsInFolder[0].config.template != null){

for (i = 0; i < vmsInFolder.length; i++) {   

if (vmsInFolder[i].config.template == true) {       

System.log("VM : "+vmsInFolder[i].name+" Is a template");  

templatesInFolder.push(vmsInFolder[i].name);    

}   

else {       

System.log("VM : "+vmsInFolder[i].name+" Is not a template");    

vmsAvailable = 1;    

}   

}   

 

// Check if none of the available vms in the vcfolder have the status template 

if (templatesInFolder[0] == null && vmsAvailable == 1)

System.log("No Templates in Folder"); 

templatesInFolder.push("NO TEMPLATES"); 

}

}

// Resturns and Array of strings with includes all vms in the vcfolder with the status template 

return templatesInFolder;

 

var sdkConnection;
var vcFolderId;
 
if(Datacenter){
switch(Datacenter){
case "TOULOUSE": 
var sdkConnection = "aixmqvcenter01.aixmq.local"
var vcFolderId = "group-v265";
case "CANNES": 
var sdkConnection = "aixmqvcenter01.aixmq.local"
var vcFolderId = "group-v262";
}
}
else {
return["Please select a Datacenter"];
};
var sdk = Server.findForType("VC:SdkConnection",sdkConnection);
// Search for vcfolder with the id of vcFolderId 
var vcfolder = sdk.getAllVmFolders(null,"xpath:id='"+vcFolderId+"'"); 
// vcfolder contains an array of folders. The first element of this array will be stored in theVmFolder as a VcVmFolder object 
var theVmFolder = vcfolder[0]; 
// Stores the vm name 
var vmsInFolder = theVmFolder.vm; 
// Array to store the vms with the status template from a vcfolder 
var templatesInFolder = []; 
// Temporary variable to find out if one of the vms in the vcfolder has the status of a template 
var vmsAvailable = 0;   
 
// Checks if the vcfolder is empty
if (theVmFolder.vm == 0 && vmsAvailable == 0){
System.log("NO VMs in Folder at all"); 
templatesInFolder.push("NO TEMPLATES"); 
 
else {
// Loops through all vms in the vcfolder and stores only vms with the status template in an array of strings 
if (vmsInFolder[0].config.template != null){
for (i = 0; i < vmsInFolder.length; i++) {   
if (vmsInFolder[i].config.template == true) {       
System.log("VM : "+vmsInFolder[i].name+" Is a template");  
templatesInFolder.push(vmsInFolder[i].name);    
}   
else {       
System.log("VM : "+vmsInFolder[i].name+" Is not a template");    
vmsAvailable = 1;    
}   
}   
 
// Check if none of the available vms in the vcfolder have the status template 
if (templatesInFolder[0] == null && vmsAvailable == 1)
System.log("No Templates in Folder"); 
templatesInFolder.push("NO TEMPLATES"); 
}
}
// Resturns and Array of strings with includes all vms in the vcfolder with the status template 
return templatesInFolder;
 

Import Package with Actions - should their IDs change?

$
0
0

vRO 6.0.4

 

Say I create a vRO package containing actions and I know what the ID of each action is. When I import that package into a new vRO system, what is the expected behaviour of the IDs of those actions? In my testing it would appear that the actions get new IDs. Workflows of course maintain their existing IDs.

 

Can anyone confirm the expected behaviour?

 

It's not causing a problem, I am just curious


working with powershell objects

$
0
0

Hello, there are a lot of actions whitch are difficult to handle in vro so to be able to quickly develop functions in my ESX while I am training on vCenter API I want to use the powershell api

I have seen 2 scripting class whitch seems to be very interesting for me

 

PowershellPsObject

and

PowershellRemotePsObject

 

is it possible to have informations on how to use those scripting class, I think it can help to transcript powershell powercli objects to vro vcenterApi objects

 

are they some books or blogs speaking about those tools ?

ps1 files will not load because they are not digitally signed (they are)

$
0
0

Hello,

 

I get this error when trying to run a ps1 file in a guest:

 

ile C:\Windows\TEMP\vmware74\vco_vmware99.ps1 cannot be loaded. The file

C:\Windows\TEMP\vmware74\vco_vmware99.ps1 is not digitally signed. You cannot

run this script on the current system. For more information about running

scripts and setting execution policy, see about_Execution_Policies at

http://go.microsoft.com/fwlink/?LinkID=135170.

    + CategoryInfo          : SecurityError: (:) [], ParentContainsErrorRecord

   Exception

    + FullyQualifiedErrorId : UnauthorizedAccess

 

 

The file is digitally signed with a V2 signing cert template from our CA.

 

 

It repeatedly does this. Sometimes it won't fail, sometimes it will. Any ideas? If I have to live with it, what is the best way to retry running the script?

 

Thanks

Update Property on VM Entity Using Payload

$
0
0

I am using payload properties to get the virtual machine details and updating ServiceNow CMDB. With this payload workflow, when I add vCACHost and vCAC:virtualmachine (vmentity) parameters to update the service now sysid into virtual machine(for to remove/update the SN cmdb later) using the action "addUpdatePropertyFromVirtualMachineEntity" or with the update property workflow I am getting error like below. Can't use payload and vCACHost with vmentity at same time on single workflow?

 

Error in (Dynamic Script Module name : parsePayload#1) TypeError: Cannot call method "get" of null

 

Note that I am referring this workflow with vRA Machine Provisioned Lifecycle and referenced the following link workflow for SN CMDB.

 

https://managesddc.com/2014/10/01/update-servicenow-cmdb-as-part-of-iaas-machine-life-cycle/

 

Can you please help on this? and let me know if you need more details.

vRealize Orchestrator

$
0
0

I am unable to change the datatype of an attribute in Orchestrator. When I click the current type, a window is supposed to pop up. From here, I can choose a data type. This window doesn't pop up. Sometimes it works. Most of the time it doesn't. Sometimes it would start working again if I closed Orchestrator and reopened it. This is no longer working. The issue also follows me from computer to computer.

Help with handling output for Custom Decision

$
0
0

Hello,

 

Trying to capture a success or fail output message from and "Invoke External Script" workflow and pass it to a custom decision action. I must not be selecting the correct action in the scripting tab? Please see below.

 

 

Please note the error message in red is unrelated to what I'm asking. My issue is that whether or not the output is success or fail, the custom decision always calls the next workflow. It never goes to sleep upon getting a failure output message.

 

Script for custom decision is:

if (output = "success") return true

else return false;

 

Can someone help me correct this? Thank You

Viewing all 10285 articles
Browse latest View live


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