Solved

Shrink thin provisioned VMDK

Posted on 2010-08-27
7
2,188 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
[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
  • 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
Technology Partners: 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

Technology Partners: 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!

Question has a verified solution.

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

In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
This article outlines why you need to choose a backup solution that protects your entire environment – including your VMware ESXi and Microsoft Hyper-V virtualization hosts – not just your virtual machines.
Teach the user how to rename, unmount, delete and upgrade VMFS datastores. Open vSphere Web Client: Rename VMFS and NFS datastores: Upgrade VMFS-3 volume to VMFS-5: Unmount VMFS datastore: Delete a VMFS datastore:
Teach the user how to use vSphere Update Manager to update the VMware Tools and virtual machine hardware version Open vSphere Client: Review manual processes for updating VMware Tools and virtual hardware versions: Create a new baseline group in vSp…

691 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