Solved

Shrinking VMDK

Posted on 2014-01-22
4
509 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 118

Assisted Solution

by:Andrew Hancock (VMware vExpert / EE MVE)
Andrew Hancock (VMware vExpert / EE MVE) earned 250 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 118
ID: 39800379
You will need datastore space for a backup.
0
 
LVL 7

Accepted Solution

by:
Ned Ramsay earned 250 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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

HOW TO: Upload an ISO image to a VMware datastore for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere Host Client, and checking its MD5 checksum signature is correct.  It's a good idea to compare checksums, because many installat…
In this article, I will show you HOW TO: Create your first Windows Virtual Machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, the Windows OS we will install is Windows Server 2016.
Teach the user how to configure vSphere Replication and how to protect and recover VMs Open vSphere Web Client: Verify vsphere Replication is enabled: Enable vSphere Replication for a virtual machine: Verify replicated VM is created: Recover replica…
This Micro Tutorial steps you through the configuration steps to configure your ESXi host Management Network settings and test the management network, ensure the host is recognized by the DNS Server, configure a new password, and the troubleshooting…

911 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

22 Experts available now in Live!

Get 1:1 Help Now