Wednesday, March 26, 2014

Expand OS X virtual disk in esxi

As you all know, it is currently not possible to expand a disk (vmdk) with 'OS X' on it in esx so that you get more space.

Well, that's not quite true. You can expand the disk. That's not the problem. You can do that using the command 'vmkfstools -x' as described here:

VMware KB: Adding space to an ESXi/ESX host virtual disk

The problem is that by using disk utility it is currently not possible to expand the size of the partition:

VMware KB: Unable to extend a partition using the guest Disk Utility after extending disk of a virtual machine running Mac OS X

So, what's the solution?

Well, it's actually quite simple:

  1. Create a new Hard disk of the size you need.
  2. Restore the contents of the too small disk to the new disk using disk utility.
  3. Detach both disks from the virtual machine
  4. Rename the old disk by issuing the command 'vmkfstools -E OldName.vmdk' as shown here VMware KB: Renaming a virtual machine disk (VMDK) via the vSphere Management Assistant (vMA) or vSphere CLI (vCLI)
  5. Rename the new disk by issuing the command 'vmkfstools -E NewName.vmdk OldName.vmdk'
  6. Attach the new disk to the VM
  7. If everything is working, delete the old disk

No comments: