A New Year and it came with a Microsoft MVP Renewal for 2013

I’m a January 1st MVP. That means that on the 1st January I get an e-mail that brings news of a renewal or not … so apart from celebrating the new year relaxing a bit we also keep an eye on our inbox. This is what arrived just now:

Dear Didier van Hoye,
Congratulations! We are pleased to present you with the 2013 Microsoft® MVP Award! This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others. We appreciate your outstanding contributions in Virtual Machine technical communities during the past year.
The Microsoft MVP Award provides us the unique opportunity to celebrate and honor your significant contributions and say "Thank you for your technical leadership."

Mike Hickman
Director
Community Engagement
Microsoft

Great news to start the new year with. While you get the MVP reward for contributions over the past year to the community I must say that being active in the community is a very rewarding endeavor in itself. For my job I need to figure out a lot of things and I like to share them, including my mistakes, for the benefit of all. Sharing means communication, which leads to questions and discussions that help all of us gain a better knowledge of how things work. It’s not one way traffic. They say there is no better way to learn a subject that to teach it or write a book on it. I think that holds true. Heck, “just” doing a presentation on one subject helps. There’s a constant stream of new capabilities and options that can be leveraged to achieve our goals and being able to discuss these with so many experts from different environments makes a lot of difference in wrapping our heads around it all.

It also helps me be better at my job. So it also helps my employers. In that respect I have very good bosses. They invest in their people without hesitation. They don’t fear the possibility that we might leave for greener pastures. Instead they focus on getting the best out of us and support this actively. Pretty smart and we all gain something from this, as this makes for a very nice green pasture to stay on and they get knowledgeable, motivated employees.

I’m very happy and I’m looking forward to seeing many of my fellow MVPs in Redmond in February for the 2013 MVP Global Summit. Last year’s summit was very educational. It was also a blast to meet so many people in real life for the very first time and talk shop. Thank you all for the opportunities, the challenges and the continuous learning journey.

To conclude I wish all my community buddies and readers a wonderful and happy 2013!

Join Us For The VKernel (Dell) VIRTu Alley Online Symposium

VIRTu Alley Online Symposium

vKernel (now part of DELL) is kicking of 2013  with the VIRTu Alley Online Symposium. It runs over two days and focuses on virtualization and cloud management. virtu-alley-c96ba660

When

VIRTu Alley takes place on Tuesday, January 15th from 10:00 – 13:00 EST and on Wednesday, January 16th from 10:00-13:30 EST. Don’t forget it’s EST. Meaning that you need to add 5 hours if you’re in GMT (Dublin) or 6 Hours if you’re in GMT +1 (Brussels)

Where

From the comfort of your office & home  Smile

Agenda

Go to the Virtu Alley web page and have a look at the agenda for both days. you’ll see they’ve mananged to line up some great speakers. Some of them I know personally. Aidan Finn and Damian Flynn (MVP and published authors) are both presenting on day 2 just like myself. Aidan on what’s new & improved in Windows Server 2012 Hyper-V and Damian on Network virtualization. I will be speaking on Advanced Hyper-V Maintenance with Cluster Aware Updating.

It’s Free

The event itself if free but you do need to register for each day on which you want to attend sessions.

See you there!

What New Years Gift For IT Professionals? The Windows Server 2012 Hyper-V Installation And Configuration Guide!

Aidan Finn, Damian Flynn, Patrick Lownds and Michel Luescher wrote a reference work about Windows Server 2012 Hyper-V.

image

I kindly suggest that you add this to your professional library as soon as possible. Unless you’re part of our IT Pro team, who’ll find a couple of copies on their desk as soon as Amazon can deliver them, you’ll need to ask Santa Claus to bring you one. If Santa Claus doesn’t like you, buy it yourself. For the help you’ll get out of this it’s a steal. You see, I know the authors and a reviser (Hans Vredevoort). And I assure you, reading what these guys have to tell on this subject is truly standing on the shoulders of giants Smile.  Reading this book allows you to tap into their collective brainpower and knowledge on this subject, which is extensive. These guys are part of the Hyper-V community and they live in this stuff!

So if you want to learn about Windows Server 2012 Hyper-V fast and effectively grab this book (pre order it here on Amazon). It’s full of guidance, explanations, examples and scripts to get you going in the right direction from the moment you start working with Hyper-V. This is a career boosting (and protecting) guide for all of us to leverage.

Thank you guys!

Monitoring Startup,Shutdown and restart of a Virtual machine With PowerShell 3.0

During scripting some maintenance PowerShell scripts for Hyper-V guests I felt the need for a more accurate way to monitor the startup of a virtual machine. Pings, telnet to a known open port it all doesn’t do the job accurately enough as I want to know when CTRL+AL+DEL appears on the screen. So I pinged Jeff Wouters who told me I could monitor Get-VM -Name DC01 | Get-VMIntegrationService  to detect when PrimaryStatusDescription goes to “OK”.

Now when you look at the Integration services there are 5 of them.

image

Which one is the best to use for our purpose? Well,I tested them out and after some experimenting with the various services I concluded that the PrimaryStatusDescription of the  Key-Value Pair Exchange works best for this purpose. All others become available a bit to soon in the process of starting a VM, which seems logical.

Monitor a starting virtual machine

So how to use this in a script? We’ll here’s a snippet to monitor the boot process of a guest.

