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 my previous post 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:

Set-NetworkAdapter -NetworkAdapter (Get-VM MyVM | get-NetworkAdapter) -MacAddress 00:50:56:3f:6d:88”

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.

Alan and Luc.

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 !

This entry is also published on LucD Notes.

4 thoughts on “Onyx – Why Learn PowerCLI ?

  1. Pingback: VMworld PowerCLI Group Discussion–Part 4–Advanced tools and scripting - Virtu-Al.Net

  2. Virtu-Al

    @Carter Shanklin
    Sounds like a great idea, the product is great and has certainly helped me out a few times but I think it was worth making sure people know its Pro’s and Con’s.

    Thanks for your comment sir.

  3. Carter Shanklin

    Right now Onyx is very much an expert’s tool. My hope is that some day we will be able to take the generated code and refactor it into a PowerShell v2 Advanced Function that you could directly insert into your pipelines. When/if that happens this really would be good for users at all levels. Unfortnately this latter part is a pretty hard problem.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.