Solved

Shrink thin provisioned VMDK

Posted on 2010-08-27
7
2,145 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 28

Expert Comment

by:bgoering
Comment Utility
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
Comment Utility
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
Comment Utility
What about running something like gparted in the VM ?

0
 
LVL 28

Accepted Solution

by:
bgoering earned 500 total points
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

#Citrix #XenApp #Citrix Scout #Citrix Insight Services #Microsoft VMMAP #Microsoft ADEXPLORE #Microsoft RAMMAP #Microsoft TCPVIEW #Microsoft AUTORUNS #Microsoft PROCESS EXPLORER #Microsoft PROCESS MONITOR
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…
This Micro Tutorial walks you through using a remote console to access a server and install ESXi 5.1. This example is showing remote access and installation using a Dell server. The hypervisor is the very first component of your virtual infrastructu…
How to install and configure Citrix XenApp 6.5 - Part 1. In this video tutorial we have explained step by step installation of Citrix XenApp 6.5 Server on Windows Server 2008 R2 is explained in this video. We have explained the difference between…

743 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

17 Experts available now in Live!

Get 1:1 Help Now