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

cannot see a vm on item manchines when vco workflow provision finish

$
0
0

Hi

    

     My Problem I use vco workflow to Provision by vcac and when finish I cannot find a vm on vcac item machine.


Regards,

Kittanai


Utilizing Python to Interface with the API (Orchestrator 5.1.2)

$
0
0

So I'm having a problem getting the POST operation (Below - # Start execution) to work. Everything, I have tried has resulted in a 400 error. I have also tried setting the post variable just using a string and the JSON ({"parameters":....}). If anyone can give me a some help figuring out what I'm doing wrong here it would be appreciated.

# Retrive API URL for a workflow
import pycurl, json, pprint
from io import BytesIO
data = BytesIO()
orchestrator_url = "https://server.domain.com:8281/api/workflows?conditions=name=Workflow%20Name"
user_pwd = "user:******"
c = pycurl.Curl()
c.setopt(pycurl.URL, orchestrator_url)
c.setopt(pycurl.USERPWD, user_pwd)
c.setopt(pycurl.SSL_VERIFYHOST, 0)
c.setopt(pycurl.SSL_VERIFYPEER, 0)
c.setopt(c.WRITEFUNCTION, data.write)
c.perform()
response = json.loads(data.getvalue())
for attribute in response['links'][0]['attributes']:   if attribute['name'] == 'itemHref':     orchestrator_url = attribute['value'].decode("utf-8").encode("ascii","ignore")     break
# Start execution
data = BytesIO()
orchestrator_url += "executions"
parameters = {}
parameters['parameters'] = [1]
parameters['parameters'][0] = {}
parameters['parameters'][0]['scope'] = "LOCAL"
parameters['parameters'][0]['type'] = "string"
parameters['parameters'][0]['name'] = "environment"
parameters['parameters'][0]['value'] = {}
parameters['parameters'][0]['value']['value'] = "Production"
parameters['parameters'][0]['value']['objectType'] = "string"
post =  json.dumps(parameters)
# post = {"parameters": [{"scope": "LOCAL", "type": "string", "name": "environment", "value": {"value": "Production", "objectType": "string"}}]}
# post = json.dumps({"parameters": [{"scope": "LOCAL", "type": "string", "name": "environment", "value": {"value": "Production", "objectType": "string"}}]})
c.setopt(pycurl.URL, orchestrator_url)
c.setopt(pycurl.USERPWD, user_pwd)
c.setopt(pycurl.SSL_VERIFYHOST, 0)
c.setopt(pycurl.SSL_VERIFYPEER, 0)
c.setopt(c.WRITEFUNCTION, data.write)
c.setopt(pycurl.HTTPHEADER, ['Accept: application/json;v=5.1.1', 'Content-Type: application/json;v=5.1.1'])
c.setopt(pycurl.POST, 1)
c.setopt(pycurl.POSTFIELDS, post)
# c.setopt(pycurl.POSTFIELDS, '%s' % post)
c.perform()
response = json.loads(data.getvalue())
c.setopt(pycurl.HTTPHEADER, ['Accept: application/json;v=5.1.1', 'Content-Type: application/json;v=5.1.1'])
c.setopt(pycurl.POST, 1)
c.setopt(pycurl.POSTFIELDS, '%s' % post)
c.perform()
response = json.loads(data.getvalue())

 

Just for reference. The JSON for a completed execution:

{u'endDate': 1419616471963,
u'href': u'https://server.domain.com:8281/api/workflows/ae280954-0442-4342-a60d-374ed0f9772e/executions/402880114a7d7df6014a87bc467f0037/',
u'id': u'402880114a7d7df6014a87bc467f0037',
u'inputParameters': [{u'name': u'environment',                       u'scope': u'LOCAL',                       u'type': u'string',                       u'value': {u'objectType': u'string',                                  u'value': u'Production'}}],
u'name': u'Workflow Name',
u'outputParameters': [{u'name': u'output',                        u'scope': u'LOCAL',                        u'type': u'string',                        u'value': {u'objectType': u'string',                                   u'value': u'e4ecf81b7384'}}],
u'relations': {u'links': [{u'href': u'https://server.domain.com:8281/api/workflows/ae280954-0442-4342-a60d-374ed0f9772e/executions/',                            u'rel': u'up'},                           {u'href': u'https://server.domain.com:8281/api/workflows/ae280954-0442-4342-a60d-374ed0f9772e/executions/402880114a7d7df6014a87bc467f0037/',                            u'rel': u'remove'},                           {u'href': u'https://server.domain.com:8281/api/workflows/ae280954-0442-4342-a60d-374ed0f9772e/executions/402880114a7d7df6014a87bc467f0037/logs/',                            u'rel': u'logs'},                           {u'href': u'https://server.domain.com:8281/api/workflows/ae280954-0442-4342-a60d-374ed0f9772e/executions/402880114a7d7df6014a87bc467f0037/state/',                            u'rel': u'state'}]},
u'startDate': 1419616470657,
u'startedBy': u'user@server.domain.com',
u'state': u'COMPLETED'}

 

