VMware

This Question is Answered

2 "helpful" answers available (6 pts)
7 Replies Last post: Jun 23, 2006 6:05 PM by SV  

shrink disk posted: Jun 23, 2006 11:43 AM

Click to view biekee's profile Expert 369 posts since
Nov 15, 2004
Is there a way to shrink vmdk's in 3.0? Normally 'vmkfstools -X 4g --force server.vmdk' should do the trick. That was the case in 2.5.x. What is it in 3.0? I tested it on a 3.0 test server, but the command gave an error:

Failed to extend disk : One of the parameters supplied is invalid. (1)

Anyone?

bk

Re: shrink disk

1. Jun 23, 2006 11:57 AM in response to: biekee
Click to view SV's profile Expert 317 posts since
Oct 1, 2003
Shrinking a disk is not supported in ESX3.

Re: shrink disk

2. Jun 23, 2006 12:01 PM in response to: biekee
Click to view Bart Korsten's profile Enthusiast 478 posts since
Jan 6, 2004
Hmm looking at the docs, Vmware Tools Properties :

"• Shrink disk is not supported. "

Not sure if this is just a gui limitation.

Re: shrink disk

4. Jun 23, 2006 1:53 PM in response to: biekee
Click to view SV's profile Expert 317 posts since
Oct 1, 2003
Thats a bummer. For now, I'd suggest a quick hack:

1. vmkfstools -c 4g -d thick <path_to_new_virtual_disk>
2. dd if=<path_to_old_-flat.vmdk> of=<path_to_new_-flat.vmdk> bs=1048576 count=4096
3. Note down the "cid" field from old.vmdk
4. vmkfstools -E old.vmdk old-backup.vmdk
5. vmkfstools -E new.vmdk old.vmdk
6. Now open old.vmdk and patch in the cid value from step 3

Re: shrink disk

6. Jun 23, 2006 4:57 PM in response to: SV
Click to view paulo.meireles's profile Master 999 posts since
Oct 29, 2004
Thats a bummer. For now, I'd suggest a quick hack:

I hope that "for now" means the question is being addressed... :(

Paulo

Re: shrink disk

7. Jun 23, 2006 6:05 PM in response to: biekee
Click to view SV's profile Expert 317 posts since
Oct 1, 2003
It looks like the cid field in the vmdk file wasn't patched properly, hence the VM realized that its disk was changed from underneath it and refused to start.

VMware Developer

SDKs, APIs, Videos, Learn and much more in the Developer community.

Learn More

Developer Sample Code

Increase your developer productivity with VMware API sample code.

Learn More

VMworld Sessions & Labs

Online access to the latest VMworld Sessions & Labs and online services.

Learn more

Purchase PSO Credits Online

Purchase credits to redeem training and consulting services online.

Buy Now

Community Hardware Software

View reported configurations or report your own.

Learn More

VMware vSphere

Come witness the next giant leap in virtualization.

Register Today

Communities