Link to home
Start Free TrialLog in
Avatar of DerekFG
DerekFG

asked on

Shrinking VMDK

I have a guest machine with a 2TB Thick Provisioned Lazy Zeroed volume which I would like to recover some of the storage from for a few reasons.  

The first, and most important, we are now using Veeam to backup our servers and it can't create the snapshot on a volume over 2TB.  Second being there is only 50gb left on the server and the volume only has 1.1TB of data on it.

The volume only has raw data on it, a lot of shares, etc, so I would like to keep those all in tact so I don't have to recreate everything... there are a ton of sub level custom permissions.

I have set up a 2.5TB ISCI LUN target on a NAS as a datastore, and am hoping to use this for whatever process is taken.  Sadly I cannot clone the machine over, as once again it can't snapshot the 2TB volume.

I've read over http://www.bonusbits.com/main/HowTo:Shrink_a_VMDK_with_VMKFSTOOLS article, which seems okay, but I don't have the space to do it on the same datastore, unless there is a way to point to another.

My other options, I believe, would be to either:

Migrate the VM to the NAS
Use VMware Converter Standalone
Create a new volume from the NAS on the guest, robocopy the data over - then delete the original volume, add a new volume at the size i want, robocopy the data back.

I guess I am looking for the easiest way to do this under my circumstances.  I only have about a 4 hour window during the week for downtime on the server.  Weekend I can have it down longer.
SOLUTION
Avatar of Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Flag of United Kingdom of Great Britain and Northern Ireland 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
Avatar of DerekFG
DerekFG

ASKER

Yes, and that worked wonderful for the servers which I had enough space in the datastore for.

Is there a way I can edit the commands so that it creates the backup, and the new thin vmdk on my second datastore, since I don't have room on the first to do so?

Backup
vmkfstools -i hostname.vmdk -d thin bak-hostname.vmdk

Shrink Volume in Windows

Edit VMDK Descriptor

Clone

vmkfstools -i hostname.vmdk -d thin shrunk-hostname.vmdk

Replace

vmkfstools -E hostname.vmdk -d thin original-hostname.vmdk
vmkfstools -E shrunk-hostname.vmdk -d thin hostname.vmdk

Extend the windows partition to the end

:::::::

Can I specify the datastore, by doing...

vmkfstools -i hostname.vmdk -d thin /vmfs/volumes/datastorename/folder/shrunk-hostname.vmdk

Then I could just move the old vmdk off for backup, move the new one over to the original datastore, add it to guest, make sure things are well.
You will need datastore space for a backup.
ASKER CERTIFIED 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