SlideShare a Scribd company logo
1 of 11
Download to read offline
How to extend partition/volume on
windows 2003 & windows 2008
running inside a VHD hosted on
Microsoft HYPER-V.
IMPORTANT CONSIDERATION
For
HYPER-V
 You must first completely shut down the virtual machine. You cannot expand a virtual
hard disk that is associated with a running or saved stated virtual machine.
 If you expand a virtual hard disk that is associated with a virtual machine that has
snapshots, these snapshots will be invalidated. If you need the snapshots, you'd better
make sure you plan ahead of time, and/or create new snapshots after performing the
expansion of the hard disk.
 After expanding the virtual hard disk there will be an empty space at the end of the
virtual hard disk. You will either need to create a new partition to use the new
space, or expand an existing partition into the new space.
There are two options to address 'You are running out of disk space' problem:
 Option A- Delete the unwanted files to free up more space, if you could.
 Option B- Extend the partition.
Extension process is done in 2 phases for HYPER-V Environment:
 Offline mode – Outside VM – After powering down the VM [In the HYPER-V Manager]
 Online mode – Inside VM - After powering up the VM.
There three conditions you should check before you start the expansion:
1. Do you fall into this condition?: No virtual machine snapshots – VM on which you are
trying to expand the drive does not have snapshots.
2. Do you fall into this condition?: Virtual machine snapshots exist – VM on which you are
trying to expand the drive does have snapshots.
3. Do you fall into this condition?: If you are expanding C: drive that does not have
contiguous unallocated disk space. Imagine a scenario, where in you have C: drive
followed by D: and you notice there are plenty of spaces with D: that you want to
use it.
Depending upon which condition you fall into, take the
appropriate procedure.
Condition 1: [No virtual machine snapshots: You have just single *.VHD file]
Note: You can also go to the CSV volume on which this VM exits and check for *.AVHD’
presence [automatic Virtual Hard Disk exits]. Existence of these files (*.avhd) also indicates
that you have virtual machine snapshots. If you see only one disk *.VHD’, then follow the
procedure below:
Procedure is straight forward –
 Follow the standard steps showed in PHASE1 [page 5]
 After extending the VHD in HYPER-V, power up the VM & follow these steps given in
PHASE 2.
Condition 2: [Virtual Machine snapshots exist: You have *.VHD & *.AVHD]
Note: As you know the rule – You can only expand the drive if it is single *.VHD disk.
Procedure:
 Solution: Delete the snapshots – This is required, In order to merge the snapshots into
a single disk.
1. Go to the HYPER-V host [whichever host is hosting the VM]
2. Go to desired VM.
3. Delete snapshot.
 Select a snapshot and choose the Delete Snapshot action to delete a snapshot.[As
shown in figure below]
 To delete a collection of snapshots, select the top snapshot that you want to delete,
and choose the Delete Snapshot Subtree action.
4. Once delete snapshot operation is done, click ‘SHUTDOWN’ [Once the VM is turned off -
It will automatically kick-in snapshot merge process].
5. You should be patient now. Make sure you scroll all the way to the right in order to see
the merge process.
6. Once merge is completed 100%, wait for a minute and then follow the standard
expansion process.
7. Follow the standard steps showed in PHASE1[page 6]
8. Follow PHASE 2.
Condition 3: [C: drive does not have contiguous unallocated disk space] [Note: This is just
an analogy, I have not tested this]
For example:
If you have C: 40GB [FULL]
D: 160GB [100GB Free]
Even though you have 100GB free, you cannot extend the C: drive. On Windows 2008, Disk
management tool, when you right click, this option will be grayed out.
 Alternative option 1: Backup data on D: partition, delete the partition, reboot, and
then you may extend the boot partition, as explained below.
1- Temporarily move all the Data from ‘D:’ volume to another location.
2- Change the 'D:' drive letter to a different drive letter that is available on the system (for
instance Z :)
3- Shrink 'Z:' to whatever size that you’d like to add it to the 'C:' volume. Let's assume we
want 80GB.
4- Create a new volume out of the unallocated space that was taken from ‘Z:’ and assign ‘D:’
as the drive letter.
5- Delete ‘Z:’ volume that will make it an unallocated partition between ‘C:’ and ‘D:’
6. Reboot the server.
7- Extend the C: partition.
 Alternative option 2: Look for third-party tools mentioned below.
http://www.partition-magic-windows7.com/res/extend-volume-windows-7.html
http://www.extend-partition.com/extend-system-boot-partition.html
http://www.petri.co.il/the-ultimate-guide-to-hard-drive-partitioning.htm
http://www.partition-tool.com/partition-magic/resize-partition-windows-server-2003.htm
http://www.extend-partition.com/download.html
PHASE 1: [offline mode: VM is Powered OFF/Shutdown]
1. Start | Click 'HYPER-V Manager' [Hyper-V management Console]
2. Once the console is launched, Go to the respective Host on which the VM is hosted,
select the VM that you want to work with, and then from the ‘Actions’ menu on the
right hand side pane, click ‘Edit Disk’, as shown in the figure below.
3. Before you begin screen appears, click ‘Next’.
4. Locate Virtual Hard Disk screen appears – Pay attention here.
Click ‘Browse’ and select the VHD that you intend to extend and click ‘Next’.
5. Select ‘Expand’ and click ‘Next’.
6. Enter the new size and click ‘Next’.
7. Review the change you made and click ‘Finish’.
8. Wait till the operation finishes, this may take few seconds to few minutes.
Filesystem extension
There are some great improvements in Windows 7/Vista/2008 Disk Management, Compared
with Windows 2000/XP/2003; the advantage of Windows 7/Vista/2008 is that it allows users
to resize partition with "Extend Volume" and "Shrink Volume" using Disk Management GUI
[without using command line diskpart tool].
PHASE 2: [Online mode: VM is powered ON]
To extend a basic disk [Data/System volume] using GUI: [For Windows 7/Vista/2008]
After extending the VHD in HYPER-V, power up the VM & follow these steps:
1. In Disk Manager, right-click the basic volume you want to extend.
2. Click Extend Volume....
3. Follow the instructions on your screen.
PHASE 2: [Online mode: VM is powered ON] [For windows 2003 – Data volume]
As we are extending a volume on a Windows 2003 Server, we have to use the command line
utility to extend the volume; GUI is not an option here.
To extend a basic disk [Data volume] using a command line
 Open a command prompt and type diskpart.
 At the DISKPART prompt, type list volume. Make note of the basic volume you want to
extend.
 At the DISKPART prompt, type select volume <volumenumber>. This selects the basic
volume number that you want to extend into contiguous, empty space on the same
disk.
 At the DISKPART prompt, type extend.
Note: To extend a particular size enter the value [size=<size>]
Now in action [On windows 2003 VM] – Make sure the VM is booted up.
Follow the steps one by one as shown in the screenshot below: [diskpart]
For Windows 2003: [‘C: ’ Extending System Drive]
This is complex: You need Windows Preinstallation Environment (Windows PE) to extend the
drive that contains the Microsoft Windows operating system.
http://support.microsoft.com/kb/911896
Alternatively, look for the third party tools mentioned in this document.
Hyper-V 2008 R2 Virtual Machine Snapshots: FAQ
http://social.technet.microsoft.com/wiki/contents/articles/211.hyper-v-2008-r2-virtual-
machine-snapshots-faq.aspx
Courtesy:
http://www.petri.co.il/expanding-virtual-hard-disks-with-hyper-v.htm
Courtesy:
http://blogs.technet.com/b/mghazai/archive/2009/02/24/extend-system-boot-volume-on-
windows-server-2008-windows-vista-win7-beta.aspx
What is VHD & VHDX? [A worth read]
http://blogs.technet.com/b/yungchou/archive/2013/01/23/hyper-v-virtual-hard-disk-vhd-
operations-explained.aspx
ashwinwriter@gmail.com

More Related Content

More from Ashwin Pawar

Cannot split clone snapcenter 4.3
Cannot split clone snapcenter 4.3Cannot split clone snapcenter 4.3
Cannot split clone snapcenter 4.3Ashwin Pawar
 
Network port administrative speed does not display correctly on NetApp storage
Network port administrative speed does not display correctly on NetApp storageNetwork port administrative speed does not display correctly on NetApp storage
Network port administrative speed does not display correctly on NetApp storageAshwin Pawar
 
How to connect to NetApp FILER micro-USB console port
How to connect to NetApp FILER micro-USB console portHow to connect to NetApp FILER micro-USB console port
How to connect to NetApp FILER micro-USB console portAshwin Pawar
 
NDMP backup models
NDMP backup modelsNDMP backup models
NDMP backup modelsAshwin Pawar
 