I've collected some debug log entries: they don't appear to be very useful though...

2014-12-30 10:04:16.716-0500 INFO  [SecurityTokenServiceImpl] Successfully acquired token for user: user

2014-12-30 10:04:16.903-0500 INFO  [SecurityTokenServiceImpl] Successfully acquired token for user: {Name: user, Domain: domain.com}

2014-12-30 10:04:16.919-0500 DEBUG [CallCollectorCenter] Registering call collector : VSOFactory-cache

2014-12-30 10:04:16.919-0500 DEBUG [VSOFactoryClient] << connecting shared factory !

2014-12-30 10:04:16.919-0500 DEBUG [VSOFactoryClient] Create Session

2014-12-30 10:04:16.919-0500 DEBUG [VSOFactoryClient] Session created

 

And the typical response I get back:

HTTP Status 400 -


type Status report

message

descriptionThe request sent by the client was syntactically incorrect ().


JBossWeb/2.0.1.GA

Convert strings to Array (Composite Type)

$
0
0

I'm trying to create a Composite Type array within vCO for the purpose of passing data via the Guest Script Manager package.  I'm using the Guest Script manager to run a PowerShell script that will deploy the 1st domain controller in a new forest.  As of right now I only have 2 customized variables within the script; "$aminPassword" & "$domainName". If I was executing everything directly from vCO I'd have no issue because I could manually select the variables to replace when running the "Run Script in VM Guest" workflow.  Since the process will be initiated from vRA, I have to go through the painstaking process of creating a wrapper.

 

The workflow within the Guest Script Manager package where this logic is located is called "Run Script in VM Guest".  Within that workflow, there's a scriptable task called "Update Script"  That object has 2 inputs: vcoPath (type:String, attribute) who's value is the path where script is stored on vCO server, and scriptVariables (type: Composite Type(StringtoReplace:string,ReplacingString;string):scriptVariables).  The latter variable would normally be populated during the manual invocation of the workflow when the requester selects the script that they want to have ran.  Since I'm using vRA for the requesting, I have to script the population of the variable based upon string inputs.

 

The code for the Update Script scriptable task is:

 

var scriptFile = new FileReader(vcoPath);

 

scriptFile.open();

var script = scriptFile.readAll();

 

for each (var scriptVariable in scriptVariables) {

    System.log("Replacing variable " + scriptVariable.get("stringToReplace") + " with value " + scriptVariable.get("replacingString"));

    var search = escapeRegExp(scriptVariable.get("stringToReplace"));

    script = script.replace(new RegExp(search, "g"),scriptVariable.get("replacingString"));

}

 

//Saving unique file

System.log("Saving script " + vcoPath + " with content : \n" + script);

var fileWriter = new FileWriter(vcoPath);

fileWriter.open();

fileWriter.clean();

fileWriter.write(script);

fileWriter.close();

 

function escapeRegExp(str) {

  return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");

}

 

 

 

I found the following script online to build the Composite Type array, but it doesn't seem to be working:

 

scriptVariables = new Array();

var jsObj = { name: "$domainName", value: domainName};

scriptVariables.push(jsObj);

var jsObj1 = { name: "$securePassword", value: somepassword};

scriptVariables.push(jsObj1);

 

In my solution, $domainName and $securePassword are the variables that are being replaced with the values of the vCO WF variables domainName and somePassword.

 

The error that I'm getting occurs on the "Update Script" scriptable task stating:

[2015-01-01 03:31:16.420] [I] Replacing variable null with value null

