Solved

Shrink VHDX Server 2012 Hyper V 2012

Posted on 2016-08-05
4
26 Views
Last Modified: 2016-08-10
I have an exchange server 2013 that I've recently free'd up lots of space on, it was 1.6 TB but is now 400Gb, I therefore thought if i compact the vhdx file through the disk management in Hyper V, it would then show as 400gb rather than 1.6TB but it hasnt changed, is there something i'm missing?
0
Comment
Question by:dannyfccs
  • 2
4 Comments
 
LVL 95

Expert Comment

by:Lee W, MVP
ID: 41745041
It depends on where the data is geometrically speaking on the disk.  You might have to defrag the disk.

Fastest thing might be to create another VHDX on another set of spindles, shut down exchange, move the database to that other VHDX.  Then try to shrink the drive and then move the VHDX back.
1
 
LVL 17

Expert Comment

by:bigeven2002
ID: 41745097
Hello, first things first, backup your data before proceeding.

In prior Hyper-V versions, you had to shutdown the VM and then run the pre-compact tool which would reorganize the data in the VHD file and zero out free space in the VHD, so as to make the actual compact process possible.  I think it is also this way in 2012 but not sure about 2012 R2.

So in addition to the defrag above, shutdown the VM, run the precompact tool (you may have to download it), then re-run the compact function in Hyper-V Manager.  With 1.6 TB, this process can take several hours.
0
 

Accepted Solution

by:
dannyfccs earned 0 total points
ID: 41745145
I found this was the best option, open power shell elevated as administrator.

type in diskpart

select vdisk FILE="C:\HyperV\Virtual Hard Disks\vm01.vhdx"  (vhdx location)
compact vdisk

worked a treat
0
 

Author Closing Comment

by:dannyfccs
ID: 41750102
it was the best solution
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

First I will try to share a design of a Veeam Backup Infrastructure without Direct NFS Access backup. Note: Direct NFS Access backup transport mechanism is only available in Veeam v9 In above I try to design the Veeam Backup flow between i…
Resolve DNS query failed errors for Exchange
In this Micro Tutorial viewers will learn how to restore their server from Bare Metal Backup image created with Windows Server Backup feature. As an example Windows 2012R2 is used.
This tutorial will walk an individual through the process of configuring basic necessities in order to use the 2010 version of Data Protection Manager. These include storage, agents, and protection jobs. Launch Data Protection Manager from the deskt…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question