"Dynamic-sizing / -resizing" of virtual machine storage space

0

1

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

In relation to both https://superuser.com/questions/61245 and https://serverfault.com/questions/89269, 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.

warren

Posted 2010-01-06T16:46:08.080

Reputation: 8 599

Answers

1

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.

Scott McClenning

Posted 2010-01-06T16:46:08.080

Reputation: 3 519

not sure how scriptable that is, but it looks like a good starting point. Thanks – warren – 2010-01-11T15:21:37.757

for now, this is the route I'll take. Thanks for the answer :) – warren – 2010-01-12T15:06:10.680