How to use Active IQ tool to access filer information
How to use Active IQ tool to access filer informationHow to use Active IQ tool to access filer information
How to use Active IQ tool to access filer informationAshwin Pawar
 
San vs Nas fun series
San vs Nas fun seriesSan vs Nas fun series
San vs Nas fun seriesAshwin Pawar
 
Steps to identify ONTAP latency related issues
Steps to identify ONTAP latency related issuesSteps to identify ONTAP latency related issues
Steps to identify ONTAP latency related issuesAshwin Pawar
 
SnapDiff process flow chart
SnapDiff process flow chartSnapDiff process flow chart
SnapDiff process flow chartAshwin Pawar
 
SnapDiff performance issue
SnapDiff performance issueSnapDiff performance issue
SnapDiff performance issueAshwin Pawar
 
Volume level restore fails with error transient snapshot copy is not supported
Volume level restore fails with error transient snapshot copy is not supportedVolume level restore fails with error transient snapshot copy is not supported
Volume level restore fails with error transient snapshot copy is not supportedAshwin Pawar
 
Disk reports predicted failure event
Disk reports predicted failure eventDisk reports predicted failure event
Disk reports predicted failure eventAshwin Pawar
 
OCUM shows ONTAP cluster health degraded
OCUM shows ONTAP cluster health degradedOCUM shows ONTAP cluster health degraded
OCUM shows ONTAP cluster health degradedAshwin Pawar
 
NDMPCOPY lun from 7-mode NetApp to cDOT
NDMPCOPY lun from 7-mode NetApp to cDOTNDMPCOPY lun from 7-mode NetApp to cDOT
NDMPCOPY lun from 7-mode NetApp to cDOTAshwin Pawar
 
Latency in storage
Latency in storageLatency in storage
Latency in storageAshwin Pawar
 
NetApp storage layering
NetApp storage layeringNetApp storage layering
NetApp storage layeringAshwin Pawar
 
What is storage from client's perspective
What is storage from client's perspectiveWhat is storage from client's perspective
What is storage from client's perspectiveAshwin Pawar
 
Difference between cluster image package show-repository and system image get
Difference between cluster image package show-repository and system image getDifference between cluster image package show-repository and system image get
Difference between cluster image package show-repository and system image getAshwin Pawar
 

More from Ashwin Pawar (20)

Cannot split clone snapcenter 4.3
Cannot split clone snapcenter 4.3Cannot split clone snapcenter 4.3
Cannot split clone snapcenter 4.3
 
Network port administrative speed does not display correctly on NetApp storage
Network port administrative speed does not display correctly on NetApp storageNetwork port administrative speed does not display correctly on NetApp storage
Network port administrative speed does not display correctly on NetApp storage
 
How to connect to NetApp FILER micro-USB console port
How to connect to NetApp FILER micro-USB console portHow to connect to NetApp FILER micro-USB console port
How to connect to NetApp FILER micro-USB console port
 
NDMP backup models
NDMP backup modelsNDMP backup models
NDMP backup models
 
How to use Active IQ tool to access filer information
How to use Active IQ tool to access filer informationHow to use Active IQ tool to access filer information
How to use Active IQ tool to access filer information
 
San vs Nas fun series
San vs Nas fun seriesSan vs Nas fun series
San vs Nas fun series
 
Steps to identify ONTAP latency related issues
Steps to identify ONTAP latency related issuesSteps to identify ONTAP latency related issues
Steps to identify ONTAP latency related issues
 
SnapDiff
SnapDiffSnapDiff
SnapDiff
 
SnapDiff process flow chart
SnapDiff process flow chartSnapDiff process flow chart
SnapDiff process flow chart
 
SnapDiff performance issue
SnapDiff performance issueSnapDiff performance issue
SnapDiff performance issue
 
Volume level restore fails with error transient snapshot copy is not supported
Volume level restore fails with error transient snapshot copy is not supportedVolume level restore fails with error transient snapshot copy is not supported
Volume level restore fails with error transient snapshot copy is not supported
 
Disk reports predicted failure event
Disk reports predicted failure eventDisk reports predicted failure event
Disk reports predicted failure event
 
OCUM shows ONTAP cluster health degraded
OCUM shows ONTAP cluster health degradedOCUM shows ONTAP cluster health degraded
OCUM shows ONTAP cluster health degraded
 
