VMWare – Increase disk space automatically – how

vmware-vmdk

There are many servers/hosts supporting many virtual machines on VMWare. Is there a way to automatically increase the disk space available on a VM say increase by 10%? How about sending messages (emails) to admins when it gets critical?

Best Answer

You should be able to use the VMWare Disk Manager to inrease the size of your image.

-x [GB|MB] Expands the virtual disk to the specified capacity. You must specify the new, larger size of the virtual disk in Gigabytes or Megabytes. You cannot change the size of a physical (raw) disk. Caution: Before running the virtual disk manager utility, you should back up your virtual disk files.

vmware-vdiskmanager -x 25GB image.vmdk

Expands the image 'image.vmdk' to 25GB. Note that you will have to allocate this space on the VM i.e. assign it to a partition. It will initially be free unpartitioned space I believe.

As far as sending warnings regarding free disk space, you'd have to rope in Quota on Linux or something similar on Windows to perform checks - alternatively you could write a simple Cron-job to do the same thing using the 'df', 'grep' and 'sendmail' commands - again in Linux. You'll have to figure out a Windows alternative for that one aswell.