Link to home
Start Free TrialLog in
Avatar of willp2
willp2

asked on

vCenter 4 - Shrink disks

I need to recapture some space on a Windows 2008 VM in vCenter 4. The VM has a few hundred GB free and I need to try to get that back.

I see that in vCenter I can edit the disk size. Will that actually reduce the size of the client partition and reduce the size of the vdmk?

If not, what's the fastest (and safest) way to do this? I need the space like yesterday.

Thanks!
Avatar of Danny McDaniel
Danny McDaniel
Flag of United States of America image

You won't be able to shrink the disk within the vsphere client...only increase it.  It's because the client/ESX won't operate within the VM to change the partition size(s).

Your best/safest bet is to use converter and tell it to treat the VM like a physical system.  Then you can set the disk sizes as needed and leave the VM running while it does it's copying of files over to a new VM.  Downside is that you'll need all of the space of the new vm plus the old one until you can switch over to the new, smaller VM.
Avatar of Paul Solovyovsky
I agree with the VMWare Converter method
You can use vCenter Converter Standalone (or converter within vCenter):
http://downloads.vmware.com/d/info/datacenter_downloads/vmware_vcenter_converter_standalone/4_0, or you can power down the VM, change the disk size to what you want it, then resize it in disk mgmt (since it's a W2K8 VM)

Regards,
~coolsport00
Avatar of willp2
willp2

ASKER

Are you saying I can just power down the VM, resize in vCenter then power back up and Windows will have less space and wont have its partitions hosed? Will that also shrink the vdmk?

Also on the converter method, I don't think I actually have the space to make a new vdmk (that's why I am trying to reclaim some space). So this might be tough.
I think coolsport00 is confused about what we're talking about...  He may be thinking about increasing the size of disk???

I just verified with ESXi/vCenter 4.1 and windows 2008 guest that you can only increase a disk's size with the client.

If you're limited on space and you can afford downtime, you could use Converter to export the VM to VMware Workstation format and put it out on a Windows share, then erase the original VM, then bring it back with converter.  The only thing I'm not certain about is if you can resize it with Converter when pointing it to the Workstation files or if you would have to power it up using VMware Player and do another "physical" conversion.  Just start the conversion without deleting the original vm to make sure you have the option to resize volumes.

If you are backing up the system using a Converter supported format(like Backup Exec System Recovery), then you could just use Converter to re-create the VM from that image, too.
ASKER CERTIFIED SOLUTION
Avatar of larry urban
larry urban
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ooops...yes, I did misread; thanks "danm66". To decrease, you can modify the virtual disk then use a 3rd party product, as "todar" mentions, like GParted (http://gparted.sourceforge.net/download.php) or Paragon, etc. VMware has a KB on Increasing disk size and 3rd party tools you can use to do so for system volumes. You can use any of those to modify the volume for decreasing size as well:
http://kb.vmware.com/kb/1004071

~coolsport00
Just be very careful with gparted, the latest version appears to be "broken" when it comes to altering NTFS disk partitio sizes. Be Warned! (and have a backup!)
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of willp2

ASKER

Sorry I guess I'm confused a bit here. Why can't I just use the Windows server built in shrink function to shrink the Windows partition?
Yes, by all means, make a copy of your virtual disk as "hanccocka' suggests. If you have little to no space on your datastore to do so, download Veeam FastSCP and install on your workstation. Connect a device that has enough space, if your local drive or another ntwk drive doesn't have enough space, and copy the virtual disk to that location. You have to power down your VM to make the copy.

~coolsport00
Hmm...ok, according to here:
http://technet.microsoft.com/en-us/library/cc731894.aspx,
and here:
http://www.petri.co.il/shrinking-a-partition-in-windows-vista-or-server-2008.htm, you can. You can try it (I haven't). But, again, as mentioned, make a b/u of your virt disk before doing so.

~coolsport00
So, what you would do to try this is first make a backup/copy, power down the VM, resize the disk, power it on, then use the MS/Petri articles to shrink your partition.

~coolsport00
Although, in re-looking at the MS KB, it says the version of 2K8 is R2. "danm66"...you said you attempted it and it didn't work? What 2K8 version do you have?

~coolsport00
Avatar of willp2

ASKER

Well it turns out the disk does not contain the system parition, it's just a file store.

So if I can come up with enough space, I should be able to add another disk to the VM, transfer everything to that and delete the old disk without any conversions or anything, right?
Avatar of willp2

ASKER

All that said, just to confirm yet again, vCenter won't shrink the vdmk even if the VM isn't using the space right? Funny that they let you go though the motions though.
Oh, well then you have even more options. If it's a secondary drive, you should be able to power down the VM, resize the disk, power it up, then use diskpart to modify the partition. But, if you have enough datastore storage to create another virt disk, then sure...create it, attach it to the VM, then do a simple copy of your data to the other virtu disk. Once complete and verified all files are there, you can delete the orig virt disk. Or, if you have a backup of your data (Symantec Backup Exec, Avamar, etc.), you can simply do a restore of your data to the new disk. You have several options...

~coolsport00

p.s. Yes, vCenter doesn't provide the means to solely reduce the disk size and then the space is reclaimed, thus why I presented the KB above (is the same for both increase and decreasing virt disks).
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
you can use the vcenter convertor by importing the vm. you need to select the thin provisioning option for storage disk. this way the data will be analysed and then 125% of the used disk will be provisioned.
Avatar of willp2

ASKER

One thing I'm running into is that the VM has disks on different storage devices. So the system is on one NAS and the file share is on another as an example. I think running through the converter will put everything in place, right? So all the vdmk's will end up in the same place instead of on the different devices. I won't get into why it's setup that way, just that it would be awkward to relocate everything onto one device.
Well, you have been given some options to 'not' have to use Converter. You just have to choose what works best for you...

Regards,
~coolsport00
Avatar of willp2

ASKER

Thanks I do realize that I'm just trying to work through the issue. I was able to stall until the weekend so I at least have a bit of time now to make this happen.

I have resized the Windows partition down to the size I need, and not need to work on shrinking the vdmk