[2015-01-01 03:31:16.420] [I] TypeError: Cannot call method "replace" of null (Workflow:Wrapper Run script in VM guest / Update script (item29)#13)

 

I put a breakpoint on the scriptable task which holds the code to create the Composite Type array and saw that in fact it was creating an array consisting of 2 columns and 2 rows, but that it was empty.

 

I've been wracking my brain on this one for a while now and have only found a couple of posts on the web that have been only remotely helpful which brings me finally to my question:  Does anyone know how to resolve this?

 

v/r

 

Jeremy

choose datastore freespace

$
0
0

Hello to All,

I have workflow to create VM from template,

I want to create list with 5 datasores with most free space to choose,

any idea how to do that?

Technical Preview Version of VMware vCenter Orchestrator Plug-In for VMware vSphere 5.5.x

$
0
0

Technical Preview Version of VMware vCenter Orchestrator Plug-In for VMware vSphere 5.5.x

This is a patch release of the plug-in.

 

Version 5.5.1-1572399

  • Support virtual E1000e NIC
  • New VC extension manipulation methods in scripting API
  • Fixed data synchronization by retrieving VcVirtualMachine objects from property collector (as opposed to inventory service)
  • Improved performance by utilizing the session cache when inventory service is used
  • Fixed session cache configuration, preventing object eviction, degrading performance
  • Possibility to disable use of inventory service by setting the value of the java system property "com.vmware.o11n.vim.useInventoryService" to "false" (in vmo.properties).
  • Other fixes:
    • close unused vCenter sessions
    • reload plugin configuration after updating it through workflows
    • recover unusable vCenter instances after they become usable again
    • prevent concurrency issues when using both inventory service and property collector
    • other stability and failover improvements

 

Version 5.5.1-1802324

  • Fixes related to vSAN API

 

Version 5.5.2-1869849

  • Fixes to workflows that add host systems ("Add standalone host" and "Add host to cluster")

 

Version 5.5.2-2022792

  • Fixes to OVF importing

 

Version 5.5.2-2032416

  • Fixed delay during vCenter session cleanup

 

Version 5.5.2.3-2286318

  • Fixed a limit of 100 objects when returning vCenter inventory objects

 

Version 5.5.2.3-2372318

  • bug fix for KeyAnyValue serialization - vCenter does not accept the generated soap request.
  • bug fix in list choosers - criteria in filter field does not match anything.

 

Please note, that the attached plug-in is QE verified, but still not a final version.

This release is not an official one and is intended for testing purposes only. It is not recommended for production use.

Why does vApp.recompose(...) set E1000 as adapter type?

$
0
0

Hi there,

 

guys, I'm wondering why vApp.recompose(recomposeVAppParams) sets the resulting VM NICs type to E1000 since we migrated to VCO 5.5.1? If I create a vApp from a vAppTemplate the NIC type is set to VMXNET3, however if I recompose a vApp, e.g. using the example workflow in com.vmware.library.vCloud.vApp.addVAppTemplateVM, the created VM is showing E1000... any ideas?

 

Thanks

Igor

 

VCD: 5.5.1

VCO: 5.5.1 (VCD Plugin 5.5.0)

Guest script manager package

$
0
0

- Updated 2015-01-05 by Daniel Linsley:

  • UAC compatible
  • 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.

Finding the Next Free Spot on a VM to add a disk

$
0
0

I have a VM with this 2 different types of Disk Configuration scenerios Hard Disk 1 (0: 0), Hard Disk 2 (0: 1), Hard Disk 3 (0: 2), Hard Disk 4 (0: 3), Hard Disk 5 (1: 0)

Scenerio 1:

Hard Disk 1 (0: 0), Hard Disk 2 (0: 1), Hard Disk 3 (0: 2), Hard Disk 4 (0: 3), Hard Disk 5 (1: 0)

Scenerio 2:

Hard Disk 1 (0: 0), Hard Disk 2 (0: 1), Hard Disk 3 (0: 2), Hard Disk 4 (1: 0)

 

I have a workflow scriptable taks that has the input of SCSI Controller Hardware types (since it could be more than one in Scenerio 1 it has two (Bus 0 and bus 1) and in scenerio 2 it only has 1) and the input of all of the virtual disks.  I was wondering where my logic is going wrong because I am having trouble breaking out of loops.  What I am trying to do is find the first open slot on a VM to add a disk.  so for scenerio 1 the first open slot will be Hard Disk 6 (1:1) and for scenerio two Hard Disk 5 (0:3) but I am having trouble breaking out of my loops when as it will just itterate to the next controller

 

var scsiControllerSpots = [0,1,2];

var scsiControllerDisksArray = [];

var openSlots = [0,1,2,3];

 

 

 

 

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

    for (var j = 0; j < scsiControllers.length; j++) {

        if (scsiControllerSpots[i] == scsiControllers[j].busNumber) {

  //System.log("Evaluate this SCSI Controller with Bus Number " + scsiControllers[j].busNumber);

  var SCSIcontrollerKey = scsiControllers[j].key

  //System.log(SCSIcontrollerKey);

  for (var k = 0; k < virtualDisks.length; k++) {

  if (virtualDisks[k].controllerKey == SCSIcontrollerKey){

  scsiControllerDisksArray.push(virtualDisks[k].unitNumber);

  //System.log("this disk belongs to SCSI Controller with Bus Nubmer " + scsiControllers[j].busNumber);

  //System.log(virtualDisks[k].unitNumber);

  }

        } if (scsiControllerDisksArray.length < 4){

  var openslot = scsiControllerDisksArray.length;

  System.log(openslot);

  //System.log(scsiControllerDisksArray.pop());

  break;

  } else {

  System.log("go to the next scsi slot");

  }

    }

  }

}


