Hi All,
I have a problem with my vCO. After every reboot of the vCO server or VC server I lost my values in the workflows which point to the virtual center. For example, I have a workflow where I define a special vmfolder, special VM as a template, special host where the machine should start, etc. After a reboot are the values as "Not configured" and I need to define the values again. The values for Active Directory working, like LDAP groups or OUs.
I have already now a script how I get a VM, Host, Datastore and Network using a string with the name auf the VM/Host/... as input and get an output as VC:VirtualMachine/VC:Host,...
What I need now is a script where I can define an input parameter as a string with the same name of the vmfolder what I have ion VC and get an output attribute with the vmfolder as type = vmfolder.
OK, well you are certainly storing the values in the correct location... try Christophe's request for some additional troubleshooting.
For the immediate workaround and to answer your actual request, the following script should retrieve a vmFolder based on the string: Only input required is the "vmFolderName" which is a String. The return value is "vmFolder"
var folders = VcPlugin.getAllVmFolders(null, "xpath:name='"+vmFolderName+"'");var vmFolder = null;if (folders != null){if (folders.length == 1){System.log("Match found for vm named: "+vmFolderName);vmFolder = folders[0];}else{System.log("More than one vmFolder found with that name! "+vmFolderName);for each (folder in folders){System.log("Folder ID: "+folder.id);}}}
If you set these values as workflow attributes they should stay after a reboot since all vCenter object are referenced through their unique ID. If when restarting the attribute appears as not found then you have a serious problem and should send your logs to VMware support.
Christophe.
Hi,
I install a new VC server and a new vCO box with update1 and vCO 4.2.1
The vCO get a new blank DB. I configure the server and create a test workflow only with three attributes where values for VC:Hostsystem,VC:Datastore and VMFolder were set.
The three values were set as "Not Found" after a reboot of the vCO server.
I had open a call by VM about this issue and wait for more than 2 weeks for a solution, but I don´t get this one. VMWare don´t have an idea why the VC values losts and this are only the VC values. LDAP values or other are OK.
I can set already a host, datastore, vm or network inside my workflow from string, but I need to set also a vmFolder as an output attribute where I provide a string as a input parameter.
Can somebody help me, with a script ?
Thanks.
Can you please share some screenshots showing:
1) values set (Before executing the workflow)
2) Not Found (After executing the workflow)
Perhaps actually seeing your problem will help us to help you
Here is a screenshot after a reboot,
sometime are all three values as not found and sometimes is one vaule set.
Do a:
System.log(BDCHost.originalStringRepresentation);
System.log(Folder.originalStringRepresentation);
Once done go check the vCO inventory and check the IDs of the objects and if they are matching.
Christophe.
OK, well you are certainly storing the values in the correct location... try Christophe's request for some additional troubleshooting.
For the immediate workaround and to answer your actual request, the following script should retrieve a vmFolder based on the string: Only input required is the "vmFolderName" which is a String. The return value is "vmFolder"
var folders = VcPlugin.getAllVmFolders(null, "xpath:name='"+vmFolderName+"'");var vmFolder = null;if (folders != null){if (folders.length == 1){System.log("Match found for vm named: "+vmFolderName);vmFolder = folders[0];}else{System.log("More than one vmFolder found with that name! "+vmFolderName);for each (folder in folders){System.log("Folder ID: "+folder.id);}}}
Ah yes, you should also confirm that your forward/reverse DNS is resolving properly for your vCenter server from your vCO server - and be sure that your vCenter plugin is configured with the appropriate name as per the forward/reverse lookups. If you connect using the API, but the server returns the FQDN in the plugin calls, you could have some mis-matches that are intermittent - explaining why some values fail to store and others are okay.
Here is the screenshot from the log
Hi Burke,
your script is working very well.
Thank you very much.