[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Hyper-V VHD compression help

Posted on 2011-10-14
9
Medium Priority
?
483 Views
Last Modified: 2012-05-12
I have windows server 2008 standard R2 with hyper v installed. I have 4 hyper V machines running. I know the only way to regain the free space from the VHD to match the server is to compress it. Is there a rule of when you should compress the VHD? Meaning don't do it when its a certain size or don't let it get to a certain size?

Thanks
0
Comment
Question by:IT_Fanatic
  • 4
  • 4
9 Comments
 
LVL 6

Expert Comment

by:Sid_F
ID: 36970581
I'm not aware of any issues on size other than the time it will take to compress. Have a look at the zerodata tool mentioned here http://msmvps.com/blogs/anguslogan/archive/2004/10/03/14756.aspx
0
 
LVL 42

Expert Comment

by:kevinhsieh
ID: 36973557
My experience under Hyper-V R2 is that precompaction isn't needed, at least for Windows VMs. Notice that the precompaction tool that shipped with Virtual Server 2005 isn't included with Hyper-V. My guess is that the VHD compaction routine looks at the NTFS structures within the VHD to find the actual data to be copied.  
0
 

Author Comment

by:IT_Fanatic
ID: 36974384
That is inaccurate. Hyper V manager doesn't compress automatically a VHD that is setup for dynamic. You will have to turn off that VM and then use hyper v manager to compress the VHD to regain free space
0
Put Machine Learning to Work--Protect Your Clients

Machine learning means Smarter Cybersecurity™ Solutions.
As technology continues to advance, managing and analyzing massive data sets just can’t be accomplished by humans alone. It requires huge amounts of memory and storage, as well as high-speed processing of the cloud.

 
LVL 42

Expert Comment

by:kevinhsieh
ID: 36974750
I was talking about the pre-compaction utility that shipped with Virtual Server that was needed to defragment (and possibly zero out) the VHD before VHD compaction. You still need to turn off the VM in order to compact the VHD. There isn't a supported specification for compressing a VHD, but rather to compact a VHD, which essentially removes all of the white space in a VHD in order to make the file physically smaller. Nothing is actually compressed.
0
 

Author Comment

by:IT_Fanatic
ID: 36974785
Regarding this topic I wanted to know if there is a certain rule of size of when and when not to compress to get my space. I haven't really found anything online that talks about it.
0
 
LVL 42

Accepted Solution

by:
kevinhsieh earned 2000 total points
ID: 36984119
I think that you look at how much space is available to be reclaimed, and whether or not that is significant enough for the hassle of compacting a VHD. To try to get an idea of how much space can be reclaimed by compacting, look at what the VM tells you for disk space used/available, and compare that to the actual size of the VHD. If your VHD is 15 GB physically but the OS says that only 10 GB is used, you then have the opportunity to get back up to 15 GB by compacting the VHD.

I usually only compact a VHD if I am turning a VM into a template, or if I just removed a bunch of data and I know that there is a significant amount of space the can be reclaimed by compacting the VHD.
0
 

Author Comment

by:IT_Fanatic
ID: 36985954
So basically there is no rule. You just look and the HDD from the VM and compare it to the VHD and see if its worth the time to compress?
0
 
LVL 42

Expert Comment

by:kevinhsieh
ID: 36987278
Yes. Ask 100 admins you'll get 101 different answers. :-)
0
 

Author Closing Comment

by:IT_Fanatic
ID: 36988515
Thanks for your response. You clarified what I have always thought.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
This tutorial will give a an overview on how to deploy remote agents in Backup Exec 2012 to new servers. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as connecting to a remote Back…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Suggested Courses

826 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