Monthly archives "September 2014"

Windows Server 2012 R2 – Hyper-V Cluster – Updates/Driver/Firmware Consistency Report

As the environment gets bigger, you may face challenges on maintaining the consistency with respect the patches , drivers and firmwares of each cluster nodes. I thought of make a Powershell script which will give a report on the updates/drivers/firmware consistence of a cluster. Along with this, I want to have a check on the Hyper-V specific updates. As you may already knowing, The Technet wiki page for Windows Server 2012 R2 Hyper-V Updates is the place where I keep monitoring for Hyper-V specific patches. This page should be the source which my script needs to cross check. Keeping all this in mind, I started last week.

Challenge 1- Reading the data from http://social.technet.microsoft.com/wiki/contents/articles/20885.hyper-v-update-list-for-windows-server-2012-r2.aspx and making out the list of KBs. I don’t know what all I did , what all options I tried – but successful at last. I know, it may not be the optimal way to make this list. Any help improving this code is highly appreciated.

Challenge 2 – An IE Popup comes related with Internet Explorer Enhanced Security Configuration. May be tweaking iE settings can suppress this. But If you know any option to fix this through my code, Please let me know.

 

Download this script from Technet Gallery.

Screenshots from the report below.

Windows Server 2012 R2 – Hyper-V Cluster – Updates/Driver/Firmware Consistency Report

Windows Server 2012 R2 – Hyper-V Cluster – Updates/Driver/Firmware Consistency Report

 

Windows Updates

Windows Updates

 

HBA Driver Firmware

HBA Driver Firmware

 

Network Drivers

Network Drivers

 

Powershell one liners for Hyper-V

Few Powershell based OneLiners which I use frequently !

 

Identify the best node for placement with respect to memory utilization.

(Get-ClusterNode -cluster CLUSTERNAME |Select Name, @{L="VMCount";E={(Get-VM -ComputerName $_.name).count}},
@{L="AvailableMemory(GB)"; E={(Get-VMHOST $_.Name).MemoryCapacity/1GB-(Get-VM -ComputerName $_.name |Measure-Object MemoryAssigned -Sum).sum/1GB}}|Sort "AvailableMemory(GB)" -Descending)

 

 

PowerShell One Liner - MemoryUsage

PowerShell One Liner – MemoryUsage

 

CSV Usage Statistics

 

Get-ClusterSharedVolume -Cluster CLUSTERNAME| select -Expand SharedVolumeInfo |select FriendlyVolumeName, @{n="Capacity(GB)";e={$_.Partition.Size/1GB}}, @{n="FreeSpace(GB)";e={($_.Partition.Size -$_.Partition.UsedSpace)/1GB}} |Sort-Object "FreeSpace(GB)" |sort "FreeSpace(GB)" -Descending

 

 

CSV Stat

List all VMs in a Hyper-V Cluster

 

Get-ClusterNode -Cluster CLUSTERNAME |foreach {Get-VM -ComputerName $_.Name}

 

 

List all VMs in a cluster with Integration Service version

Get-ClusterNode -Cluster CLUSTERNAME |Foreach {Get-VM -ComputerName $_.name |select name, IntegrationServices
Version}

 

 

List all VMs in a cluster which got a SnapShot/CheckPoint

 

Get-ClusterNode -Cluster CLUSTERNAME |Foreach {Get-VM -ComputerName $_.name|Where {$_.ParentSnapshotId -ne $Null}}

 

List all VMs with DVD/CD information

Get-ClusterNode -Cluster CLUSTERNAME |Foreach {Get-VM -ComputerName $_.name |Get-VMDvdDrive}

 

Mounted DVD Information

Mounted DVD Information

 

List all Hyper-V related errors for the last 24 hours

Get-ClusterNode -Cluster CLUSTERNAME |Foreach {Get-WinEvent Microsoft-Windows-hyper-V-* -ComputerName $_.name|where {$_.TimeCreated -gt (Get-Date).AddDays(-1) -AND ($_.LevelDisplayName -eq "Error" -OR $_.LevelDisplayName -eq "Critical")}|Select Machinename, TimeCreated, LevelDisplayName, MEssage |FL}

 

 

More to come !

 

Cheers.