About Author: Joerg Lew

Posts by Joerg Lew

0

Let your vCO Workflow text you! Yes, via SMS!

Working on another blogpost on some design best-practices for workflows (stay tuned…) a promising idea came into my mind:

What about sending text messages to my mobile from workflows?

I guessed there are many SMS-Gateway-Services out there which provide any kind of SOAP or REST-API… (I want to leverage an existing plugin for vCO for quick results). So google came up with this nice discussion:

http://stackoverflow.com/questions/2383542/recommendations-for-sms-gateways-with-api-support

I decided to give https://www.clickatell.com a try, because they

  • provide interational service
  • provide multiple kinds of API
  • seem to be reliable and widely used
  • don’t force you in a contract/monthly plan for my limited test usage

What you need to reproduce this example:

  • a clickatell account (I think it will work with most of the other SMS-Gateway services in a comparable fashion)
  • the REST-Plugin for vCO installed in your Orchestrator environment (see details here: http://www.vmware.com/support/pubs/vco_plugins_pubs.html (Select HTTP-REST for the plugin-download and a bunch of examples)

Step-by-step…

I quickly signed-up for an account, used the web-form to send a test message to German) mobile number, and prepaid for some credits to be able to send via the API.

After that, I created a new access for the “HTTP”-API of clickatell (no special settings):

(You may open clickatell’s API Documentation now in background if you’re a read-first-try-then kind of guy.)
For myself I just started my vCO client and ran the “Add a REST host”-Workflow from the library, providing just a name and http://api.clickatell.com as URL:

The workflow finished sucessfully, I confirmed the new host in the Inventory:

Now I called the “Add a REST operation”-Workflow to invoke the API-Call to clickatell (based on their example given when creating the API account):

(instead of hardcoding my credentials I used the generic {parameter}-notation of the REST-plugin for all the necessary parameters like username, password, API-Id, …, so that I can re-use the  operation later flexibly). The full “Template URL” value is:


/http/sendmsg?user={username}&password={password}&api_id={apiid}&to={tonr}&text={message}

When the operation was created (again: Confirm in Inventory-Tree) I started the “Invoke a REST operation” workflow providing all the input parameters:

aaand voila,  😎 seconds later the text messgae arrived on my mobile!   :mrgreen:

Now, the real-world use-case:

Well, sending generic messages to a mobile from a vCO workflow is cool|geeky, but what for? For a realistic example I used the Workflow-Generation of the REST-Plugin to let vCO generate my very own “Invoke ‘send a text message'”-Workflow in my very own Workflow folder for easy re-usage:

So I was able to re-use the created workflow in my Snapshot-Hunter-Workflow… (you know the pain with backup software which accidentally forgets to cleanup the VM snapshots! :evil:)

