Solved

Shrink thin provisioned VMDK

Posted on 2010-08-27
7
2,172 Views
Last Modified: 2012-05-10
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
0
Comment
Question by:maxihost
  • 3
  • 2
  • 2
7 Comments
 
LVL 63

Expert Comment

by:SysExpert
ID: 33548033
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 !
0
 
LVL 28

Expert Comment

by:bgoering
ID: 33549431
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
0
 

Author Comment

by:maxihost
ID: 33549773
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
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 28

Expert Comment

by:bgoering
ID: 33550332
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
0
 

Author Comment

by:maxihost
ID: 33583072
Hello,

VMWare Converter always give errors for large VMs.

What about if I use "dd" ?

dd if=/dev/sda of=/dev/sdb
0
 
LVL 63

Expert Comment

by:SysExpert
ID: 33589222
What about running something like gparted in the VM ?

0
 
LVL 28

Accepted Solution

by:
bgoering earned 500 total points
ID: 33589411
I think dd won't work to shrink. If converter doesn't let you clone and resize then

Create new vm with smaller disk
Do minimal OS install
Attach old disk to new vm
Create temp mount point(s) for old
Use tar to copy data
0

Featured Post

Save the day with this special offer from ATEN!

Save 30% on the CV211 using promo code EXPERTS30 now through April 30th. The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

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

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 step by step tutorial with screenshots, we will show you HOW TO: Enable SSH Remote Access on a VMware vSphere Hypervisor 6.5 (ESXi 6.5). This is important if you need to enable SSH remote access for additional troubleshooting of the ESXi hos…
Teach the user how to configure vSphere clusters to support the VMware FT feature Open vSphere Web Client: Verify vSphere HA is enabled: Verify netowrking for vMotion and FT Logging is in place or create it: Turn On FT for a virtual machine: Verify …
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…

733 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