You can add large-capacity virtual disks to virtual machines and add more space to existing disks, even when the virtual machine is running.

You can set most of the virtual disk parameters during virtual machine creation or after you install the guest operating system.

You can store virtual machine data in a new virtual disk, an existing virtual disk, or a mapped SAN LUN. A virtual disk appears as a single hard disk to the guest operating system. The virtual disk is composed of one or more files on the host file system. You can copy or move virtual disks on the same hosts or between hosts.

For virtual machines running on an ESXi host, you can store virtual machine data directly on a SAN LUN instead of using a virtual disk file. This option is useful if in your virtual machines you run applications that must detect the physical characteristics of the storage device. Mapping a SAN LUN also allows you to use existing SAN commands to manage storage for the disk.

When you map a LUN to a VMFS volume, vCenter Server or the ESXi host creates a raw device mapping (RDM) file that points to the raw LUN. Encapsulating disk information in a file allows vCenter Server or the ESXi host to lock the LUN so that only one virtual machine can write to it. This file has a .vmdk extension, but the file contains only disk information that describes the mapping to the LUN on the ESXi system. The actual data is stored on the LUN. You cannot deploy a virtual machine from a template and store its data on a LUN. You can store its data only in a virtual disk file.

The amount of free space in the datastore is always changing. Ensure that you leave sufficient space for virtual machine creation and other virtual machine operations, such as growth of sparse files, snapshots, and so on. To review space utilization for the datastore by file type, see the vSphere Monitoring and Performance documentation.

Thin provisioning lets you create sparse files with blocks that are allocated upon first access, which allows the datastore to be over-provisioned. The sparse files can continue growing and fill the datastore. If the datastore runs out of disk space while the virtual machine is running, it can cause the virtual machine to stop functioning.

About Virtual Disk Provisioning Policies

When you perform certain virtual machine management operations, you can specify a provisioning policy for the virtual disk file. The operations include creating a virtual disk, cloning a virtual machine to a template, or migrating a virtual machine.

NFS datastores with Hardware Acceleration and VMFS datastores support the following disk provisioning policies. On NFS datastores that do not support Hardware Acceleration, only thin format is available.

You can use Storage vMotion or cross-host Storage vMotion to transform virtual disks from one format to another.

Thick Provision Lazy Zeroed
Creates a virtual disk in a default thick format. Space required for the virtual disk is allocated when the disk is created. Data remaining on the physical device is not erased during creation, but is zeroed out on demand later on first write from the virtual machine. Virtual machines do not read stale data from the physical device.
Thick Provision Eager Zeroed
A type of thick virtual disk that supports clustering features such as Fault Tolerance. Space required for the virtual disk is allocated at creation time. In contrast to the thick provision lazy zeroed format, the data remaining on the physical device is zeroed out when the virtual disk is created. It might take longer to create virtual disks in this format than to create other types of disks. Increasing the size of an Eager Zeroed Thick virtual disk causes a significant stun time for the virtual machine.
Thin Provision
Use this format to save storage space. For the thin disk, you provision as much datastore space as the disk would require based on the value that you enter for the virtual disk size. However, the thin disk starts small and at first, uses only as much datastore space as the disk needs for its initial operations. If the thin disk needs more space later, it can grow to its maximum capacity and occupy the entire datastore space provisioned to it.
Thin provisioning is the fastest method to create a virtual disk because it creates a disk with just the header information. It does not allocate or zero out storage blocks. Storage blocks are allocated and zeroed out when they are first accessed.
Note: If a virtual disk supports clustering solutions such as Fault Tolerance, do not make the disk thin.

Change the Virtual Disk Configuration in the VMware Host Client

If you run out of disk space, you can increase the size of the disk. You can change the virtual device node and the persistence mode of virtual disk configuration of a virtual machine.

Prerequisites

Power off the virtual machine.

Verify that you have the following privileges:
  • Virtual machine.Configuration.Modify device settings on the virtual machine.
  • Virtual machine.Configuration.Extend virtual disk on the virtual machine.
  • Datastore.Allocate space on the datastore.

Procedure

  1. Click Virtual Machines in the VMware Host Client inventory.
  2. Right-click a virtual machine in the list and select Edit settings from the pop-up menu.
  3. On the Virtual Hardware tab, expand the hard disk to view all disk options.
  4. (Optional) To change the size of the disk, enter a new value in the text box and select the units from the drop-down menu.
  5. (Optional) To change the way that disks are affected by snapshots, select a disk mode from the Disk Mode drop-down menu.
    Option Description
    Dependent

    Dependent disks are included in snapshots.

    Independent-Persistent

    Disks in persistent mode behave like conventional disks on your physical computer. All data written to a disk in persistent mode are written permanently to the disk.

    Independent-Nonpersistent

    Changes to disks in nonpersistent mode are discarded when you power off or reset the virtual machine. With nonpersistent mode, you can restart the virtual machine with a virtual disk in the same state every time. Changes to the disk are written to and read from a redo log file that is deleted when you power off or reset the virtual machine.

  6. Click Save.

Add a New Standard Hard Disk to a Virtual Machine in the VMware Host Client

You can add a virtual hard disk to an existing virtual machine, or you can add a hard disk when you customize the virtual machine hardware during the virtual machine creation process. For example, you might need to provide additional disk space for an existing virtual machine with a heavy work load. During virtual machine creation, you might want to add a hard disk that is preconfigured as a boot disk.

Prerequisites

  • Verify that you are familiar with configuration options and caveats for adding virtual hard disks. See Virtual Disk Configuration.
  • Before you add disks larger than 2TB in size to a virtual machine, see vSphere Virtual Machine Administration.
  • Verify that you have the Virtual machine.Configuration.Add new disk privilege on the destination folder or datastore.

Power off the virtual machine.

Procedure

  1. Click Virtual Machines in the VMware Host Client inventory.
  2. Right-click a virtual machine in the list and select Edit settings from the pop-up menu.
  3. (Optional) To delete an existing hard disk, move your pointer over the disk and click the Remove icon (X).
    The disk is removed from the virtual machine. If other virtual machines share the disk, the disk files are not deleted.
  4. On the Virtual Hardware tab, select Add hard disk and select New standard hard disk from the drop-down menu.
    The hard disk appears in the Virtual Hardware devices list.
  5. Expand New Hard disk.
  6. (Optional) Enter a value for the hard disk size and select the units from the drop-down menu.
  7. Select the datastore location where you want to store the virtual machine files.
  8. Select the format for the virtual machine disk.
    Option Description
    Thick Provision Lazy Zeroed

    Create a virtual disk in a default thick format. Space required for the virtual disk is allocated during creation. Any data remaining on the physical device is not erased during creation, but is zeroed out on demand at a later time on first write from the virtual machine.

    Thick Provision Eager Zeroed

    Create a thick disk that supports clustering features such as Fault Tolerance. Space required for the virtual disk is allocated at creation time. In contrast to the flat format, the data remaining on the physical device is zeroed out during creation. It might take much longer to create disks in this format than to create other types of disks.

    Thin Provision

    Use the thin provisioned format. At first, a thin provisioned disk uses only as much datastore space as the disk initially requires. If the thin disk needs more space later, it can grow to the maximum capacity allocated to it.

  9. In the Shares drop-down menu, select a value for the shares to allocate to the virtual disk.
    Shares is a value that represents the relative metric for controlling disk bandwidth. The values Low, Normal, High, and Custom are compared to the sum of all shares of all virtual machines on the host.
  10. If you selected Custom, enter a number of shares in the text box.
  11. In the Limit IOPs box, enter the upper limit of storage resources to allocate to the virtual machine, or select Unlimited.
    This value is the upper limit of I/O operations per second allocated to the virtual disk.
  12. Accept the default or select a different virtual device node.
    In most cases, you can accept the default device node. For a hard disk, using a nondefault device node makes controlling the boot order or having different SCSI controller types easier. For example, you might want to boot from an LSI Logic controller and share a data disk with another virtual machine that is using a Buslogic controller with bus sharing turned on.
  13. (Optional) Select a disk mode.
    Option Description
    Dependent

    Dependent disks are included in snapshots.

    Independent-Persistent

    Disks in persistent mode behave like conventional physical computer disks. All data written to a disk in persistent mode are written permanently to the disk.

    Independent-Nonpersistent

    Changes to disks in nonpersistent mode are discarded when you power off or reset the virtual machine. The virtual disk returns to the same state every time you restart the virtual machine. Changes to the disk are written to and read from a redo log file that is deleted when you power off or reset.

  14. Click Save.

Add an Existing Hard Disk to a Virtual Machine in the VMware Host Client

You can add an existing virtual hard disk to a virtual machine when you customize the virtual machine hardware during the virtual machine creation process or after the virtual machine is created. For example, you might want to add an existing hard disk that is preconfigured as a boot disk.

During virtual machine creation, a hard disk and a SCSI or SATA controller are added to the virtual machine by default, based on the guest operating system that you select. If this disk does not meet your needs, you can remove it and add an existing hard disk at the end of the creation process.

Prerequisites

  • Verify that you are familiar with controller and virtual device node behavior for different virtual hard disk configurations.
  • Verify that you have the Virtual machine.Configuration.Add existing disk privilege on the destination folder or datastore.

Power off the virtual machine.

