Go Back   AnandTech Forums > Software > Software for Windows

Forums
· Hardware and Technology
· CPUs and Overclocking
· Motherboards
· Video Cards and Graphics
· Memory and Storage
· Power Supplies
· Cases & Cooling
· SFF, Notebooks, Pre-Built/Barebones PCs
· Networking
· Peripherals
· General Hardware
· Highly Technical
· Computer Help
· Home Theater PCs
· Consumer Electronics
· Digital and Video Cameras
· Mobile Devices & Gadgets
· Audio/Video & Home Theater
· Software
· Software for Windows
· All Things Apple
· *nix Software
· Operating Systems
· Programming
· PC Gaming
· Console Gaming
· Distributed Computing
· Security
· Social
· Off Topic
· Politics and News
· Discussion Club
· Love and Relationships
· The Garage
· Health and Fitness
· Merchandise and Shopping
· For Sale/Trade
· Hot Deals
· Free Stuff
· Contests and Sweepstakes
· Black Friday 2013
· Forum Issues
· Technical Forum Issues
· Personal Forum Issues
· Suggestion Box
· Moderator Resources
· Moderator Discussions
   

Reply
 
Thread Tools
Old 03-08-2013, 09:03 PM   #1
Jeff7181
Lifer
 
Jeff7181's Avatar
 
Join Date: Aug 2002
Location: SE Michigan
Posts: 18,028
Default Hyper-V and resizing VHD's

A coworker of mine recently pointed out that with Hyper-V and VHD's or VHDX's, expanding them is an offline operation. I have no reason to doubt him, I even looked it up myself and it does indeed appear to be the case, even in Server 2012.

My question is, first, how in the world can Microsoft claim to compete with VMware given this massive shortcoming?

Second, how does one work around that? Just create huge VHD's to begin with and hope you don't outgrow them, or if you do, hope that it's a server you can take offline to grow or wait until a scheduled outage to grow it? Seems like a very basic operation that has been in VMware for years... why isn't it possible in Hyper-V?
__________________
"The Universe is huge and old and rare things happen all the time, including life." - Lawrence Krauss
Authorized Amsoil Dealer
Jeff7181 is offline   Reply With Quote
Old 03-09-2013, 08:25 AM   #2
Nothinman
Elite Member
 
Nothinman's Avatar
 
Join Date: Sep 2001
Posts: 30,672
Default

Because MS always plays catch-up with features while killing their competition on price and inclusion with their OS.
__________________
http://www.debian.org
Nothinman is offline   Reply With Quote
Old 03-09-2013, 11:59 AM   #3
Chiefcrowe
Diamond Member
 
Chiefcrowe's Avatar
 
Join Date: Sep 2008
Posts: 3,432
Default

I've never had to do this yet, what are the steps you have to take?

also, if you only have one partition in the VM, then can you expand that one easily?
Chiefcrowe is offline   Reply With Quote
Old 03-09-2013, 12:24 PM   #4
smakme7757
Golden Member
 
smakme7757's Avatar
 
Join Date: Nov 2010
Location: Norway
Posts: 1,136
Default

Expanding a VHD or an VHDX is a real PITA. I've had to do it twice and it was a frustrating ordeal. Your friend is right, it is an offline operation at least at the moment. The fastest way to add more storage would be to add another VHDX to the same Virtual host. Although that might be inconvenient depending on what you're working with.

I do like Hyper-V though. I've used it mainly in smaller scenarios opposed to vSphere, but i feel it's a pretty solid product for what it does. I guess being free isn't such a bad thing either.
__________________
Currently running Debian 7.1 and Windows 8.1
Blog: http://jack-brennan.com
smakme7757 is offline   Reply With Quote
Old 03-11-2013, 10:42 AM   #5
Jeff7181
Lifer
 
Jeff7181's Avatar
 
Join Date: Aug 2002
Location: SE Michigan
Posts: 18,028
Default

Quote:
Originally Posted by Chiefcrowe View Post
I've never had to do this yet, what are the steps you have to take?

also, if you only have one partition in the VM, then can you expand that one easily?
The only way to add space to a volume online as far as I can tell is to add a brand new VHD and extend the volume onto it. Otherwise, you just power down the VM, resize the VHD and power it back on.

With VMware it's an online operation to grow a VMDK.
__________________
"The Universe is huge and old and rare things happen all the time, including life." - Lawrence Krauss
Authorized Amsoil Dealer

Last edited by Jeff7181; 03-11-2013 at 10:47 AM.
Jeff7181 is offline   Reply With Quote
Old 05-02-2013, 05:08 PM   #6
Chiefcrowe
Diamond Member
 
Chiefcrowe's Avatar
 
Join Date: Sep 2008
Posts: 3,432
Default

I was messing with this and I was not able to add space to a boot volume, which was kind of what I expected.

Is there any way to do this??
Chiefcrowe is offline   Reply With Quote
Old 05-03-2013, 10:27 AM   #7
stlcardinals
Senior Member
 
Join Date: Sep 2005
Posts: 688
Default

Quote:
Originally Posted by Chiefcrowe View Post
I was messing with this and I was not able to add space to a boot volume, which was kind of what I expected.

Is there any way to do this??
On Hyper-V manager, power off the VM. Go to the settings of the VM and select the virtual hard drive. Click the edit button and you will get 4 options: Compact, Convert, Expand, or Shrink. This is with a VHDX. Not sure if expand is available on VHD or not.
stlcardinals is offline   Reply With Quote
Old 05-03-2013, 10:55 AM   #8
Chiefcrowe
Diamond Member
 
Chiefcrowe's Avatar
 
Join Date: Sep 2008
Posts: 3,432
Default

I did that and it worked for a VHD, but when I boot into the actual OS, it doesn't let me extend the C: to use the new added space.

What would be the best way to do this with a 3rd party program?
Chiefcrowe is offline   Reply With Quote
Old 05-03-2013, 11:12 AM   #9
Dahak
Platinum Member
 
Join Date: Mar 2000
Location: NB, Canada
Posts: 2,345
Default

now i have not personally tried, but if it does not allow you to do it with disk management it should allow you to do so with diskpart. here shows the disk part commands
__________________
Why does the Universe go to all the bother of existing? - Stephen Hawking

Procrastination is the art of keeping up with last week.
Dahak is online now   Reply With Quote
Old 05-03-2013, 12:19 PM   #10
Jeff7181
Lifer
 
Jeff7181's Avatar
 
Join Date: Aug 2002
Location: SE Michigan
Posts: 18,028
Default

Quote:
Originally Posted by Chiefcrowe View Post
I did that and it worked for a VHD, but when I boot into the actual OS, it doesn't let me extend the C: to use the new added space.

What would be the best way to do this with a 3rd party program?
My first attempt would be to spin up another VM, mount the disk to that one and resize it, then disconnect it and boot up the original VM. I have zero hyper-v experience, so that might break something... but that would be my first thought.
__________________
"The Universe is huge and old and rare things happen all the time, including life." - Lawrence Krauss
Authorized Amsoil Dealer
Jeff7181 is offline   Reply With Quote
Old 05-03-2013, 12:24 PM   #11
stlcardinals
Senior Member
 
Join Date: Sep 2005
Posts: 688
Default

Quote:
Originally Posted by Chiefcrowe View Post
I did that and it worked for a VHD, but when I boot into the actual OS, it doesn't let me extend the C: to use the new added space.

What would be the best way to do this with a 3rd party program?
You've extended on the Hyper-V side, now you need to do it on the client OS side. Probably need to use a 3rd party disk utility. Make a backup of your VHD just in case.
stlcardinals is offline   Reply With Quote
Old 05-03-2013, 10:33 PM   #12
Nothinman
Elite Member
 
Nothinman's Avatar
 
Join Date: Sep 2001
Posts: 30,672
Default

Quote:
Originally Posted by Chiefcrowe View Post
I did that and it worked for a VHD, but when I boot into the actual OS, it doesn't let me extend the C: to use the new added space.

What would be the best way to do this with a 3rd party program?
What OS? Windows hasn't allowed that until very recently, either 2008 or 2008 R2. And how big, if you have an MBR partition table you're stuck at 2TB regardless of OS.
__________________
http://www.debian.org
Nothinman is offline   Reply With Quote
Old 05-04-2013, 12:03 PM   #13
Chiefcrowe
Diamond Member
 
Chiefcrowe's Avatar
 
