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

x
?
Solved

Hyper V

Posted on 2015-01-10
8
Medium Priority
?
89 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 38

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 96

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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

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 38

Accepted Solution

by:
Mahesh earned 2000 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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
Optimized for private cloud infrastructures and datacenters, Nano Server is minimalistic, yet super-efficient, OS for services such as Hyper-V and Hyper-V cluster. Learn how you can easily deploy Nano Server and unlock its power!
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…
Suggested Courses

916 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