Procedure

  1. Click Virtual Machines in the VMware Host Client inventory.
  2. Right-click a virtual machine in the list and select Edit settings from the pop-up menu.
  3. On the Virtual Hardware tab, select Add hard disk and select Existing hard disk from the drop-down menu.
  4. (Optional) To delete an existing hard disk, move your pointer over the disk and click the Remove icon (X).
    The disk is removed from the virtual machine. If other virtual machines share the disk, the disk files are not deleted.
  5. In the Datastore column, expand a datastore, select a virtual machine folder, and select the disk to add.
    The disk file appears in the Contents column. The File type menu shows the compatibility file types for this disk.
  6. Click Select and click Save to add the existing hard disk.

Add a Persistent Memory Disk in the Host Client

You can add a virtual hard disk to an existing virtual machine, or you can add a hard disk when you customize the virtual machine hardware during the virtual machine creation process. For example, you might need to provide additional disk space for an existing virtual machine with a heavy work load. During virtual machine creation, you might want to add a hard disk that is preconfigured as a boot disk.

During virtual machine creation, a hard disk and a SCSI or SATA controller are added to the virtual machine by default, based on the guest operating system that you select. If this disk does not meet your needs, you can remove it and add an existing hard disk at the end of the creation process.

Prerequisites

  • Verify that you are familiar with configuration options and caveats for adding virtual hard disks. See Virtual Disk Configuration.
  • Before you add disks larger than 2TB in size to a virtual machine, see vSphere Virtual Machine Administration.
  • Verify that you have the Virtual machine.Configuration.Add new disk privilege on the destination folder or datastore.

Power off the virtual machine.

Procedure

  1. Click Virtual Machines in the VMware Host Client inventory.
  2. Right-click a virtual machine in the list and select Edit settings from the pop-up menu.
  3. On the Virtual Hardware tab, select Add hard disk and select New persistent memory disk from the drop-down menu.
    The hard disk appears in the Virtual Hardware devices list. By default, the disk is stored on the host-local PMem datastore and you cannot change the datastore.
  4. (Optional) Configure the settings for the new hard disk and click Save to close the wizard.
    1. Expand New Hard disk.
    2. Enter a value for the hard disk size and select the units from the drop-down menu.
      Note: All persistent memory hard disks and NVDIMM modules that you add to the virtual machine share the same PMem resources. So, you must adjust the size of the newly added persistent memory devices in accordance with the amount of the PMem available to the host. If any part of the configuration requires attention, the wizard alerts you.
    3. From the Shares drop-down menu, select a value for the shares to allocate to the virtual disk.
      Shares is a value that represents the relative metric for controlling disk bandwidth. The values Low, Normal, High, and Custom are compared to the sum of all shares of all virtual machines on the host.
    4. From the Controller location drop-down menu, select the location of the controller that the new hard disk uses.
    5. Select a disk mode.
      Option Description
      Dependent

      Dependent disks are included in snapshots.

      Independent-Persistent

      Disks in persistent mode behave like conventional physical computer disks. All data written to a disk in persistent mode are written permanently to the disk.

      Independent-Nonpersistent

      Changes to disks in nonpersistent mode are discarded when you power off or reset the virtual machine. The virtual disk returns to the same state every time you restart the virtual machine. Changes to the disk are written to and read from a redo log file that is deleted when you power off or reset.

Use Disk Shares to Prioritize Virtual Machines in the VMware Host Client

You can change the disk resources for a virtual machine. If multiple virtual machines access the same VMFS datastore and the same logical unit number (LUN), use disk shares to prioritize the level of access that virtual machines have to resources. Disk shares distinguish high-priority from low-priority virtual machines.

You can allocate the I/O bandwidth of the host to the virtual hard disks of a virtual machine. You cannot pool disk I/O across a cluster.

The shares value represents the relative metric for controlling disk bandwidth to all virtual machines.

Disk shares are relevant only within a given host. The shares assigned to virtual machines on one host have no effect on virtual machines on other hosts.

You can select an IOP limit, which sets an upper limit for storage resources that are allocated to a virtual machine. IOPs are the number of I/O operations per second.

Prerequisites

Power off the virtual machine.

Procedure

  1. Click Virtual Machines in the VMware Host Client inventory.
  2. Right-click a virtual machine in the list and select Edit settings from the pop-up menu.
  3. On the Virtual Hardware tab, expand the hard disk to view the disk options.
  4. In the Shares drop-down menu, select a value for the shares to allocate to the virtual machine.
  5. If you selected Custom, enter a number of shares in the text box.
  6. In the Limit - IOPs text box, enter the upper limit of storage resources to allocate to the virtual machine, or select Unlimited.
  7. Click Save.