VMware Cloud Community
manfriday
Enthusiast
Enthusiast
Jump to solution

"Simple workflow example" trouble

Hi,

Im completely new to orchestrator, so forgive me if this is a dumb question.

I am following along the basic tutorials in the documentation, and I am hitting a stumbling block when trying to set up a "decision" node.

IN my schema, I select the "VM powered ON?" decision node, and add

VC:VirtualMachine vm "State Equals"

I click on "not Set" expecting to be able to select either "poweredON", "poweredOff", or "Suspended"

a box pops up that says: MV;VirtualMachinePowerState but nothing is found

entering poweredon, or similar into the Filter doesnt bring anything up, so I can't fill in this last field.

Am I doing something wrong?

I am able to browse thru the vCenter server via the Inventory tab, so it looks like orchestrator is talking to vCenter correctly..

Thanks

Jason

Reply
0 Kudos
1 Solution

Accepted Solutions
cdecanini_
VMware Employee
VMware Employee
Jump to solution

Welcome Jason,

You are not doing anything wrong, a bug was discovered recently in the decision box whn using the VM power state.

Instead use a custom decision box, add your vm as input and write the following code:


if (
vm.runtime.powerState == VimVirtualMachinePowerState.poweredOn) {
         return true;
} else {
         return false;
}

Christophe.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter

View solution in original post

Reply
0 Kudos
5 Replies
cdecanini_
VMware Employee
VMware Employee
Jump to solution

Welcome Jason,

You are not doing anything wrong, a bug was discovered recently in the decision box whn using the VM power state.

Instead use a custom decision box, add your vm as input and write the following code:


if (
vm.runtime.powerState == VimVirtualMachinePowerState.poweredOn) {
         return true;
} else {
         return false;
}

Christophe.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
Reply
0 Kudos
manfriday
Enthusiast
Enthusiast
Jump to solution

Hi, Christophe

Thanks very much for the quick answer, and for showing me the work around.

Much appreciated!

Jason

Reply
0 Kudos
Nusakan0
Contributor
Contributor
Jump to solution

Thank you very much for this information, I'm new to this as well and I couldn't figure out what I was doing wrong and recreated this example 2-3 times thinking i misread a step somewhere.

Reply
0 Kudos
Cumulus
Enthusiast
Enthusiast
Jump to solution

I tried your suggestion and I get the following error when I try to run the Workflow:

[2011-05-10 18:56:44.413] [I] ReferenceError: "VimVirtualMachinePowerState" is not defined. (Workflow:Start VM and Send Email / VM Powered On (item0)#9942)

Reply
0 Kudos
Cumulus
Enthusiast
Enthusiast
Jump to solution

I found the correct code in another workflow.

return vm.runtime.powerState.value == "poweredOn";

Reply
0 Kudos