Archive for the ‘Windows 2012’ Category

Recommended hotfixes for Windows 2012 R2 failover clusters

April 27, 2016

there is no more the need to keep your own lists of clustering patches as this is now summarized in KB2920151. this includes the recommended Failover Cluster and as well the Hyper-V patches

Windows Server 2012 Failover Cluster patches are covered in KB2784261 and the recommended patches for Windows Server 2012 Hyper-V can be found here

worth to take a look at it to keep your clusters healthy, stay tuned

Powershell – How to get total VM memory overview (dynamic, static and startup memory) per node in a cluster?

June 16, 2014

Host Memory Pressure – I think this is one of the keys (in addition to storage, network, CPU) in performance when running virtualization with dynamic memory and should be monitored. An balance between high density of running VMs on a host and memory calculation/demand is something to consider when managing self service clouds and/or running memory intensive workloads.

Write-host " "
Write-Host " "
$Cluster = Read-Host "Cluster Name "
Write-Host " "
Write-Host "Starting to check VM Memory pressure on $Cluster nodes " -ForegroundColor green
Write-Host " "
Write-Host "Collecting data like nodes, VMs Memory….please be patient" -ForegroundColor green
Write-Host " "
Write-Host " "
$Hostnames=(Get-Cluster $Cluster | Get-ClusterNode).Name