$Vm = Get-VM "MyVM"
start-VM "$Vm"
#This means the VM is now shutting down ...    
$Counter = 0
$ProgressCount = 0
Do
{    
    $Operational = Get-VM -Name $VM | Get-VMIntegrationService -Name "Key-Value Pair Exchange"
    $Counter = $Counter + 1 
    $ProgressCount =  $ProgressCount +1
    $PercentComplete = ($ProgressCount * 20)
    Write-Progress -Activity "$VM" -status "VM starting up: $Status - Progressbar indicates activity, not a percent of completion: ($Counter Seconds)"  -percentComplete ($PercentComplete / 100 *100)
    if ($PercentComplete -gt 90) {$ProgressCount = 0}
    sleep 1
}
While ($Operational.PrimaryStatusDescription -ne "OK")
$Status = (Get-VM -Name $VM | Get-VMIntegrationService -Name "Key-Value Pair Exchange").PrimaryStatusDescription
Write-Progress -Activity "VM $VM is up and running" -status "VM status: $Status - We're done here. Completed in a total of $Counter seconds."  -percentComplete (100)

 

Monitor a stopping virtual machine

Likewise, sometime we want to monitor a VM shutting down, which is the same code as above but with reverse logic.

$Vm = Get-VM "MyVM"
stop-VM "$Vm"
$Counter = 0
$ProgressCount = 0
#This means the VM is now shutting down  in the retart cycle ...    
   Do
   {            
    $Operational = Get-VM -Name $Vm | Get-VMIntegrationService -Name "Key-Value Pair Exchange"
    $Counter = $Counter + 1 
    $Status = (Get-VM -Name $Vm | Get-VMIntegrationService -Name "Key-Value Pair Exchange").PrimaryStatusDescription
    $ProgressCount =  $ProgressCount + 1
    $PercentComplete = ($ProgressCount * 20)
    Write-Progress -Activity "$VM" -status "VM shutting down : $Status - Progressbar indicates activity, not a percent of completion: ($Counter Seconds)"  -percentComplete ($PercentComplete / 100 *100)
    if ($PercentComplete -gt 90) {$ProgressCount = 0}
    sleep 1
   }
   While ($Operational.PrimaryStatusDescription -eq "OK")
   $Status = (Get-VM -Name $Vm | Get-VMIntegrationService -Name "Key-Value Pair Exchange").PrimaryStatusDescription
   Write-Progress -Activity "VM $Vm has now been shutdown" -status "VM status: $Status - We're done here. Completed in a total of $Counter seconds."  -percentComplete (100)

Monitor a restarting a virtual machine.

When in a PowerShell script you want to monitor progress of a virtual machine restarting you can combine both. You monitor shutdown and you monitor startup.

$VmThatRestarts = Get-VM "MyVM"
#Restart the VM
#This means the VM is now shutting down  in the retart cycle ...
 $Counter = 0
 $ProgressCount = 0
Do
{            
    $Operational = Get-VM -Name $Vm | Get-VMIntegrationService -Name "Key-Value Pair Exchange"
    $Counter = $Counter + 1 
    $Status = (Get-VM -Name $Vm | Get-VMIntegrationService -Name "Key-Value Pair Exchange").PrimaryStatusDescription
    $ProgressCount =  $ProgressCount + 1
    $PercentComplete = ($ProgressCount * 20)
    Write-Progress -Activity "$VM" -status "VM restarting - Shutdown phase : $Status - Progressbar indicates activity, not a percent of completion: ($Counter Seconds)"  -percentComplete ($PercentComplete / 100 *100)
    if ($PercentComplete -gt 90) {$ProgressCount = 0}
    sleep 1
}
While ($Operational.PrimaryStatusDescription -eq "OK")
$Status = (Get-VM -Name $Vm | Get-VMIntegrationService -Name "Key-Value Pair Exchange").PrimaryStatusDescription
Write-Progress -Activity "VM $Vm has now been shutdown in restart cycle" -status "VM status: $Status - VM has shut down in $Counter Seconds"  -percentComplete (100)
   
#Any thing worthwhile is worth adding 1 second of waiting for good measure :-)
Sleep 1

#This means the VM is now starting  ...    
$ProgressCount = 0
Do
{    
    $Operational = Get-VM -Name $VM | Get-VMIntegrationService -Name "Key-Value Pair Exchange"
    $Counter = $Counter + 1 
    $ProgressCount =  $ProgressCount +1
    $PercentComplete = ($ProgressCount * 20)
    Write-Progress -Activity "$VM" -status "VM restarting - Startup phase: $Status - Progressbar indicates activity, not a percent of completion: ($Counter Seconds)"  -percentComplete ($PercentComplete / 100 *100)
    if ($PercentComplete -gt 90) {$ProgressCount = 0}
    sleep 1
}
While ($Operational.PrimaryStatusDescription -ne "OK")
$Status = (Get-VM -Name $VM | Get-VMIntegrationService -Name "Key-Value Pair Exchange").PrimaryStatusDescription
Write-Progress -Activity "VM $VM is up and running again" -status "VM status: $Status - We're done here. Completed in a total of $Counter seconds."  -percentComplete (100)

Note that in all the above snippets  I’ve thrown some logic in to us the progress bar as an activity bar as I know of no way to calculate real % done in a startup, shutdown, restart process. It looks something like this in ISE

image

or like this in a PowerShell prompt

image