[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Shrink thin provisioned VMDK

Posted on 2010-08-27
7
Medium Priority
?
2,206 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
When ransomware hits your clients, what do you do?

MSPs: Endpoint security isn’t enough to prevent ransomware.
As the impact and severity of crypto ransomware attacks has grown, Webroot fought back, not just by building a next-gen endpoint solution capable of preventing ransomware attacks but also by being a thought leader.

 
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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

When rebooting a vCenters 6.0 and try to connect using vSphere Client we get this issue "Invalid URL: The hostname could not parsed." When we get this error we need to do some changes in the vCenter advanced settings to fix the issue.
It’s time for spooky stories and consuming way too much sugar, including the many treats we’ve whipped for you in the world of tech. Check it out!
This Micro Tutorial steps you through the configuration steps to configure your ESXi host Management Network settings and test the management network, ensure the host is recognized by the DNS Server, configure a new password, and the troubleshooting…
This video shows you how easy it is to boot from ISO images for virtual machines with the ISO images stored on a local datastore on the ESXi host.

649 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