Solved

Hyper v 2012 compac not working

Posted on 2015-02-21
9
64 Views
Last Modified: 2015-03-12
Hi,
Having some serious issues trying to compaq VHDx'S

Tried the GUI , powershell (http://blogs.technet.com/b/askcore/archive/2012/09/20/compacting-a-dynamically-expanding-virtual-hard-disk-in-windows-server-2012.aspx)

I dont get any error message after compacting & compac terminates OK

But when checking the size or hyper v, nothing has changed

Any tricks?

Cheers
0
Comment
Question by:defrey
  • 4
  • 4
9 Comments
 
LVL 78

Expert Comment

by:David Johnson, CD, MVP
ID: 40623873
how much free space is on the physical disk and in the virtual disk?  Perhaps there is nothing that can be compacted
0
 
LVL 1

Author Comment

by:defrey
ID: 40624075
Hi David,

VHD size is 256GB, used space is only 73.GB

Available free space on Physical 760GB

Should be able to do it!
0
 
LVL 56

Accepted Solution

by:
Cliff Galiher earned 500 total points
ID: 40624077
Keep in mind that compacting a dynamic disk only shrinks the physical file by removing empty space at the end of the file. In some situations, where data was removed in such a way where the empty space is mid-file, compacting won't do much. It does *not* defragment the vhd(x) files first.
0
 
LVL 1

Author Comment

by:defrey
ID: 40624082
Is this case, I have got over 180GB that not needed, What would you recommend?
For quick backup, I need to bring the size down.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 56

Expert Comment

by:Cliff Galiher
ID: 40624092
There are server (aka expensive) defrag tools that can move data specifically for this purpose. Otherwise there isn't a lot you can do.
0
 
LVL 1

Author Comment

by:defrey
ID: 40624100
I am confused now, What does compacting VHD do?
0
 
LVL 56

Expert Comment

by:Cliff Galiher
ID: 40624103
As I said above, it moved the "end" of the file to the last non-empty space, effectively removing any empty space at the end. If a lot of data was added to a dynamic disk causing it to grow, and then some of that data is removed, the empty space may be in the middle of the file, not the end, compacting does *not* rearrange blocks of data so it can remove that empty space.
0
 
LVL 1

Author Comment

by:defrey
ID: 40624105
Thanks Cliff, so I should be able to compac some of it without the expensive tools.

So, the question is why nothing get compacted when I try?

Cheers
0
 
LVL 56

Expert Comment

by:Cliff Galiher
ID: 40624111
Given no error is occurring, my belief is that there is data at the end of the virtual disk, thus it is as compacted as it can be without a defrag, this isn't uncommon with dynamic disks; data had to be written to the drive to grow it to the size it is, so it is common that a small chunk of data remains at the end even when some data is later deleted.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Understanding the various editions available is vital when you decide to purchase Windows Server 2012. You need to have a basic understanding of the features and limitations in each edition in order to make a well-informed decision that best suits y…
Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
In this Micro Tutorial viewers will learn how to use Windows Server Backup to create full image of their system. Tutorial shows how to install Windows Server Backup Feature on Windows 2012R2 and how to configure scheduled Bare Metal Recovery backup.…
This tutorial will walk an individual through the process of installing of Data Protection Manager on a server running Windows Server 2012 R2, including the prerequisites. Microsoft .Net 3.5 is required. To install this feature, go to Server Manager…

895 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