Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This relates specifically to hosted virtualization tools like VMware Server / Fusion / Workstation, Virtual Box, and Parallels.

In relation to both and, I'd like to be able to create virtual machines with very generous potential space (say, 500GB), but have that space be able to shrink if the host OS needs/uses more.

Using VMware, you can give a VM gobs of space, but not pre-allocate it all (so if you never need the 500GB you allocate, and only use 100GB, the remaining "assigned" space is still available to the host OS).

Is it possible to do this more-or-less in reverse? I could create scores of 10GB or 20GB virtual drives (without pre-allocating the space to them) and connect them to the VMs in LVM volumes, adding them as needed - but that still gives the problem of how to remove them from the LVM volume if/when the host OS needs the space back.

Or I could create scores of un-pre-allocated virtual drives and pre-connect them to my VMs, hoping they don't get used, so the host OS can still operate. However, since LVM doesn't guarantee where it will put the next bit of data it's writing, it might write data into multiple "real" volumes, triggering some of the non-pre-allocated virtual disks (the "real" volumes) to expand, but not others.

Using that second approach, I suppose one could review the virtual disks from time-to-time, and detach any that have never grown, shrinking the LVM volume in the process - but that again goes back to manual intervention when I'd like to have the virtualization manager / hypervisor toolset and/or a third-party utility handle that for me.

My initial goal is to take the space given to the VMs, and turn it into a cluster file system using something like GlusterFS, Lustre, ZFS, or Hadoop.

share|improve this question
up vote 1 down vote accepted

VMware has a tool to shrink virtual disks. This is also built into Perfect Disk. I user Perfect Disk VMware Workstation not only to defrag my host OS disk, but to defrag and shrink my guest OS disks.

As long as you ca release the space in the guest OS, you should be able to shrink the virtual disk.

I hope this helps.

share|improve this answer
not sure how scriptable that is, but it looks like a good starting point. Thanks – warren Jan 11 '10 at 15:21
for now, this is the route I'll take. Thanks for the answer :) – warren Jan 12 '10 at 15:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .