VMware Cloud Community
Muhit
Contributor
Contributor
Jump to solution

vSphere Orchestrator Plug-In Input Error

I working on a VM-deployment-automation project. My problem is difference of input screens between vSphere Web Client and vCO Desktop Client. Sorry my English but I have 2 screenshots about this issue:

     vCenter Orchestrator:

Orch.PNG

    

     vSphere Web Client:

vSphere.PNG

Words are not important (they are Turkish words). First area is operating system area and the second area is os version area.

Example: if first area is "Linux", then second area is dropdown list of Linux distributions,

My main problem is in vSphere client. Because the version action is not working in vSphere and vSphere presents the version area as a text-box.

-Arda
1 Solution

Accepted Solutions
Muhit
Contributor
Contributor
Jump to solution

Sorry, the presentation was not same. "Default value" option must be choosen for fixing this bug. I select a default value for Operating System area and problem is fixed now. Thanks for your help.

-Arda

View solution in original post

5 Replies
iiliev
VMware Employee
VMware Employee
Jump to solution

Hi Muhit,

The problem is how the code which populates the content of the second dropdown (most probably it is a vRO scripting action, bound via a presentation property Data binding to the first dropdown) handles null or empty input.

I suppose the action's code looks something like the following, assuming it takes the variable ostype as an input with the value selected in the first dropdown:

if (ostype == "Windows") {

   return ["Windows 2012 R2 Standard", "Windows 10", ...];

} else if (ostype == "Linux") {

   return ["RedHat", "Suse", "Ubuntu", ...];

} else {

   throw "Unknown OS type"; // or return null;

}

To fix the issue, change the code a bit to not throw exception on return null if the input is null/empty, but instead return an empty array. Something like:

if (ostype == "Windows") {

  return ["Windows 2012 R2 Standard", "Windows 10", ...];

} else if (ostype == "Linux") {

  return ["RedHat", "Suse", "Ubuntu", ...];

} else {

  System.warn("Unknown OS type");

  return [];

}

Muhit
Contributor
Contributor
Jump to solution

Hi Ilian, thanks for your answer firstly. Your script guess is correct. I changed the script as your suggestion but nothing changes. Still distribution area is textbox in vSphere plug-in. I wanna present this area as dropdown list.

-Arda
0 Kudos
iiliev
VMware Employee
VMware Employee
Jump to solution

Could you add some additional System.log(...) statements in your action to trace how many times the action is called and with what arguments? Also, if possible, could send me a copy of your workflow and action (either attach them here in the thread or send them in private message) so I can reproduce it in my environment?

I'm pretty sure that avoiding nulls and exceptions should resolve the problem; we had a few SRs in the past with exactly the same issue, and they were all resolved by changing the scripting code.

Muhit
Contributor
Contributor
Jump to solution

Sharing of the workflow is not possible because of our policy so I created a new workflow as a demo to sharing with you. The new workflow works! I don't know what is the difference but the new workflow using same action for dynamic "os version" input. Presentation is same, input names are same, everything is same.

-Arda
0 Kudos
Muhit
Contributor
Contributor
Jump to solution

Sorry, the presentation was not same. "Default value" option must be choosen for fixing this bug. I select a default value for Operating System area and problem is fixed now. Thanks for your help.

-Arda