Solved

Shrink VHDX Server 2012 Hyper V 2012

Posted on 2016-08-05
4
19 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article will review the basic installation and configuration for Windows Software Update Services (WSUS) in a Windows 2012 R2 environment.  WSUS is a Microsoft tool that allows administrators to manage and control updates to be approved and ins…
OfficeMate Freezes on login or does not load after login credentials are input.
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…
This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now