(The first element to find these workflows leverages the xpath-filter of the VcPlugin.getAllSnapshots()-Method, see the discussion here: http://communities.vmware.com/thread/342686 and http://communities.vmware.com/message/1673575 )

At the end: After scheduling the workflow as Scheduled Task in vCO, starting from tomorrow I will get waked-up by my mobile receiving an text message from vCO when there are leftover snapshots from the nightly backups!

Summary

  • Don’t fear any tasks integrating vCenter Orchestrator! When the external system provides an API, chances are that you get in run in a few minutes…
  • Remember: less and simple workflow inputs make it easy to use, many and generic workflow inputs make it easy to re-use! (referencing the “Workflow Development Best Practices”-session as a shameless plug :mrgreen:)
  • Sometimes it IS good to be creative|distracted when drafting a blog-post (expect the post I actually was working on soon…)
  • Turn off your mobile when you want to sleep in!
  • …and thank god I’m too tired to think about other use-cases for this…
    (I will not make an Orchestrator & Ringtone joke!
    I do not plan to provide a monthly subscription for my content, just text a SMS with “vCO Rockz!” to …..
    And I better not search for an API for Asterisk (“If you want to execute workflow XYZ, press 1; for all other requests press 2” 8-O)

Download the example

SnapshotHunter Package
SnapshotHunter Package
de.vcoportal.snapshothunter.package
23.3 KiB
Details...

Be aware that it will NOT run out-of-the-box, because you have to add the REST-Host and the Operation in your environment! And: Don’t forget to set the necessary values for username, password, mobilenr, … in the configuration elements.You know that blogpost whith a great description of Configuration Elements, don’t you! 😛

0

Off-topic(?): Lessons learned with Wavemaker

During the last months I was involved in a Wavemaker project. It was NOT related to vCO, as you might have expected when reading these:

It’s just a greenfield database application with some integration into existing other systems.

So here are my lessons learned so far (more will come, I’m quite sure):

  • Clear your Browser Cache. Early and often.
  • Use the Browser debug features. Firebug and Chrome Developer Tools are your friend. See here and here for details.
  • Watch wm.log for Hibernate, ServerSide and JavaServices stuff.
  • Don’t forget to go to sleep.
  • Typing of Wavemaker Variables might be tricky, when accessing them in JavaScript or passing them to JavaServices. Check the browser debugger for correct JSON!
  • The built-in (generated) Widgets for Database access are really nice and a good timesaver when you want to create a 1:1 UI for common CRUD-tasks for the database tables. If you want to do more complex things (which involve multiple tables) and in general want to understand  what happens in background, start from scratch!
  • The Community Forums on http://dev.wavemaker.com/forums/ RULE! Comparable to the PowerCLI forums (and hopefully the vCO forums over time as well) in VMTN you find good answers with a lot of ready to use code examples for every question you have… Just make sure you pick an example that fits to the Wavemaker version you use!
  • Learn Hibernate.
  • Go to sleep!
  • HQL rocks!
  • The built-it database mnodeling tools is cool, but you might get confused about the relational vs. object-oriented way for data modeling => Again: Learn Hibernate and HQL.
  • Go. To. Sleep.
  • Dear Wavemaker team: Where is my “Parameters References”-Tab in the GUI?
  • Don’t hesitate to read Jira Bug reports. There might be some bugs which are important for your use cases!
  • Do not oversee the Reference Documentation for the Client Side Widgets and the Server Side!
  • The documentation is great, but sometimes too much! You get confused when you find 3 different code examples to solve the same problem.
  • gotosleep
  • Use Eclipse and its integration to SVN/GIT for source code management, and leverage the export/import features for the deployment process.
  • Coudfoundry is a great platform for dev/test! No further local setup needed.
  • Spring Roo is not integrated yet, unfortunately 😥 . It would be great if you can leverage Roo for the data layer. See the discussion here
  • Go to slzzzzzzzzzzzzzzzzzzzz
0

(No) Sneak Peek on upcoming vCO release :-)

UPDATE: I quickly got a lot of friendly and some not so friendly response to this post, so here the updated version only with information you already can find in the community forums, on youtube, word of mouth …

My main purpose of this article was to let the people know there will be some changes when integrating with vCO.
So, if you plan to integrate with vCO, please talk to your VMware Representative before you start in the wrong direction or learn old and outdated technologies!
So, if you are a VMware Representative: Please give the users/customers a future-proof point of view. Customizing Webviews and spending a lot of effort to dig deep into the current SOAP-API is not.

Disclaimer: The following article represents my personal point of view and the words and rumors I got. All that stuff is not official yet, the roadmap may change, do not ask for specific dates…. You got the point.
However, if you plan to leverage vCO as a partner or end customer, consider to contact your VMware representative; especially if you plan to integrate with vCO because of the changing Webservice API (details below).

Two weeks ago at VMware Partner Exchange (PEX) in Las Vegas there were a couple of sessions which included vCO (compared to last year I saw an increase by  ***ERROR(DIVISION BY 0)*** :mrgreen: % from 0 to 5 sessions covering vCO)

vCenter Orchestrator Versions

vCenter Orchestrator is bundled with vCenter (and will be in future), so the platform has the same release cycle as vCenter. (Plugins are relesead independently, as you can see on the many plugins released in the last quaters)

New Features

… (stay tuned 🙂 )

New REST-based Webservice API

The current version 4.x of vCO contains an (old) SOAP-based Webservice API which allows you to call and monitors workflows from external systems (see the articles in the this category for how-tos).

This API opens vCO to be integrated as headless orchestration layer, called by external systems like a ticket-system, a nice-looking Web-Interface/Self-Service Portal (helloooooo, Wavemaker!) or a more business process focused Workflow engine. Another  great use-case for this API is to automate tests around workflows, actions and plugins.

From the numbers of requests I get related to my examples to call workflows e.g. from Powershell, this API is quite often used (and I can double this with my field experience: In every larger vCO project workflows are to be called by external systems eventually)

However, the old API is quite limited (see details in this article) right now.
With  vCO 5.1 a new REST based API will be available. Along the information I have, this API will be much more powerful and easier to use. The REST-based access strategy for instance could make it very easy to access inventory objects as input parameters for workflows, which was a real pain in the current SOAP-API.

AFAIK the old SOAP API will be marked as deprecated, but still stay available and supported “as-is”. So you have a smooth migration path if you already leverage the API.

I can’t wait to get my fingers on the new version. From my point of view this will be the biggest milestone in the history of vCO since Dunes’ aquisition by VMware back in 2007. It’s about time. :mrgreen:

0

vCO @VMwarePEX 2012

In a few day VMware Partner Exchange 2012 kicks off in Las Vegas. Besides a lot of pre-conference Bootcamps, Exhibition Hall and and the party there are of course many breakout sessions.

Some of them (3 more than last year :mrgreen:) also contain vCenter Orchestrator topics, as stated in their proposal in the content catalog https://vmware.expoplanner.com/?do=cfp.sessions (on Twitter: #VMwarePEX )

  • (TEX1485) Plug & Play Automation with vCenter Orchestrator – Workflow Development Best Practices
  • (CIM1206) vCloud Director 1.5 Solution Integration
  • (CIM1338) IT Automation does not equal Cloud, but automation is critical to the success of Cloud environments

A lot more sound very interesting for vCO developers, too:

  • (TEX1454) Integrating with the Guest Operating System using the vSphere SDK
  • (TEX1533) vCloud and vSphere Roadmap and Storage Programs Overview
  • (TEX1261) Building apps on top of the vCloud API
  • (CIM1296) Cloud Integration Workflows with VMware Service Manager
  • (CIM1375) Unleash the power of the new vSphere Web Client SDK
  • (TEX1184) vSphere API Best Practices

Make sure to add them to your session planner, as I expect a huge crowd for all these sessions 😀 !

If you know more sessions containing vCO, or you as speaker are talking about vCO, feel free to increase the list with a comment…
Wir sehen uns in Las Vegas wieder 😎 !

0

Use the Workflow Validation tool in vCO!

One of the first things I got teached during my studies was: Always deliver code that compiles with

0 Warnings, 0 Errors“!

We had to follow that principle while trying to let LEDs blink (I miss a vCO-Plugin for MPC555 :-D) , but I still remember my Prof.’s words when I develop workflows.

The vCenter Orchestrator provides a Workflow validation mechanism, which checks the workflow for

  • open ends
  • unreachable workflow elements
  • unused workflow Attributes
  • unbound IN- and OUT parameters of workflow elements
  • formal errors in scriptable tasks (JavaScript)
  • unbound Exceptions (if you use an Exception connector)
  • Unset parameters in Configuration Elements

You can run the validation by pressing the “Validate”-Button in the Workflow editor, or in the context menu of a workflow in the workflowlList.

The results of the validation is shown in a popup window. There are two kinds of validation issues:
Errors are hard formal violations which prevent the workflow from running sucessful.
Warnings are “soft” violations: Your workflow can be started, but it likely has some bugs.

For some of the validation results “Quick Fix actions” are recommended. They might fix the issue, but do not trust them blindly!

When you ran the validation at least once, errors and warnings are also shown as small red or yellow symbols directly at the related workflow element in the schema. This is very helpful for larger workflows!

By default a workflow is also validated before you start it (only when you try to start the workflow in the vCO Client, not via weboperator nor the SOAP API!). If your workflow has an error (warnings don’t matter), you cannot start the workflow, and you’ll get this error message:

You can change this behavior in the menue “Tools / User Preferences… ” of the vCO client, there in the “Workflows”-section (the checkbox is labeled with “Validate workflow before running it”). I recommend to only do this in your development environment, when you want to start workflows with errors (e.g. while they’re not developed completely yet)!

Also be aware:
The Workflow Validation only can check for formal errors. Semantic errors in your workflow and its JavaScript parts can not be detected by the validation.
A valid workflow is not necessarily error-free!

In very rare caes you also might get some false positives in the validation results. The only situation I remember is, when you need a workflow attribute only for input presentation processing, but not in the workflow: You’ll get a “Attribute XYZ is never used!” warning (, and the quick-fix would delete it and break the processing of input presentation!).

In sum: Always end up with a workflow that shows “0 Warnings, 0 Errors“! :mrgreen: