Increasing the size of a virtual disk
search cancel

Increasing the size of a virtual disk

book

Article ID: 344854

calendar_today

Updated On:

Products

VMware VMware Desktop Hypervisor VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

This article provides information on increasing the size of a virtual disk. This procedure is necessary to accommodate data requirements that have changed since the creation of the virtual disk.

Resolution

Important information before you begin

Even though this article provides steps to increase the size of your virtual disk, the size of the disk partition does not increase as observed inside the guest operating system. You must follow steps related to your specific operating system to increase the size of the disk partition(s).
Caution: VMware recommends that you back up your virtual machine 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 your product.
 
In all cases, confirm these before increasing the size of the virtual disk:
  • All snapshots have been removed. For additional information, see Working with snapshots (1009402).
  • The virtual machine is powered off.
    • PVSCSI controller allows hot extend disk from vSphere 7.0.
    • NVMe controller allows hot extend disk from vSphere 8.0.1.
Note: In ESX 4.1, you can extend and add virtual disks to a virtual machine when it is powered on (after installing VMware Tools).

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 you have multiple .vmdk files with the same base name, use the file that does not include -flat or -s0 in its file name.

You may need to:

Workstation / Player / ACE Manager / Server / GSX

To increase the virtual disk from the command line:

  1. Open a command prompt. For more information, see Opening a command or shell prompt (1003892).
  2. Navigate to the product's installation directory. For more information, see Locating the installation directory of a VMware product (1003897).
  3. Type vmware-vdiskmanager -x 100Gb vm.vmdk and press Enter.

    Note: Replace 100Gb with the actual size of virtual disk that you want. You can also specify Kb and Mb.
     
  4. Follow the steps in Increasing the size of a disk partition (1004071) so the guest operating system is aware of the change in disk size.
For Workstation 7 and later and Player 3.x and later, you can increase the virtual disk from the GUI:
  1. Select the virtual machine from the Inventory.
  2. Click Edit Virtual Machine Settings.
  3. Click Hard Disk.
  4. Click Utilities > Expand, enter the new size, then click Expand.
  5. Complete the steps in Increasing the size of a disk partition (1004071), 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 you are using an ACE Instance, the virtual disk size must be changed from the ACE Manager, then repackaged and redeployed.
  • If you are using VMware Player's 2.x, upgrade to VMware Player 3. This is a free download, available at VMware Downloads.

ESX / VI Client / vSphere

Notes:
  • In ESX 4.1, you can extend and add virtual disks to a virtual machine when it is powered on (after installing VMware Tools).
  • 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.

    Please use this command as an example:

    # vmkfstools -X 6G -d eagerzeroedthick vm.vmdk
Note: For more information on using vmkfstools commands, see Cloning and converting virtual machine disks with vmkfstools (1028042).
 
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 you experience this error, ensure that you can power on the virtual machine successfully and ensure that you remove all snapshots. For additional information, see Determining if a virtual machine is using snapshots (1004343). If the error persists, contact VMware Support.
 
 
For ESX 3.5 or later:
  1. Open VMware Infrastructure (VI) Client and connect to VirtualCenter or the ESX host.
  2. Right-click the virtual machine.
  3. Click Edit Settings.
  4. Select Virtual Disk.
  5. 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.
     
  6. Follow the steps in Increasing the size of a disk partition (1004071) so the guest operating system is aware of the change in disk size.

For earlier versions of ESX, you must use the Console. For more information, see Adding space to an ESXi/ESX host virtual disk(994).

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 you have completed creating a new virtual machine, 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.
  1. Open Lab Manager.
  2. Consolidate and then deploy the template to be resized. For instructions, see the Lab Manager User's Guide.
  3. Connect to the ESX host where the template was deployed using VI Client.
  4. Perform the disk resize according to the ESX section above.
  5. Follow the steps in Increasing the size of a disk partition (1004071) so the guest operating system is aware of the change in disk size.


Additional Information

VMware Skyline Health Diagnostics for vSphere - FAQ
For information on increasing a virtual disk for Fusion, see Resizing a virtual disk in VMware Fusion (1020778).
Increasing the disk space in vCenter Server Appliance 5.x
Verifying that ESX/ESXi virtual machine storage is accessible
Locating a hosted virtual machine's files
Opening a command or shell prompt
Locating the installation directory of a VMware product
Increasing the size of a disk partition
Determining if a virtual machine is using snapshots
Working with snapshots
Resizing a virtual disk in VMware Fusion
Cloning and converting virtual machine disks with vmkfstools
Aumentar o tamanho de um disco virtual
增加虚拟磁盘容量
Aumento del tamaño de un disco virtual
仮想ディスクのサイズの増加
ディスク容量不足で VMware VirtualCenter Server サービスが開始されない
Adding space to an ESXi/ESX host virtual disk