Solved

Shrinking VMDK

Posted on 2014-01-22
4
515 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 119

Assisted Solution

by:Andrew Hancock (VMware vExpert / EE MVE^2)
Andrew Hancock (VMware vExpert / EE MVE^2) 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 119
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

This article will show you how to create an ISO CD-ROM/DVD-ROM image (*.iso), and MD5 checksum signature, for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5). It's a good idea to compare checksums, because many installations fail because of a corr…
In this article, I will show you HOW TO: Suppress Configuration Issues and Warnings Alert displayed in Summary status for ESXi 6.5 after enabling SSH or ESXi Shell.
Teach the user how to install and configure the vCenter Orchestrator virtual appliance Open vSphere Web Client: Deploy vCenter Orchestrator virtual appliance OVA file: Verify vCenter Orchestrator virtual appliance boots successfully: Connect to the …
Teach the user how to join ESXi hosts to Active Directory domains Open vSphere Client: Join ESXi host to AD domain: Verify ESXi computer account in AD: Configure permissions for domain user in ESXi: Test domain user login to ESXi host:

790 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