Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Hyper v 2012 compac not working

Posted on 2015-02-21
9
Medium Priority
?
86 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 84

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 59

Accepted Solution

by:
Cliff Galiher earned 1500 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
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
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
 
LVL 59

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 59

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 59

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Veeam Backup & Replication has added a new integration – Veeam Backup for Microsoft Office 365.  In this blog, we will discuss how you can benefit from Office 365 email backup with the Veeam’s new product and try to shed some light on the needs and …
In previous parts of this Nano Server deployment series, we learned how to create, deploy and configure Nano Server as a Hyper-V host. In this part, we will look for a clustering option. We will create a Hyper-V cluster of 3 Nano Server host nodes w…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
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…
Suggested Courses

971 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