?
Solved

Shrinking VMDK

Posted on 2014-01-22
4
Medium Priority
?
532 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 123

Assisted Solution

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

Author Comment

by:DerekFG
ID: 39800274
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 123
ID: 39800379
You will need datastore space for a backup.
0
 
LVL 7

Accepted Solution

by:
Ned Ramsay earned 1000 total points
ID: 39800974
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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

August and September have been big months for VMware—from VMworld last month to our new Course of the Month in VMware Professional - Data Center Virtualization. We reached out to Andrew Hancock, resident VMware vExpert, to have a more in-depth discu…
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
Teach the user how to use create log bundles for vCenter Server or ESXi hosts Open vSphere Web Client: Generate vCenter Server and ESXi host log bundle:  Open vCenter Server Appliance Web Management interface and generate log bundle: Open vCenter Se…
This video shows you how easy it is to boot from ISO images for virtual machines with the ISO images stored on a local datastore on the ESXi host.

650 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