foreach ($Host1 in $Hostnames) {
[int]$hostmem=@{} | Out-Null
[int]$totalstartupmem=@{} | Out-Null
[int]$totalmaxmem=@{} | Out-Null
[int]$staticmemory=@{} | Out-Null
[int]$overcommited=@{} | Out-Null
[int]$totalramrequired=@{} | Out-Null

$AllVMs=(get-vm -ComputerName $Host1).Name
$Hostmem=(Get-VMhost -ComputerName $Host1).MemoryCapacity / 1024 / 1024 / 1024

foreach ($VM in $AllVMs) {
$CurrentVM=(get-VM $VM -ComputerName "$Host1" | fl *)
if ((Get-VMMemory -vmname $VM -ComputerName "$Host1").DynamicMemoryEnabled -eq "True") {
$memorystartup=(get-vm $VM -ComputerName "$Host1" | select-object MemoryStartup).MemoryStartup /1024 / 1024 / 1024
$MemoryMaximum=(get-vm $VM -ComputerName "$Host1" | select-object MemoryMaximum).memorymaximum /1024 / 1024 / 1024
$totalstartupmem += $memorystartup
$totalmaxmem += $MemoryMaximum
else {
$static=(get-vm $VM -ComputerName "$Host1" | select-object MemoryStartup).MemoryStartup /1024 / 1024 / 1024
$staticmemory += $static
$totalramrequired=$totalstartupmem + $staticmemory

write-host "Summary Report for Host $Host1" -foregroundcolor green
write-host "Total Startupmem for Dynamic VMs $totalstartupmem GB " -foregroundcolor green
write-host "Total Staticmem for Static VMs $staticmemory GB " -foregroundcolor green
write-host "Total minimum RAM (Startup+Static) required $totalramrequired GB " -foregroundcolor yellow
write-host "Total Maxmem for Dynamic VMs $totalmaxmem GB " -foregroundcolor yellow
write-host "Total available memory $Hostmem GB " -foregroundcolor green
if ($totalmaxmem -gt $Hostmem) {Write-Host "$Host1 is overcomitted " -foregroundcolor red}
write-host " "
write-host " "


This is just one way to get a total summary per node in your Hyper-V cluster and their configured memory demand. It provides a quick view on memory utilization of your Hyper-V nodes. Be creative and modify based on your needs.

Disclaimer: Please read and test script before you run in your production!

Dynamic Memory Pressure Monitoring:

…a “bad” configuration can result in “bad” performance 🙂

Stay tuned…

Failover Cluster – Recommended hotfixes and updates for Windows Server 2012 RTM and R2 based clusters

May 20, 2014

Checkout KB2920151 for getting a comprehensive list of the recommended hotfixes and updates for clusters based on Windows Server 2012 R2

+ Checkout Rollup Update June which includes several Hyper-V and Cluster relevant patches too.

Same exists for Windows 2012 RTM based clusters too

Also take a look at the Cluster-Aware Updating feature which is introduced in 2012 R2 –> Cluster-Aware Updating Overview 

….Stay tuned 😉

How to configure Preferred Owners and AutoFailback with Powershell in Failover Cluster?

April 7, 2014

Consider scenario, you “balanced” your VMs across your nodes and you come back in the morning and they are migrated “for whatever reason” to different nodes. But as a typical administrator 😉 you know your workload best and you want to keep them preferred on a targeted node. In case of an unexpected reboot the VMs will get migrated to next available node in your Failover Cluster and goal is as soon as the node is back the VM should automatically fail back = PreferredOwners. 

Here is a quick example where you configure all clustered VM roles in a targeted cluster for preferred owners based on the current owner node. this should only give you an idea how things can be automated very easily with Powershell:

$Cluster = Read-Host "Cluster Name "
$Praefix = Read-Host "Please provide präfix for your clustered VM role names (a.e.SCVMM) "
Write-Host " "
Write-Host "Getting all clustered VM roles and configure Preferred Owners in cluster $Cluster" -ForegroundColor yellow
Write-Host " "
Write-Host " "
$AllClusterGroup = Get-ClusterGroup -Cluster $Cluster -Name $Praefix*

Write-Host "….running loop for all Clustered VMs"
Write-Host " "
Write-Host " "
foreach ($ClusterGroup in $AllClusterGroup)
    $ClusterGroupDetails = Get-ClusterGroup -Name "$ClusterGroup"
    Write-Host "Getting current Owner for $ClusterGroup…." -ForegroundColor yellow
    $CurrentOwner = $ClusterGroupDetails.OwnerNode.Name

    Set-ClusterOwnerNode -Group $ClusterGroup $CurrentOwner
    Write-Host "Current owner for VM $ClusterGroup is $CurrentOwner, configure Preferred Owner…done" -ForegroundColor yellow
    #Enable Autofailback
    (Get-ClusterGroup -Name "$ClusterGroup").AutoFailbackType=1
    Write-Host "Enabling Autofailback VM $ClusterGroup…done" -ForegroundColor yellow
    Write-Host " "

Disclaimer: Please read and test script before you run in your production, this reconfigures the preferred owner property at all your clustered VM roles in your cluster !!

There are more options how you can control clustered roles, like “AntiAffinityClass” – when a group is moved during failover, anti-affinity affects the algorithm used to determine the destination node. a.e. never run together at same node…

Here are just a few more good resources around failover options in a Failover Cluster:

Preferred Owners in a Cluster

Failover behavior on clusters of three or more nodes

Understanding Hyper-V Virtual Machine (VM) Failover Policies

Modify the Failover Settings for a Clustered Service or Application

Configure Failover and Failback Settings for a Clustered Service or Application


Using Guest Clustering for High Availability

How to deploy an “classic” terminal server with Windows 2012

March 18, 2013

Since Windows 2008 the “oldschool” and well known 2003 terminal services are extended on rich web services which provides now great new capabilities in designing and deploying built in terminal server services based on HTTP/HTTPS. in combination with RD Gateway the applications can also be securely published to WWW and session host server be isolated in non public facing network segments. all terminal services are now called Remote Desktop services shortly RD. 

To enable RD (Remote Desktop) services there are generally 2 ways, “Quickstart” and “Standard Deployment”. Also there 2 types of RD services available, Session Virtualization or VDI (Virtual Desktop Infrastructure). In this blog article I focus and deploy RDS for session virtualization which means hosting and publishing of terminal server applications.


Quickstart is straight forward and deploys you quickly the required services and configure an standard pool of applications mainly can be used for setting up a lab/demo environment:


Standard Deployment Step-by-Step Guide:




Depending on your deployment select in following steps the Connection Broker, Web Access and Session Host server. In a single server deployment you can specify your single server for all roles:


Finished !! Your 2012 TS is ready for deploying and publishing applications Winking smile

Now you need to create a “session collection” to specify users/groups who can access which host servers:







I do not allow “user profile disks”  but in case this is required, select “Enable” and set the required NTFS permissions on folder.


When session collection group is created you can start with configuration of the apps you want to publish.




Now you can access your new RD published applications via web, the link is https://servername/rdweb


The connection is based on SSL (HTTPS) but the certificate used is a automatically created self signed certificate which can be exchanged with a trusted certificate.

After logged in with your specified credentials from the “session collection” you will see the published RemoteApp applications:


here is a list of helpful articles to get more insights in RDS features:

How to enable SSO (single-sign-on) in RD Web Access with Windows 2012?

Publishing RemoteApps in Windows Server 2012

Virtual Desktop Infrastructure services with Windows Server 2012

Remote Desktop Services @ MSDN

Remote Desktop Services Overview – Windows 2012

What’s New in Remote Desktop Services 2012

Remote Desktop Services Team Blog

Test Lab Guide: Remote Desktop Services Session Virtualization Standard Deployment