Shut down the VM

Before you start, you'll need to shut down the running VM. You can do this via the console prompt on the VM or by sending a shutdown signal through your virtualization management software. Once the VM has been shut down, you can proceed with growing the volume.

Growing the VMDK file when Using VMware

Using vSphere Client

The easiest way to resize the hard disk is inside of vSphere Client.

  1. Connect to your ESXi server
  2. Right-click on your Enterprise VM, and choose Edit Settings
  3. Select the hard disk you want to grow on the Hardware tab
  4. Adjust the size of the disk in the Disk Provisioning area on the right side of the window to whatever you need.

vSphere Client

Danger: Don't ever decrease the volume size! You can only increase it.

Using VMware's Remote CLI

You can also grow your VMDK using the VMware vmkfstools CLI utility. If you don't already have it, you'll need to download the tools first. The command to use it will be something along these lines:

vmkfstools --server esxi-server-ip -X newsizeG /vmfs/volumes/datastore-name/vm-name/filename.vmdk

Note that newsize is the new total size, not how much you're growing the volume. You can find full documentation for the CLI utility here.

Growing the VMDK file when Using VirtualBox

Create a New Volume

To create a new volume, you'll need to use the VBoxManage utility that comes with VirtualBox. If you want to grow the volume to 100GB in size, you would need to switch to the directory that contains the VMDK files on your VirtualBox VM and create a new 100GB volume like this:

VBoxManage createhd --filename github-enterprise-RELEASE.NUMBER-i386-disk1-100G.vmdk --size 100000 --format VMDK

Note: RELEASE.NUMBER is the release you originally imported and the --size argument is in megabytes. This creates a new VMDK that's the size you want.

Clone the Original Volume to the New Volume

Next, you need to clone the original volume onto the new one. To do this, run this command:

VBoxManage clonehd github-enterprise-[RELEASE.NUMBER]-i386-disk1.vmdk github-enterprise-RELEASE.NUMBER-i386-disk1-100G.vmdk --existing

This process might take a couple minutes to complete.

Configure Your VM to Use the New Volume

At this point, you need to configure the VM to use the new volume rather than the old volume.

  1. Select your VM in the VirtualBox Manager and click Settings VirtualBox Settings

  2. Choose the Storage tab and remove the old volume Removing a disk

  3. Add your new, larger volume Adding a disk

  4. Use the Choose existing disk option Choose existing disk

  5. Verify the larger disk is attached by selecting it and looking at the disk details Choose existing disk

Growing the Repository Volume Filesystem

Even though the VMDK is larger, the filesystem on the VM is not aware of it yet.

Browse to:

http(s)://hostname/setup/growfs/repo

This should automatically grow the filesystem. You'll want to copy the output for future reference in case you need to contact support. You can confirm the grow occurred by the df -h output that's shown.

Growing the Root Volume Filesystem

Ensure that you've enabled SSH access and then sign into your VM with ssh admin@[hostname] and run the following command:

ghe-grow-root -d /dev/sda

Note that you could experience some degraded performance while resizing the filesystem. It can take several minutes to significantly increase disk space, so plan accordingly.

You can verify the disk grew by running df -h /.