Solved

Shrinking VMDK

Posted on 2014-01-22
4
500 Views
Last Modified: 2014-01-27
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.
0
Comment
Question by:DerekFG
  • 2
4 Comments
 
LVL 117

Assisted Solution

by:Andrew Hancock (VMware vExpert / EE MVE)
Andrew Hancock (VMware vExpert / EE MVE) earned 250 total points
Comment Utility
Did we discuss the "vmfs vmdk hack" trick before?
0
 
LVL 2

Author Comment

by:DerekFG
Comment Utility
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.
0
 
LVL 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
You will need datastore space for a backup.
0
 
LVL 7

Accepted Solution

by:
Ned Ramsay earned 250 total points
Comment Utility
My recommendation is to use the standalone converter, this is now the recommended VMWare method since 5.1 and has been recognised as such.

You may need to make space on another datastore but then you can delete the original and migrate back.

Edit: when doing a standalone converter you can specify any datastore you wish as the target. Once the clone is completed delete the original VM and migrate the new one back.

I had to do this recently on a large file server. It took several hours so make sure it is during planned maintenance as the server has to be off if its a VM.
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

This article is an update and follow-up of my previous article:   Storage 101: common concepts in the IT enterprise storage This time, I expand on more frequently used storage concepts.
This is an issue that we can get adding / removing permissions in the vCSA 6.0. We can also have issues searching for users / groups in the AD (using your identify sources). This is how one of the ways to handle this issues and fix it.
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
This Micro Tutorial will teach you how to reformat your flash drive. Sometimes your flash drive may have issues carrying files so this will completely restore it to manufacturing settings. Make sure to backup all files before reformatting. This w…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now