Join Date: Sep 2008
Posts: 3,432
Default

2008 R2, and the size isn't that big, around 130 GB.
So is it possible in R2?



Quote:
Originally Posted by Nothinman View Post
What OS? Windows hasn't allowed that until very recently, either 2008 or 2008 R2. And how big, if you have an MBR partition table you're stuck at 2TB regardless of OS.
Chiefcrowe is offline   Reply With Quote
Old 05-04-2013, 06:45 PM   #14
Lifted
Diamond Member
 
Lifted's Avatar
 
Join Date: Nov 2004
Posts: 5,665
Default

In the Actions pane, go to More Actions and select Rescan Disks.

The new larger size of the disk will then appear and you can extend the volume.

Lifted is offline   Reply With Quote
Old 05-16-2013, 12:26 PM   #15
Chiefcrowe
Diamond Member
 
Chiefcrowe's Avatar
 
Join Date: Sep 2008
Posts: 3,432
Default

Thank you, that seemed to work. Do you have to convert the Disk to a dynamic disk first? I got a message about that so i wasn't sure.

Last edited by Chiefcrowe; 05-16-2013 at 12:39 PM.
Chiefcrowe is offline   Reply With Quote
Old 05-16-2013, 03:46 PM   #16
Jeff7181
Lifer
 
Jeff7181's Avatar
 
Join Date: Aug 2002
Location: SE Michigan
Posts: 18,028
Default

Quote:
Originally Posted by Chiefcrowe View Post
Thank you, that seemed to work. Do you have to convert the Disk to a dynamic disk first? I got a message about that so i wasn't sure.
What worked? There were a few suggestions made...
__________________
"The Universe is huge and old and rare things happen all the time, including life." - Lawrence Krauss
Authorized Amsoil Dealer
Jeff7181 is offline   Reply With Quote
Old 05-16-2013, 03:52 PM   #17
Nothinman
Elite Member
 
Nothinman's Avatar
 
Join Date: Sep 2001
Posts: 30,672
Default

Quote:
Originally Posted by Jeff7181 View Post
What worked? There were a few suggestions made...
I'm guessing he means the rescan disks option in Disk Management which you need to do on the guest so that it will see the new LUN size. Might have to do it on the hypervisor side too if you're using a SAN, I haven't had to touch Hyper-V yet so I'm not sure.
__________________
http://www.debian.org
Nothinman is offline   Reply With Quote
Old 05-16-2013, 04:25 PM   #18
Chiefcrowe
Diamond Member
 
Chiefcrowe's Avatar
 
Join Date: Sep 2008
Posts: 3,432
Default

I didn't have a chance to explain in more detail, but this is what I did -


1. If necessary, expand the volume on the SAN (in case the VM is getting very full)

2. In Hyper-V, go to the properties of the VM and go to VHD properties and then expand it to the desired amount.

3. Start VM and then go into disk management console, you should see the extra space there, if not rescan disks.

4. Right click on the existing partition and click on expand and select all the space.

5. Then in my case I was successful in increasing my C: partition.


Thanks everyone, this is great!
Chiefcrowe is offline   Reply With Quote
Old 05-16-2013, 05:14 PM   #19
Nothinman
Elite Member
 
Nothinman's Avatar
 
Join Date: Sep 2001
Posts: 30,672
Default

Quote:
Originally Posted by Chiefcrowe View Post
I didn't have a chance to explain in more detail, but this is what I did -


1. If necessary, expand the volume on the SAN (in case the VM is getting very full)

2. In Hyper-V, go to the properties of the VM and go to VHD properties and then expand it to the desired amount.

3. Start VM and then go into disk management console, you should see the extra space there, if not rescan disks.

4. Right click on the existing partition and click on expand and select all the space.

5. Then in my case I was successful in increasing my C: partition.


Thanks everyone, this is great!
By "Start VM" do you mean log into it or boot it up because you have to shut it down to expand?
__________________
http://www.debian.org
Nothinman is offline   Reply With Quote
Old 05-16-2013, 09:11 PM   #20
Lifted
Diamond Member
 
Lifted's Avatar
 
Join Date: Nov 2004
Posts: 5,665
Default