Change uuid (bios.uuid) of a VM

$
0
0

Hi,

I tried to change the UUID this way:

var UUIDlog = vcVM.config.uuid;
System.log("UUID at the moment: " + UUIDlog);
System.log("UUID to set : " + UUIDnew);
vcVM.config.uuid = UUIDnew;
var UUIDcontrol = vcVM.config.uuid;
System.log("UUID after change: " + UUIDcontrol);

 

vCO shows the mo correct value but the VMX File isn’t updated.


[2015-01-07 17:05:48.923] [I] UUID at the moment: 564dc846-3c30-b95f-84fc-4d9e168ecd07

[2015-01-07 17:05:48.923] [I] UUID to set : 42286f25-0cfe-4a18-ffd4-79a682663297

[2015-01-07 17:05:48.923] [I] UUID after change: 42286f25-0cfe-4a18-ffd4-79a682663297


Does anybody know what’s wrong?

Guest script manager rights issue

$
0
0

I tried the new UAC fixed guest script manager, however when it tries to run the sample script to change IP it gets an error that indicates not valid rights.  It does copy the file locally which is further then the old one got.  Is there something I am missing with this?

VCO 5.5.2.1 - no logs from system.log in the client

$
0
0

I have VCO 5.5.2.1  both in the home lab and the  work lab.   The instance in the work lab does not show  System.log messages in the VCO client window.  They are logged to the scripting.log file just fine. 

 

I've cleared my java cache,  installed a fresh appliance in the work lab  and still no logs. Has anyone seen this?

 

Thanks for the advice

 

 

Mike

How to use the Credential object?

$
0
0

I had a requirement to create a password confirmation form in vCO. I detailed what I came up with here:

 

http://www.jonathanmedd.net/2015/01/presenting-a-password-confirmation-form-in-vco-vro.html

 

It was suggested in the comments that:

 

"A better way would be to use an input of type “credential” (which does include natively the confirm password check)."

 

While the credential object solves the problem of the password confirmation very nicely, it introduces a new issue in that I am struggling to work with its content when working in the workflow having used it as an input.

 

I tried to use the credential object once before, but had issues with the password property. Once inside the workflow the password property does not seem to be available. The API explorer for the password property states “[Deprecated]Passwords are not available in scripting”. For example, say I want to use the credentials with the ‘Run Program in Guest’ workflow, I need to supply a username (String) and password (SecureString), but just picking out the username and password properties of the credential object fails to work. I can confirm in the workflow by using the checkPassword method that the password matches a known value. However, when trying to use the password property and assign it to another workflow requiring a password authentication always fails.

 

Does anybody have any examples of how to use the credential object in terms of working with the password inside the workflow in scriptable tasks or other workflows?

 

Thanks :-)

Running a workflow object with given credentials

$
0
0

I'm working on a Windows provisioning workflow in vCO. In the interest of security, users have a domain admin level user and their normal user account that has been granted VMware/vCenter privileges. The normal account cannot perform any domain activities (creating security groups/adding computers to the domain), and the domain admin account cannot access vCenter.

 

