Latest Headlines
0

There’s a new guitar in town!

An Orchestra typically needs more than one musician. And for a blog about vCenter Orchestrator it’s also a good idea to have more than one authors!

***DRUMROLL***  Let me introduce ……***DRUMROLL***… Christian Strijbos as co-author for vcoportal!

Christian works as Senior IT-Architect for a VMware Consulting Partner in Germany, helping customers of all sizes and all industries to design, implement, automate and orchestrate (obviously  :-D) their VMware environments. He holds VCDX3 and VCDX4 certifications (magic number: 64).

Current work in progress: Wavemaker and Orchestrator and (better(?): versus  :mrgreen: )  LDAP, much more in the pipeline… So, stay tuned for great articles coming soon!

0

Using Onyx to speed-up Workflow development

In the VMTN Community Forums for Orchestrator recently one question came up:

“…how to use orchestrator to change the Video Card Setting of a VM to “Auto-detect settings” the next time the VM reboots?” (read the full thread here: http://communities.vmware.com/message/2040860#2040860)

That is a typical task for a workflow developer: Automate something you can easily click in vSphere Client, but it maybe hard to figure out, how to automate it.

ONYX to the rescue!

See this video how to get to the solution in less than 15 minutes  :-D… (You can download the resulting workflow below, but that shouldn’t be necessary anymore 😛 !)

It’s a quick shot screencast, so no audio….

If you like the style, drop me a comment, and I will create more videos (with explanations  😎 ) in future!

Change VM Video Settings Workflow
Change VM Video Settings Workflow
Change-VM-settings-to-auto-detect-video-memory.workflow
2.1 KiB
Details...
0

Safe your job, create unmaintainable workflows!

The need for unmaintainable workflows

As an external consultant as well as permanent employee it’s always a good idea to make yourself indispensable for your customer/company. This ensures ongoing engagement/a safe job.

In IT in general you can achieve this by devloping unique solutions nobody else except yourself can understand (and maintain). I’m sure: You all can instantly give at least one example for an IT-component where youself/your teammates/everybody else follow the policy: “Never touch a running system“.

 <buzzword-for-the-robots>The modern term for this is NoOps.</buzzword-for-the-robots>

 As a workflow developer you also can follow some simple rules to make sure: You, and only you, will be able to maintain, re-use or even exand your workflows!

Here we go…:

Documentation, Labeling, Description Fields

Avoid Documentation, and use the default labels for workflow elements. So one has really click into each element, read the code, see the bindings to figure out what happens here.


When naming workflows and actions, and their parameters and attributes: Don’t be too obvious! A simple “name” or “vm” or “theArray” is enough.

Be aware of the Description fields! They are shown in so  many different places (when you re-use the elements, mouse-over in the schema, for documentation, …), that your really want to avoid this disclosure of “what this element is for”.

Logging

For the usage of System.log(), System.debug() and co. you have the choice:

  • Don’t log at all! Your NoOps-Team will thank you for that.
  • Log everything! It’s always a good challenge for the NoOps-Team to find the really important messages in hundrets of lines with traced-out variables (Eastern is coming!)…
  • Just log values! The value of a variable is what’s interesting. Nobody wants to know what variable it is… System.log(myVariable) does the trick.
  • Pro-Tip: You can even improve confusion by logging WRONG things, e.g. when you copy&paste scripts to re-use it in another context.

Workflow Design

Especially important for Library-Workflows which are intended to be called by other Workflows:
Hardcoding values in the script, not exposing important parameters as INPUT-parameters and  creative usage of  the data types ANY and Properties (of course whithout proper documentation) will ensure that it’s you, and only you, who can re-use the workflow.

In General:
Use the default namesactionResult” and “errorCode” when binding Action elements and Exception paths…

Forget about the “Add note…”-Feature! Structuring workflow part with coloured background just creates a better visual structure for the workflow.

Workflow Organization

Duplicate Workflows for small adjustments! This helps to keep your work big if something has to change in there for the next version.

Don’t use too many Workflow Folders, or clear labes for them! Leave it to the user to figure out which workflows are intended to be called manually, and which ones are just the “drivers” for them.

Create hidden dependencies! Calling Actions or nested Workflows not via the corresponding Elements, but within scriptable tasks creates nice surprises if one is changing the called.

Optimize your JavaScript coding style

You can find a long list of tips for that here: http://thc.org/root/phun/unmaintain.html

Forget vCO, just do scripting!

Who needs the visual, self-explaning graphical flowcharts of vCenter Orchestrator when you can to something like this??:

Pro-Tip: Use the PowerShell-Plugin or the PowerSSHell-Plugin to combine the best of both worlds. This will garantuee your job forever!

:mrgreen: HAPPY APRIL FOOLS’ DAY!!! :mrgreen:

Special Greetings to my mates in Sofia 😎 : Please do not take that criticism of some parts of the vCenter-Plugin-Library personal! I know it’s an hard challenge to maintain this inherited aged content 🙄 . You do a great job, especially with all the new “written-from-scratch” Plugins! Keep them coming!!! 😀

Got more?

Comment on the post and share your finest ideas  how to create poor workflows! 😈

0

Updating the vCenter Orchestrator Appliance to 4.2.1

Note to myself: RTFM!!! RTFM!!! RTFM!!!!

What happend?
I tried to update my vCO Appliance to the current Version 4.2.1 using the built-in update-feature (that’s what we have an appliance for). It stucked with the screen “Installing vCO Appliance – 4.2.1.0 Build 612841, please wait…”, and the vCO service was not running anymore. Even a reboot of the appliance didn’t bring the service up again.

To save you this troubleshooting time:
This behaviour is not really expected, but documented in the Known Issues-Section of the vCenter Orchestrator 4.2.1 Release Notes

Therefore, the complete process to

Update the vCO Appliance to version 4.2.1

1. Login to the Appliance Configuration page

2. Start the Update in the “Update“-Tab

3. Leave the Update-Tab open, and oen a new browser tab with the Orchestrator Configuration, goto Database, confirm that there is a problem 🙂 (“Mismatching database version”)

 

4. On the top of the Database-Section, click to “Update

5. Start the vCO Service in Startup Options

6. Confirm in Appliance Configuration / Update-Tab the new vCO version

7. Orchestrate again!

0

Cool JavaScript code in 140byt.es

This weekend I stumbled over a cool repository to see what’s possible in JavaScript even in very short code snippets:

http://140byt.es

There you find functions and other small examples of JavaScript code in Tweet-length. Mostly very elegant solutions, sometimes hard to understand directly, but always with a longer, annotated version.

Most functions can be used as-is in vCO Scriptable elements, like this one to figure out the ordinal suffix of a number (the “st” of 1st, “nd” of 2nd and so on):


function b(a){return["th","st","nd","rd"][(a=~~(a10&&a3?0:a]}

In a vCO Scriptable Element (or an Action) the annotated long version would look like this (theNumber is an IN-Parameter of type Number):


var ret = ordinal(theNumber);
System.log(theNumber + ret);

function ordinal(
a                         // number
){
return[
"th","st","nd","rd"     // array of ordinal suffixes
][
(a=~~                   // floor the value for usable index (integer)
(a10&&a3                      // all digits above 3 return "th"
?0                      // return "th" for above cases
:a                      // return "th", "st", "rd" for others
]
}

Just be aware that some of the snippets use the prototype-Feature of JavaScript (to extend basic objects with new methods). This is not available in vCO and you will get an error like

Cannot add a property to a sealed object: ….

But there are enough other functions for lots of nice use-cases in vCO. Enjoy! :mrgreen: