Use the vmkfstools command to create a virtual disk.

-c|--createvirtualdisk size[bB|sS|kK|mM|gG]
      -d|--diskformat [thin|zeroedthick|eagerzeroedthick]
      -W|--objecttype [file|vsan|vvol]
      --policyFile fileName

This option creates a virtual disk at the specified path on a datastore. Specify the size of the virtual disk. When you enter the value for size, you can indicate the unit type by adding a suffix of k (kilobytes), m (megabytes), or g (gigabytes). The unit type is not case-sensitive. vmkfstools interprets either k or K to mean kilobytes. If you do not specify a unit type, vmkfstools defaults to bytes.

You can specify the following suboptions with the -c option.

  • -d|--diskformat specifies disk formats.

  • -W|--objecttype specifies whether the virtual disk is a file on a VMFS or NFS datastore, or an object on a Virtual SAN or Virtual Volumes datastore.

  • --policyFile fileName specifies VM storage policy for the disk.

Example for Creating a Virtual Disk

This example shows how to create a two-gigabyte virtual disk file named disk.vmdk. You create the disk on the VMFS datastore named myVMFS. The disk file represents an empty virtual disk that virtual machines can access.

vmkfstools -c 2048m /vmfs/volumes/myVMFS/disk.vmdk