What a great time – VMworld 2016 Hackathon rules!

Hi all,

I had an amazing time at the VMworld EMEA 2016 Hackathon last night.  Team 4 was a bunch of smart people working on an interesting issue. We wanted to have a script that would produce a host availability report – just like the MUI did once upon a time.

Perhaps it is worth mentioning that this Hackathon was sponsored by VMware and led by Alan Renouf – Super PM of all things API.  People pick things they want to do and see if they can get teammates and approved.  There was quite a range of things actually.  And some serious rockstars of coding too.  So at the VMworld US I wanted to attend and while I had an idea I was not sure about it.  I was not able to make it and I was somewhat pressured to join this one.  And it turns out my idea – an Availability report script – was not that odd and I ended up with a team and we were approved.

So I ended up in a very nice space, where each team had a table, electricity and food and drink.  Good stuff too!

I thought I would record some of the things I thought important. Something I could review next time – yes, I am hooked and there will be a next time.

  • I had prepared some paper to connect us – screenshots of shutting a host down, what the event looks like, and what the report should look like.  This was worth doing.
  • We had – in some ways – a short script.  Not something that could be broken down and worked on by six people.  So we had one person on the keyboard and it was shared by Webex for all.
  • Some people Googled for supporting info, some people made code suggestions, and some helped with logic.  It worked out well I think, and suited the range of skills.

What did we find while doing our Availability Report?

  • EventID is not what I thought.  It is more of a counter and is zeroed often (every 30 numbers it seems).
  • Event type has no useful info – but it should and I am told that is a bug.  Hopefully in future we might see something like host power action, or shutdown – sometimes we saw “General Event Information”.
  • Tried using task ID’s but linking between tasks was problematic.  We had one task that was start of shutdown, and one that was the shutdown and both with incomplete info.  Connecting them and getting all the info sounded good but turned out difficult.
  • We did find that for host shutdown we found all the necessary info – host, date, time, who, and message.
  • We did find for host power on what we needed – date and time in an event with hostname.

And then – after much work, we had this:


Pretty nice – right?  Not finished, mind you, but it is pretty good for all the trouble and suffering we had.

Below is what made this – and while it works it is not quite finished but I am sharing as I am very happy with it.  It will be updated and eventually end up in GitHub.

[code language=”powershell”]

$temp = $shutdownarray = $poweronarray = $allevents = $null

$allevents = @()
$shutdownarray = @()
$events = Get-VIEvent -maxsamples 10000
$shutdownEvents = $events | Where-Object {$_.Info.Name -eq ‘ShutdownHost_Task’}
ForEach ($event in $shutdownEvents) {
$temp = $events | Where-Object {$_.key -eq ($event.key -1)}
$shutdownarray += $temp
$allevents += $shutdownarray | select @{N=’Host’;E={$_.Host.Name}},CreatedTime,UserName,@{N=’EventTypeId’;E={$null}},@{N=’Message’;E={$_.Message}}

$poweronarray = @()
$poweronevents = $events | Where-Object {$_.EventTypeId -eq ‘esx.audit.host.boot’}
<#ForEach ($event in $poweronevents) {
$temp = $poweronevents | Where-Object {$_.Host.Name -eq $event.ObjectName}
$poweronarray += $temp
#$poweronarray | select @{N=’Host’;E={$_.Host.Name}},CreatedTime,EventTypeId,@{N=’Message’;E={"Host was powered on."}}
$allevents += $poweronevents | select @{N=’Host’;E={$_.Host.Name}},CreatedTime,@{N=’UserName’;E={$null}},EventTypeId,@{N=’Message’;E={"Host was powered on."}}

$allevents | sort Host,CreatedTime


We had a great team of guys – and very multinational too:

  • Erwan Quelin – France
  • Lars Troen – Norway
  • Wil van Antwerpen – Belgium
  • Kyle Ruddy – US
  • Garth Edwards – UK
  • Stephen Byrnes – UK
  • Michael White – Canada

And as you may know, with great people great things happen.  So not only did we get our script working, we won second place! Thanks to everyone.

BTW, here is the picture of the team hard at work:


Here is one with the inventor of the VMware Hackathon:


What a great night!


=== END ===

3 thoughts on “What a great time – VMworld 2016 Hackathon rules!

Leave a Reply