Contact & Subscribe RSS


Archive by category "Hyper-v"

Compact Dynamic VHDx file

There are many ways to compact a VHDx file. It can be done using SCVMM, Hyper-V manager or even diskpart.
In my situation the compact option doesn’t reduce the size, it was even bigger than before the compact.

I’ve tried to defragment the disk, migrate it or even clean it up inside / without any result.
The only way to get this job done is writing zero’s on the empty space.

This can be done with the tool SDelete, created by Mark Russinovich. The tool zeroes the empty space within the VHDx file.
Before running the tool delete al the un-needed and temporary files.

Sam Boutros created a nice little PowerShell function to get this job done. The package with SDelete and the script can be downloaded HERE.
Example script function parameters:

After running the tool the compact action will reduce the space.
Since Windows 2012 Microsoft has the new TRIM/UNMAP command founded, this works only when the Underlying storage supports this.


Get Cluster Shared Volume (CSV) free space with PowerShell

With the failover cluster manager it’s hard to summarize the free space for each CSV.
Here is a sample script to determine the free space for the Cluster Shared Volumes in each Hyper-V cluster.



CSV IO Paused during Back-up

Finally there are hotfixes for the annoying CSV IO Paused during the back-up. The issue mostly occurs when multiple CSV VSS Snapshots are initiated. I’ve tested the hotfixes in my test envoirement and the issues seems to be gone now.

The components:

Component: Clussvc.exe
Resolves an issue when multiple VSS backups are in progress, the cluster service may crash because of inconsistent state in the CSV VSS provider.

Component: Volsnap.sys
Resolves an issue where unneeded snapshots may not be deleted after a backup is completed. This prevents future backups from failing due to a lack of free space consumed by snapshots.

Component: Hyper-v Integration Services
Increases the time-out to detect the volumes to shadow copy when the Guest OS has multiple volumes.

Component: Rdvgpuinfo.dll / Vmms.exe
Resolves an issue on a Hyper-V cluster where the heartbeat component times out during a long-running snapshot. The snapshot fails and the VM restarts.

The full list of Microsoft Cluster Hotfixes:

MSMQ errors in ClusterLog

What is MSMQ:

You can use MSMQ for Application communication across heterogeneous networks and systems that may be temporarily offline. Applications send messages to queues and read messages from queues. A queue is a temporary storage location from which messages can be sent and received reliably, as and when conditions permit. This enables communication across networks and between computers, running Windows, which may not always be connected.

When MSMQ is not enabled or not configured you get a lots of errors in your Windows Cluster log.
In our Hyper-v cluster we don’t need MSMQ.

Errors we faced:

ERR   [RHS] s_RhsRpcCreateResType: (21)’ because of ‘Startup routine for ResType MSMQTriggers returned 21.’
INFO  [RCM] result of first load attempt for type MSMQTriggers: 21
WARN  [RCM] Failed to load restype ‘MSMQTriggers’: error 21.

If you don’t use MSMQ you can disable it with the following PowerShell commands:


Get folder size on Cluster Shared Volume (CSV) Hyper-v

In VMM or Failover cluster manager there is no way to view the total size of the directory’s on the ClusterSharedVolumes (CSV).
Ive made a simple script to determine the size of a folder.

Run this script against a Hyper-v node in a cluster.


Get Hyper-v snapshot with Powershell

List Hyper-v VM Snapshots.
With this PowerShell command you can search for snapshots on a Hyper-v node.

List all snapshots within a Hyper-v cluster.
With this script you can search for all checkpoints on a Hyper-v cluster.

Extend Cluster shared volume (CSV) Hyper-v

The first step is to extend the lun on your storage device.
Then, look into your failover cluster manager to find the owner of the CSV.
This can be found in the Storage -> Disks section under Current Owner.

Log into the CSV owner node and type in a elevated command prompt:
1. Type Diskpart
2. Type Rescan
3. Type List volume
4. Type Select Volume (wich you have extended on the storagebox)
5. Type Extend


Get WWN Windows Server

Windows Fibre Channel Information Tool.
Tool for gathering configuration information on your Fibre Channel SAN based on the SNIA HBAAPI for management of Fibre Channel Host Bus Adapters and discovery of SAN resources.

Downlaod the MSI file FCINFO:
Download FCinfo

Install the MSI file on your system.
Open a command prompt typ “fcinfo ?” for the commands.

Expand disk Hyper-v 2012 R2

Online expanding of a VHDX is only possible with:
VHDX files that are attached to a SCSI controller.

Generation 1 VMs Boot always from a IDE Hard Drive.
Generation 2 VMs Boot always from a SCSI Virtual Hard Drive.

The following Windows guest operating systems are supported as generation 2 virtual machines:

  • Windows Server 2012 R2
  • Windows Server 2012
  • 64-bit versions of Windows 8.1
  • 64-bit versions of Windows 8

Virtual Machine failed to start (Access denied).

‘2’ failed to start. (Virtual machine ID 684B169F-DB4A-493F-B34A-762E205AB1E4)

 ‘2’ Microsoft Emulated IDE Controller (Instance ID 83F8638B-8DCA-4152-9EDA-2CA8B33039B4): Failed to Power on with Error ‘General access denied error’ (0x80070005). (Virtual machine ID 684B169F-DB4A-493F-B34A-762E205AB1E4)

 ‘2’: IDE/ATAPI Account does not have sufficient privilege to open attachment ‘###\disk-0.vhdx’. Error: ‘General access denied error’ (0x80070005). (Virtual machine ID 684B169F-DB4A-493F-B34A-762E205AB1E4)


  1. In this example is the virtual machine ID 684B169F-DB4A-493F-B34A-762E205AB1E4
  2. Go to the node wich host this VM
  3. Open an elevated command prompt
  4. icacls <path of vhd> /grant "NT VIRTUAL MACHINE\<Virtual machine ID>":(F)
  5. Start the virtual machine