Quote:
Originally Posted by Nothinman View Post
I'm guessing he means the rescan disks option in Disk Management which you need to do on the guest so that it will see the new LUN size. Might have to do it on the hypervisor side too if you're using a SAN, I haven't had to touch Hyper-V yet so I'm not sure.
I only occasionally need to dig around in hyper-v, but I'm pretty sure the LUN is not presented to the vm unless you're using iscsi or some sort of raw device mapping (do they have this in hyper-v?). I don't think he changed the LUN size, but increased the size of the vm disk in the hypervisor with the vm offline. When booting up the vm windows doesn't recognize the new size of the disk without a rescan, after which it will see the new size and you can increase the size of the volume.
Lifted is offline   Reply With Quote
Old 05-16-2013, 09:21 PM   #21
Nothinman
Elite Member
 
Nothinman's Avatar
 
Join Date: Sep 2001
Posts: 30,672
Default

Quote:
Originally Posted by Lifted View Post
I only occasionally need to dig around in hyper-v, but I'm pretty sure the LUN is not presented to the vm unless you're using iscsi or some sort of raw device mapping (do they have this in hyper-v?). I don't think he changed the LUN size, but increased the size of the vm disk in the hypervisor with the vm offline. When booting up the vm windows doesn't recognize the new size of the disk without a rescan, after which it will see the new size and you can increase the size of the volume.
I understand that, it all depends on how the VM is setup. Actually, I'm not sure if Hyper-V supports RDMs the way VMware does. Windows should see the new size of the vhd on bootup without a rescan, if not that seems like pretty big a bug in the drivers for the virtual storage adapter.

His step #1 was resize the SAN volume which implies the data store needed grew before the vhd could be too which is why I mentioned the rescan on the host before the guest. If you're just growing a vhd the host shouldn't need to rescan anything.
__________________
http://www.debian.org
Nothinman is offline   Reply With Quote
Old 05-16-2013, 11:17 PM   #22
Lifted
Diamond Member
 
Lifted's Avatar
 
Join Date: Nov 2004
Posts: 5,665
Default

Quote:
Originally Posted by Nothinman View Post
Windows should see the new size of the vhd on bootup without a rescan, if not that seems like pretty big a bug in the drivers for the virtual storage adapter.
You're right. I'm so used to hot extended in vSphere I forgot a reboot "should" reflect the new vhd size.

Quote:
Originally Posted by Nothinman View Post
His step #1 was resize the SAN volume
Ah, missed that.
Lifted is offline   Reply With Quote
Old 05-17-2013, 07:56 AM   #23
Nothinman
Elite Member
 
Nothinman's Avatar
 
Join Date: Sep 2001
Posts: 30,672
Default

Quote:
Originally Posted by Lifted View Post
You're right. I'm so used to hot extended in vSphere I forgot a reboot "should" reflect the new vhd size.
Me too, so imagine my reaction when I was told the only way to grow a guest disk in XenServer is to shut down the guest, "forget" the disk/SR, grow it, re-add it and then boot up the guest. I was hoping MS wouldn't be stupid enough to release a hypervisor with similarly stupid restrictions.
__________________
http://www.debian.org
Nothinman is offline   Reply With Quote
Old 05-17-2013, 08:53 AM   #24
imagoon
Diamond Member
 
imagoon's Avatar
 
Join Date: Feb 2003
Location: Chicagoland, IL
Posts: 4,319
Default

Considering I use this feature on a weekly / daily basis, I can't imagine it either. Taking servers down to boost the end users home directories another 2 gig? </shudder>

In ESXi I have it down to minutes.
Edit VM -> Disk -> press up 2 x (for 2 GB or whatever) -> save
In VM
diskpart
rescan
select disk X
select part Y
extend
exit

All of our file servers are "thin provisioned" (Many are VMWare thin also) as in the disks are rarely more than ~5% disk free.
imagoon is offline   Reply With Quote
Old 05-17-2013, 11:18 AM   #25
Chiefcrowe
Diamond Member
 
Chiefcrowe's Avatar
 
Join Date: Sep 2008
Posts: 3,432
Default

I meant boot it up. You have do have to shut down to do any changes to the VHD.

Quote:
Originally Posted by Nothinman View Post
By "Start VM" do you mean log into it or boot it up because you have to shut it down to expand?
Chiefcrowe is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 10:54 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.