Link to home
Start Free TrialLog in
Avatar of maxihost
maxihost

asked on

Shrink thin provisioned VMDK

Hello guys !

I am looking on how to shrink a VM so the vmdk is only the size it really uses.

What happened is that I have a VM running CentOS/cPanel and the VMDK had 500GB thin provisioned disk. It was using only 100GB and I had a /backup mount as NFS to my storage. The issue is that the server has been rebooted and the backup ran on the local disk. Guess what, the VMDK because the double and I ran out of space on my LUN.

Now I have learned to lesson, creating smaller VMDKs for those type of servers and taking care for the /backup to be always mounted on a reboot.

What I would like to do is to shrink that VM back to the 100GB. I cannot use vMotion because I dont have 200GB available on any other LUN to move it. I can power off the VM with no problems.

Any ideas ? :)

Guilherme
Avatar of SysExpert
SysExpert
Flag of Israel image

Use VMWARE standalone converter to create a local ( not on ESXi ) copy with smaller data size and then do the same thing from local back to the ESXi.

I hope this helps !
Assuming you have VMware Tools installed in your guest - from a terminal session run vmware-toolbox

This will bring up a dialog box that should have a tab labeled "Shrink"

It will either allow you to shrink the drive - or say shrink is disabled. If it allows you to shrink the volume use that.

Good Luck
Avatar of maxihost
maxihost

ASKER

bgoering,

It doesnt allow me to shrink use that tool.

I have tried Disk Director Server to copy the disk to a new one. The copy went sucessfully although after booting the new VM it says it cant find the mibr.

I have copied and set the /boot partition as Active. Any ideas ?

Guilherme
Pretty much the same recommendation as SysExpert. Get a copy of the free VMware Converter tool (http://www.vmware.com/products/converter/) and use that to copy them VM. You can copy it the way it is, or select to resize disks during the copy.

Good Luck
Hello,

VMWare Converter always give errors for large VMs.

What about if I use "dd" ?

dd if=/dev/sda of=/dev/sdb
What about running something like gparted in the VM ?

ASKER CERTIFIED SOLUTION
Avatar of bgoering
bgoering
Flag of United States of America 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