Solved

Hyper V

Posted on 2015-01-10
8
81 Views
Last Modified: 2015-01-19
Hi, I have recently started a new post and my predecessor has over sized the disks in a number of the Virtual Machines (to a larger size that the host has space for).  On the Virtual DC, he has one c partition which obviously holds the OS and he has given it 600GB in size.  They will never use this amount of space and I want to reduce it down, i'm assuming I can't just disk management to shrink it, as the VHD on the host won't shrink and this is really what i need...., so was wondering if anyone had any advice.

Cheers
0
Comment
Question by:minniejp
8 Comments
 
LVL 36

Expert Comment

by:Mahesh
ID: 40542315
You need to do this in two steps

Under the guest OS:
1.Defrag the drive.
2.Open Disk Management and shrink the partition to size you want, like 100 GB or whatever you want. Make sure all of the free space is at the end of the drive.
3.Shut down the guest.

From hyper-v disk settings edit:
1.Compact the VHD.

See if above works
0
 

Author Comment

by:minniejp
ID: 40542317
Thanks will give it a go.
0
 
LVL 95

Expert Comment

by:Lee W, MVP
ID: 40542348
If it's a fixed VHD size then that won't help.  It needs to be a dynamic VHD.

One idea
1. put the machine off-line then use Disk2VHD WITHIN the VM saving the VHD to a network share OUTSIDE the VM.  This should create a dynamic VHD of a size a few GB larger than actually needed.  This can be the "data" drive.  
2. Shut down the original VM and COPY the original VHD and then mount it in another VM (not the same - the disk signatures will be the same.  You need to change the signature on one disk after you copy it - see http://blogs.technet.com/b/markrussinovich/archive/2011/11/08/3463572.aspx
3.  In the copy of the original VHD, DELETE the data that's on the drive - ONLY the data.  Then reboot the hosting system and run Disk2VHD again to capture that drive - it should be your boot drive (and in a good state to boot up normally).

You should end up with TWO VHDs, one with data, the other with OS.  The data one, you can delete the OS stuff from (C:\Windows) - this will still leave some space to grow into and the OS will report the drives as BOTH being the original sie of the single, but ACTUAL USED SPACE will be not TOO much more than they ACTUALLY required.

(You could copy the VM twice, fix the disk signature issues, delete the OS on one, then the data on the other and THEN VHD them both...)
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

Author Comment

by:minniejp
ID: 40542354
It may be easier to move one of the Hyper Vs to a different partition on the physical host.  Can you go through this process please?
0
 

Author Comment

by:minniejp
ID: 40542356
Just to get things working again
0
 
LVL 36

Accepted Solution

by:
Mahesh earned 500 total points
ID: 40542362
One another way to do that is through VMToolKit’s VHD Resizer http://almoselhy.azurewebsites.net/2013/10/seriously-how-to-shrink-a-vhd/
1st step is same as 1st comment
for 2nd step use VM Toolkit VHD Resizer tool to compact the disk

The VHD Resizer tool can be downloaded from below site
http://www.brothersoft.com/vhd-resizer-336963.html

 The original site is no longer I think
0
 
LVL 12

Expert Comment

by:Dave
ID: 40542523
Is it actually using 600gb on the host disk or is it a dynamic drive, set to expand as needed. If the latter why bother trying to shrink it...
0
 

Author Closing Comment

by:minniejp
ID: 40558405
resized.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Redirected folders in a windows domain can be quite useful for a number of reasons, one of them being that with redirected application data, you can give users more seamless experience when logging into different workstations.  For example, if a use…
The following article is comprised of the pearls we have garnered deploying Hyper-V since Virtual Server 2005 and subsequent 2008 RTM+ standalone and clustered.
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
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…

770 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