Onyx – Why Learn PowerCLI ?

The PowerCLI Team yesterday published with the Onyx Project a great tool with lots of potential. The blogging community received Carter’s announcement enthousiastically (see for example The Onyx has landed).

As a casual PowerCLI user you might think, the product has a strange name but it is the answer to all my scripting and automation needs. Why should I bother learning all these PowerCLI cmdlets while this tools produces working code. But think again !

A word of warning by the Surgeon General, or Alan and Luc in this case 😉

Warning !

Whilst Onyx is a great utility to help you automate your vSphere environment it is not there, in our opinion, to replace your knowledge of PowerCLI and to a lesser extent the SDK.

To start with, Onyx does not produce a fully working script which you can take to any site and run. And it does not produce optimised code that will help you better understand PowerCLI.

For example… In Carter’s Onyx video you were shown how to change the mac address of a VM. Perform the action once in the vSPhere client, trace the action with Onyx and voila you get around 30 lines of code.

But this is something we could have done the PowerCLI way, and not in 30 lines of code, but in just 1 line of code:

See what we mean !

Some other random considerations concerning the Onyx Project:

  • Onyx will potentially produce lazy programmers/scripters. At first sight there is no more reason to learn PowerCLI nor the SDK APIs.
  • As the previous example showed it doesn’t produce optimal code.
  • Not all SDK possibilities are possible via the vSPhere Client. You will never learn these if you don’t learn the SDK APIs.
  • The vSphere Client is not a bug-free product. See for example CreateAlarm not (always) compatible with the vSphere Client.
  • There is a potential danger that users will start executing the Onyx generated scripts without actually knowing what they are doing.
  • Like Carter already mentioned, the generated scripts are for specific objects/entities. Your script will require extra coding to make them global/general.

Don’t get us wrong, we think Onyx will definitely be helpful and will certainly help us find things that are obscure. But remember, it will not be the death of good old thinking, understanding and coding.

So please, continue your quest for the holy grail of all that is VMware automation…. and learn PowerCLI.

We would be interested in your comments on our reflections !

Alan and Luc.


This entry is also published on Virtu-Al.


Leave a Reply

Your email address will not be published. Required fields are marked *

*
*

Buy the Book