I'd like a single workflow that will prep AD for a new server add (requires domain admin privs), then deploy a template/sysprep (requiring vCenter privs), and lastly joining the domain (Domain Admin privs again).

 

I know that I can use the "Run As" functionality for a single workflow, but is it possible to prompt the user for their admin credentials, then in a single workflow call the required AD workflows, followed by running the vCenter workflows, and lastly the AD workflows again with their domain admin creds?

 

Thanks!

How to get Advance Service Designer - "Request Information" - Description & Reason

$
0
0

Hi All,

 

I have created a ASD service based on a workflow. When the ASD catalog is requested, the first tab is "Request Information" which has Description and Reason field. How to access these values in the underlying workflow.

 

Thanks

vCO Provision VMs with VMXNET3 adapter

$
0
0

Hi All,

 

We are using VCO as our workflow engine for the automated provisioning of VMs.

 

We have a requirement that the VMs are deployed using the VMXNET3 adapter. However, at the moment they are all being deployed with the E1000 adapter instead.

 

Does anyone know how to configure the adapter to use in VCO?

 

Thanks.


Missing Workflows?

$
0
0

All the sample workflows that use the "Email Send (Notification)" nested workflow in Orchestrator 5.1.2 are now reporting "Workflow not Found" for that workflow. Not sure how it got deleted, but I'd love to have it back. Is there a place to download just the sample workflows or do I have to install a separate instance and copy them over?

 

Thanks!

Dan

How to Install VMware Tools freshly on VM using vCO

$
0
0

HI All ,

VMware Tools upgrade workflow is working but could you please direct me a solution for installing VMware Tools on 1 machine , Once I understand that I can automate it with all the VM's in the cluster.

Resource Pool Automation

$
0
0

I'm currently being tasked with trying to automate resource pool allocation in our clusters.  Currently our operations team is struggling to size the resource pools automatically, or systems are migrated and the resource pool shares are not reset to the proper amount.  Is there a way I can automate the share amounts based on the memory and CPU for all the VM's in an existing pool.

 

Example.

 

Resource pool has 7 VMs in it totaling 100,000 Memory and 10,000 CPU shares.  System is migrated out and now the resource pool needs to be 80,000 memory and 6,000 CPU.  Is there a way to get Orchestrator to do the math for this and edit the resource pool accordingly?

 

Ben

VM hot add memory/CPU capable

$
0
0

Hi,

 

I want to check if a VM is capable for hot add of memory and CPU, before I enable it on the VM.

 

The code I use is this:

 

queryConfigOption = vm.environmentBrowser.queryConfigOption();
System.log("supportsMemoryHotAdd: " + queryConfigOption.guestOSDescriptor.supportsMemoryHotAdd);

 

But it always returns: undefined

[2014-08-14 14:17:14.857] [I] supportsMemoryHotAdd: undefined

 

When I do a System.log of queryConfigOption.guestOSDescriptor;

guestOSDescriptor = queryConfigOption.guestOSDescriptor;
System.debug ("guestOSDescriptor: " + guestOSDescriptor);

 

it returns 40+ lines of this:

[2014-08-14 14:17:14.857] [D] guestOSDescriptor: DynamicWrapper (Instance) : [VcGuestOsDescriptor]-[class com.vmware.vim.vi4.GuestOsDescriptor] -- VALUE : com.vmware.vim.vi4.GuestOsDescriptor@32bb86f7,DynamicWrapper (Instance) : [VcGuestOsDescriptor]-[class com.vmware.vim.vi4.GuestOsDescriptor] -- VALUE : com.vmware.vim.vi4.GuestOsDescriptor@7ab558bb,DynamicWrapper (Instance) : [VcGuestOsDescriptor]-[class com.vmware.vim.vi4.GuestOsDescriptor] -- VALUE : com.vmware.vim.vi4.GuestOsDescriptor@357c5000,DynamicWrapper (Instance) : [VcGuestOsDescriptor]-[class com.vmware.vim.vi4.GuestOsDescriptor] -- VALUE :...

 

What am I doing wrong?

And how can I check if the VM is hot add capable?

 

Thanks,

Jonathan

Orchestrator 6.0 release date

$
0
0

With vSphere 6.0 coming out Feb 2, does this mean Orchestrator 6.0 would be released at the same time, or might they be released separately?

Viewing all 10285 articles
Browse latest View live


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