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
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
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:
type Status report
message
descriptionThe request sent by the client was syntactically incorrect ().
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
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
This is a patch release of the plug-in.
Version 5.5.1-1572399
Version 5.5.1-1802324
Version 5.5.2-1869849
Version 5.5.2-2022792
Version 5.5.2-2032416
Version 5.5.2.3-2286318
Version 5.5.2.3-2372318
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.
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)
- Updated 2015-01-05 by Daniel Linsley:
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 !
Script management : Add, edit, delete a script configuration. A script configuration contains:
The script configurations are stored as resource elements in the vCO database. This means :
The script configuration runner : "Run script in VM guest"
There is also a workflow to run multiple scripts one after the other and a workflow to upload your files as resource elements.
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.
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");
}
}
}
}
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?
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?
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
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 :-)
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!
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
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.
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
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.
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
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
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?