Hyper-V 2012 Hotfixes: Where I can find it and how to automate the deployment ?

Share this:

After my session at TechEd about Best Practices for Virtualizing and Managing Microsoft SharePoint 2013 with Microsoft System Center 2012 R2 and Windows Server 2012 R2 one of the questions that I got was where I can find the Hyper-V hotfixes and how can I automate the deployment process.

Where I can find the most update list of Hotfixes for Hyper-V 2012 and Hyper-V 2012 R2? I found a couple of years ago on TechNet Wiki a page where they announce public the hotfixes. Now it’s easy for me, because being an MVP I have this information sooner and I always try to publish when I get it! But for the common mortal, I highly recommend the TechNet Wiki Page (you can find HERE).

To automate the process or to install those hotfixes on Hyper-V Server Core, you can use the PowerShell cmdlet that Hans Vredevoort (@hvredevoort) created that will simplify your process and make your life easier.

This script will help to identify what hotfixes and updates are installed and what is missing. To run this tool you will need the .XML file that have all the updated list. These .XML files must be on the same directory where the PowerShell script will run (or you have to edit the script with the correct location).

One of the ways, that did found out that worked very well for me, and I always use it when I deploy Hyper-V server, it is enable the RSS on the TechNet Wiki page and then when you received the notice that they have news hotfixes or updates, you grab the XML files and run the tool.

You can find the all the scripts and XML (up to date) HERE.

The script it’s not very complex, but it’s very effective!

param

(

[parameter(mandatory=$True)]

[String[]]$HyperHostName

)

#Getting current execution path

$scriptpath = $MyInvocation.MyCommand.Path

$dir = Split-Path $scriptpath

$version = “This list was updated on April 17, 2014 by @hvredevoort”

#Loading list of updates from XML files

[xml]$SourceFileHyperV = Get-Content $dirUpdatesListHyperV.xml

[xml]$SourceFileCluster = Get-Content $dirUpdatesListCluster.xml

$HyperVHotfixes = $SourceFileHyperV.Updates.Update

$ClusterHotfixes = $SourceFileCluster.Updates.update

#Getting Hotfixes installed on the specified Hyper-V Host

foreach($VMHost in $HyperHostName)

{

$Hotfixes = Get-HotFix -ComputerName $VMHost |select HotfixID,description

Write-Host $version $HyperHostName -ForegroundColor Green

Write-Host “COLLECTING HOTFIXES ON HYPER-V HOST: ” $HyperHostName -ForegroundColor Yellow

Write-Host “Listing Hyper-V 2012 R2 Hotfixes” -ForegroundColor Yellow

foreach($RecomendedHotfix in $HyperVHotfixes)

{

$witness = 0

foreach($hotfix in $Hotfixes)

{

If($RecomendedHotfix.id -eq $hotfix.HotfixID)

{

Write-Host “————————–”

Write-Host “Hyper-V Host: “$VMHost

Write-Host $RecomendedHotfix.Id “installed” -ForegroundColor Green

write-host $RecomendedHotfix.Description

Write-Host “————————–”

$witness = 1

}

}

if($witness -eq 0)

{

Write-Host “————————–”

Write-Host “Hyper-V Host: “$VMHost

Write-Host $RecomendedHotfix.Id “not installed” -ForegroundColor Red

write-host $RecomendedHotfix.Description

Write-Host “————————–”

}

}

Write-Host “Listing Failover Cluster 2012 R2 Hotfixes” -ForegroundColor Yellow

foreach($RecomendedClusterHotfix in $ClusterHotfixes)

{

$witness = 0

foreach($hotfix in $Hotfixes)

{

If($RecomendedClusterHotfix.id -eq $hotfix.HotfixID)

{

Write-Host “————————–”

Write-Host “Hyper-V Host: “$VMHost

Write-Host $RecomendedClusterHotfix.Id “installed” -ForegroundColor Green

write-host $RecomendedClusterHotfix.Description

Write-Host “————————–”

$witness = 1

}

}

if($witness -eq 0)

{

Write-Host “————————–”

Write-Host “Hyper-V Host: “$VMHost

Write-Host $RecomendedClusterHotfix.Id “not installed” -ForegroundColor Red

write-host $RecomendedClusterHotfix.Description

Write-Host “————————–”

}

}

Write-Host $version $HyperHostName -ForegroundColor Green

}

Written by Marcos Nogueira

With more than 17 years’ experience in Datacenter Architectures, Marcos Nogueira is currently working as a Chief Technology Officer at NogaIT Consulting. He is an expert in Private and Hybrid Cloud, with a focus on Virtualization, System Center and Microsoft Azure. He has worked in several industries, including Aerospace, Transportation, Energy, Manufacturing, Financial Services, Government, Health Care, Telecoms, IT Services, and Gas & Oil in different countries and continents.

Marcos is an MVP in Hyper-V and he has +12 years as Microsoft Certified, with more than 80+ certifications (MCT, MCSE, and MCITP, among others). Marcos is also certified in VMware, CompTIA and ITIL v3. He assisted Microsoft in the development of workshops and special events on Private Cloud, System Center, Windows Server, Hyper-V and as a speaker at several Microsoft TechEd and communities events around the world.