cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1074
Views
0
Helpful
1
Replies

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

Ben Conrad
Level 1
Level 1

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.

2015-01-13 09_34_07-Cisco UCS Director.png

Ben

1 Reply 1

adam.ringenberg
Level 1
Level 1

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.

GetVMSummary.png

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.

Cisco UCS X-Series Energy Efficiency Offer