Important Information Before Beginning
Even though this article provides steps to increase the size of a virtual disk (VMDK), the size of the disk partition does not increase as observed inside the guest operating system. Follow steps related to the specific operating system to increase the size of the disk partition(s).
Caution: VMware recommends that valid virtual machine backups are taken before increasing the size of virtual disks.
The procedure for increasing the size of a virtual disk differs between VMware products. Follow the section below that matches the product in use.
In all cases, confirm these before increasing the size of the virtual disk:
- All snapshots must have been removed. For additional information, see:
- The virtual machine must be powered off.
- PVSCSI controller allows hot extend disk from vSphere 7.0.
- NVMe controller allows hot extend disk from vSphere 8.0.1.
Instructional Notes: About File Names
Replace any reference to vm.vmdk in the commands with the full path to the virtual machine's virtual disk.
Note: If there are multiple .vmdk files with the same base name, use the file that does not include -flat or -s0 in its file name.
It may be necessary to:
Workstation / Player / ACE Manager / Server / GSX
To increase the virtual disk from the command line:
- Open a command prompt.
- Navigate to the product's installation directory. For more information, see Locating the installation directory of a VMware product.
-
Enter
vmware-vdiskmanager -x 100Gb vm.vmdk
Note: Replace 100Gb with the desired actual size of virtual disk. This value can also be specified in Kb and Mb.
-
Press Enter
-
For Workstation 7 and later and Player 3.x and later, use the GUI to increase the virtual disk:
- Select the virtual machine from the Inventory.
- Click Edit Virtual Machine Settings.
- Click Hard Disk.
- Click Utilities > Expand, enter the new size, then click Expand.
- Complete the steps in Increasing the size of a disk partition, so that the guest operating system is aware of the change in disk size.
VMware Player 2.x / ACE Instance
It is not possible to directly change the size of a virtual machine's virtual disk if VMware Player 2.x is being used or if it is an ACE Instance.
-
If using an ACE Instance, the virtual disk size must be changed from the ACE Manager, then repackaged and redeployed.
-
If using VMware Player's 2.x, upgrade to VMware Player 3.
ESX / vSphere
Notes:
- Ensure the user has sufficient permissions to carry out this task.
- Warning: If the disks are clustered, they cannot be expanded through vSphere Client but instead through CLI.
Use this command as an example:
vmkfstools -X 6G -d eagerzeroedthick vm.vmdk
This error may occur because of a number of different issues:
Failed to open the disk 'vm.vmdk' : A file was not found (0x1900000004)
If this error is received, ensure that virtual machine was powered on successfully and ensure that all snapshots are removed. For additional information, see
Finding and listing virtual machine snapshots. If the error persists, contact VMware Support.
For ESXi 6.5 or later:
-
Open VMware vSphere Client or ESXi host client.
-
Right-click the virtual machine.
-
Click Edit Settings.
-
Select Hard Disk.
-
Increase the size of the disk.
Note: If this option is greyed out, the disk may be running on snapshots or the disk may be at the maximum allowed size depending on the block size of the datastore.
-
For further details on Virtual Disk Configuration, see the vSphere Virtual Machine Administration Guide.
Note: Increasing the size of an IDE virtual disk using the vSphere Client is not supported. SCSI virtual disks are the only supported disk that can be expanded via the vSphere Client.
Lab Manager
Warning: Any attempt to resize a configuration's virtual disk in Lab Manager results in total data loss. Do not attempt to resize the virtual disk. Create a new virtual machine with a virtual disk of the size desired. When a new virtual machine has been completed, create a backup of the virtual machine from within the guest and then restore the backup to the newly created virtual machine.
Note: This procedure applies to templates only. Do not attempt to resize a configuration.
-
Open Lab Manager.
-
Consolidate and then deploy the template to be resized.
-
Connect to the ESX host where the template was deployed using VI Client.
-
Perform the disk resize according to the ESX section above.
-