Workflow question: How to access VMware properties in If Else clause?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2015 07:35 AM - edited 03-01-2019 06:21 AM
Hello,
I'm doing a demo of UCSD and wanted to jump right into the workflow setup. I'm able to create a simple workflow using the built in tasks.
I normally write all my orchestration using Powershell and have the advantage of error checking and many logic clauses (like if-else, foreach, try{} catch{}, hashes, custom objects, etc).
In the workflow below I get a failure if the VM in question is turned off. Naturally I don't want to have a special workflow just for VMs that are turned off so what I'd want to do is use an If Else task in this workflow. Pseudo code would be:
$vm_selector = input from user form # Input type = 'VM Selector'
$memory_size_selector = input from user form # Input type = 'memory size selector'
if ($vm_selector.powerstate -eq 'poweredOn') {
$vm_selector.shutdownvm()
} else {
"vm already powered off, proceed to next step"
}
ResizeVMwareVMMemoryandCPU_411()
How to get access to the vmware specific methods and properties that are exposed in $vm_selector.
I've looked at the Cisco UCS Director Cloupia Script Configuration Guide and I see a note that says "browser-based objects are not supported because the Cloupia script contains a server-side scripting"
Maybe I should be looking at Custom Workflow Inputs? I see I can pick input type 'vm' and then filter with Power Status EQUALS ON but I don't see where I can use that in the workflow.
Ben
- Labels:
-
UCS Director

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2015 03:05 PM
I know this is from a month ago, and I hope you've found your answer by now.
But if not, I have something for you.
This is workflow that pulls the "Overview_Status" from a custom task I wrote that grabs all the info in userAPIGetVMSummary.
That custom task pulls like 47 things.