NDMPCOPY lun from 7-mode NetApp to cDOT
NDMPCOPY lun from 7-mode NetApp to cDOTNDMPCOPY lun from 7-mode NetApp to cDOT
NDMPCOPY lun from 7-mode NetApp to cDOT
 
Latency in storage
Latency in storageLatency in storage
Latency in storage
 
NVRAM vs NVMEM
NVRAM vs NVMEMNVRAM vs NVMEM
NVRAM vs NVMEM
 
NAS vs SAN
NAS vs SANNAS vs SAN
NAS vs SAN
 
NetApp storage layering
NetApp storage layeringNetApp storage layering
NetApp storage layering
 
What is storage from client's perspective
What is storage from client's perspectiveWhat is storage from client's perspective
What is storage from client's perspective
 
Difference between cluster image package show-repository and system image get
Difference between cluster image package show-repository and system image getDifference between cluster image package show-repository and system image get
Difference between cluster image package show-repository and system image get
 

Recently uploaded

What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 

Recently uploaded (20)

What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 

How to extend partition for windows 2003 vm in hyper v

  • 1. How to extend partition/volume on windows 2003 & windows 2008 running inside a VHD hosted on Microsoft HYPER-V. IMPORTANT CONSIDERATION For HYPER-V  You must first completely shut down the virtual machine. You cannot expand a virtual hard disk that is associated with a running or saved stated virtual machine.  If you expand a virtual hard disk that is associated with a virtual machine that has snapshots, these snapshots will be invalidated. If you need the snapshots, you'd better make sure you plan ahead of time, and/or create new snapshots after performing the expansion of the hard disk.  After expanding the virtual hard disk there will be an empty space at the end of the virtual hard disk. You will either need to create a new partition to use the new space, or expand an existing partition into the new space.
  • 2. There are two options to address 'You are running out of disk space' problem:  Option A- Delete the unwanted files to free up more space, if you could.  Option B- Extend the partition. Extension process is done in 2 phases for HYPER-V Environment:  Offline mode – Outside VM – After powering down the VM [In the HYPER-V Manager]  Online mode – Inside VM - After powering up the VM. There three conditions you should check before you start the expansion: 1. Do you fall into this condition?: No virtual machine snapshots – VM on which you are trying to expand the drive does not have snapshots. 2. Do you fall into this condition?: Virtual machine snapshots exist – VM on which you are trying to expand the drive does have snapshots. 3. Do you fall into this condition?: If you are expanding C: drive that does not have contiguous unallocated disk space. Imagine a scenario, where in you have C: drive followed by D: and you notice there are plenty of spaces with D: that you want to use it. Depending upon which condition you fall into, take the appropriate procedure. Condition 1: [No virtual machine snapshots: You have just single *.VHD file] Note: You can also go to the CSV volume on which this VM exits and check for *.AVHD’ presence [automatic Virtual Hard Disk exits]. Existence of these files (*.avhd) also indicates that you have virtual machine snapshots. If you see only one disk *.VHD’, then follow the procedure below: Procedure is straight forward –  Follow the standard steps showed in PHASE1 [page 5]  After extending the VHD in HYPER-V, power up the VM & follow these steps given in PHASE 2. Condition 2: [Virtual Machine snapshots exist: You have *.VHD & *.AVHD] Note: As you know the rule – You can only expand the drive if it is single *.VHD disk. Procedure:  Solution: Delete the snapshots – This is required, In order to merge the snapshots into a single disk. 1. Go to the HYPER-V host [whichever host is hosting the VM] 2. Go to desired VM.
  • 3. 3. Delete snapshot.  Select a snapshot and choose the Delete Snapshot action to delete a snapshot.[As shown in figure below]  To delete a collection of snapshots, select the top snapshot that you want to delete, and choose the Delete Snapshot Subtree action. 4. Once delete snapshot operation is done, click ‘SHUTDOWN’ [Once the VM is turned off - It will automatically kick-in snapshot merge process]. 5. You should be patient now. Make sure you scroll all the way to the right in order to see the merge process. 6. Once merge is completed 100%, wait for a minute and then follow the standard expansion process. 7. Follow the standard steps showed in PHASE1[page 6] 8. Follow PHASE 2.
  • 4. Condition 3: [C: drive does not have contiguous unallocated disk space] [Note: This is just an analogy, I have not tested this] For example: If you have C: 40GB [FULL] D: 160GB [100GB Free] Even though you have 100GB free, you cannot extend the C: drive. On Windows 2008, Disk management tool, when you right click, this option will be grayed out.  Alternative option 1: Backup data on D: partition, delete the partition, reboot, and then you may extend the boot partition, as explained below. 1- Temporarily move all the Data from ‘D:’ volume to another location. 2- Change the 'D:' drive letter to a different drive letter that is available on the system (for instance Z :) 3- Shrink 'Z:' to whatever size that you’d like to add it to the 'C:' volume. Let's assume we want 80GB. 4- Create a new volume out of the unallocated space that was taken from ‘Z:’ and assign ‘D:’ as the drive letter. 5- Delete ‘Z:’ volume that will make it an unallocated partition between ‘C:’ and ‘D:’
  • 5. 6. Reboot the server. 7- Extend the C: partition.  Alternative option 2: Look for third-party tools mentioned below. http://www.partition-magic-windows7.com/res/extend-volume-windows-7.html http://www.extend-partition.com/extend-system-boot-partition.html http://www.petri.co.il/the-ultimate-guide-to-hard-drive-partitioning.htm http://www.partition-tool.com/partition-magic/resize-partition-windows-server-2003.htm http://www.extend-partition.com/download.html
  • 6. PHASE 1: [offline mode: VM is Powered OFF/Shutdown] 1. Start | Click 'HYPER-V Manager' [Hyper-V management Console] 2. Once the console is launched, Go to the respective Host on which the VM is hosted, select the VM that you want to work with, and then from the ‘Actions’ menu on the right hand side pane, click ‘Edit Disk’, as shown in the figure below. 3. Before you begin screen appears, click ‘Next’.
  • 7. 4. Locate Virtual Hard Disk screen appears – Pay attention here. Click ‘Browse’ and select the VHD that you intend to extend and click ‘Next’. 5. Select ‘Expand’ and click ‘Next’.
  • 8. 6. Enter the new size and click ‘Next’. 7. Review the change you made and click ‘Finish’. 8. Wait till the operation finishes, this may take few seconds to few minutes.
  • 9. Filesystem extension There are some great improvements in Windows 7/Vista/2008 Disk Management, Compared with Windows 2000/XP/2003; the advantage of Windows 7/Vista/2008 is that it allows users to resize partition with "Extend Volume" and "Shrink Volume" using Disk Management GUI [without using command line diskpart tool]. PHASE 2: [Online mode: VM is powered ON] To extend a basic disk [Data/System volume] using GUI: [For Windows 7/Vista/2008] After extending the VHD in HYPER-V, power up the VM & follow these steps: 1. In Disk Manager, right-click the basic volume you want to extend. 2. Click Extend Volume.... 3. Follow the instructions on your screen. PHASE 2: [Online mode: VM is powered ON] [For windows 2003 – Data volume] As we are extending a volume on a Windows 2003 Server, we have to use the command line utility to extend the volume; GUI is not an option here. To extend a basic disk [Data volume] using a command line  Open a command prompt and type diskpart.  At the DISKPART prompt, type list volume. Make note of the basic volume you want to extend.  At the DISKPART prompt, type select volume <volumenumber>. This selects the basic volume number that you want to extend into contiguous, empty space on the same disk.  At the DISKPART prompt, type extend. Note: To extend a particular size enter the value [size=<size>]
  • 10. Now in action [On windows 2003 VM] – Make sure the VM is booted up. Follow the steps one by one as shown in the screenshot below: [diskpart] For Windows 2003: [‘C: ’ Extending System Drive] This is complex: You need Windows Preinstallation Environment (Windows PE) to extend the drive that contains the Microsoft Windows operating system. http://support.microsoft.com/kb/911896 Alternatively, look for the third party tools mentioned in this document.
  • 11. Hyper-V 2008 R2 Virtual Machine Snapshots: FAQ http://social.technet.microsoft.com/wiki/contents/articles/211.hyper-v-2008-r2-virtual- machine-snapshots-faq.aspx Courtesy: http://www.petri.co.il/expanding-virtual-hard-disks-with-hyper-v.htm Courtesy: http://blogs.technet.com/b/mghazai/archive/2009/02/24/extend-system-boot-volume-on- windows-server-2008-windows-vista-win7-beta.aspx What is VHD & VHDX? [A worth read] http://blogs.technet.com/b/yungchou/archive/2013/01/23/hyper-v-virtual-hard-disk-vhd- operations-explained.aspx ashwinwriter@gmail.com