File system options allow you to create and manage VMFS datastores. These options do not apply to NFS. You can perform many of these tasks through the vSphere Client.

Listing Attributes of a VMFS Datastore

Use the vmkfstools command to list attributes of a VMFS datastore.

-P|--queryfs
      -h|--humanreadable

When you use this option on any file or directory that resides on a VMFS datastore, the option lists the attributes of the specified datastore. The listed attributes typically include the file system label, the number of extents for the datastore, the UUID, and a list of the devices where each extent resides.

Note: If any device backing VMFS file system goes offline, the number of extents and available space change accordingly.

You can specify the -h|--humanreadable suboption with the -P option. If you do so, vmkfstools lists the capacity of the volume in a more readable form.

Example of Listing VMFS Attributes

~ vmkfstools -P -h /vmfs/volumes/my_vmfs
VMFS-5.81 (Raw Major Version: 14) file system spanning 1 partitions.
File system label (if any): my_vmfs
Mode: public
Capacity 99.8 GB, 97.5 GB available, file block size 1 MB, max supported file size 62.9 TB
UUID: 571fe2fb-ec4b8d6c-d375-XXXXXXXXXXXX
Partitions spanned (on "lvm"):
        eui.3863316131XXXXXX:1
Is Native Snapshot Capable: YES

Creating a VMFS Datastore or a Scratch Partition

Use the vmkfstools command to create a VMFS datastore or a scratch partition.

-C|--createfs [vmfs5|vmfs6|vfat]

This option creates the VMFS datastore on the specified SCSI or NVMe partition, such as disk_ID:P. The partition becomes the head partition of the datastore. For VMFS5 and VMFS6, the only available block size is 1 MB.

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

  • -S|--setfsname - Define the volume label of the VMFS datastore you are creating. Use this suboption only with the -C option. The label you specify can be up to 128 characters long and cannot contain any leading or trailing blank spaces.
    Note: vCenter Server supports the 80 character limit for all its entities. If a datastore name exceeds this limit, the name gets shortened when you add this datastore to vCenter Server.

    After you define a volume label, you can use it whenever you specify the VMFS datastore for the vmkfstools command. The volume label appears in listings generated for the ls -l command and as a symbolic link to the VMFS volume under the /vmfs/volumes directory.

    To change the VMFS volume label, use the ln -sf command. Use the following as an example:
    ln -sf /vmfs/volumes/UUID /vmfs/volumes/datastore

    datastore is the new volume label to use for the UUID VMFS.

    Note: If your host is registered with vCenter Server, any changes you make to the VMFS volume label get overwritten by vCenter Server. This operation guarantees that the VMFS label is consistent across all vCenter Server hosts.
  • -Y|--unmapGranularity #[bBsSkKmMgGtT] - This suboption applies to VMFS6 only. Define granularity for the unmap operation. The default granularity is 1 MB. As with the block size, enter the unit type.
  • -O|--unmapPriority <none|low|medium|high> - This suboption applies to VMFS6 only. Define the priority for the unmap operation.

Example for Creating a VMFS File System

This example illustrates creating a VMFS6 datastore named my_vmfs on the naa.ID:1 partition.

 ~ vmkfstools -C vmfs6 -S my_vmfs /vmfs/devices/disks/naa.ID:1

Adding an Extent to a VMFS Datastore

Use the vmkfstools command to add an extent to a VMFS datastore.

When you add an extent, you span the VMFS datastore from the head partition across the partition specified by span_partition.

-Z|--spanfs span_partition head_partition

You must specify the full path name for the head and span partitions, for example /vmfs/devices/disks/disk_ID:1. Each time you use this option, you add an extent to the VMFS datastore, so that the datastore spans multiple partitions.

Caution: When you run this option, you lose all data that previously existed on the SCSI or NVMe device you specified in span_partition.

Example for Extending a VMFS Datastore

In this example, you extend the existing head partition of the VMFS datastore over a new partition.

~ vmkfstools -Z /vmfs/devices/disks/naa.disk_ID_2:1 /vmfs/devices/disks/naa.disk_ID_1:1

The extended datastore spans two partitions, naa.disk_ID_1:1 and naa.disk_ID_2:1. In this example, naa.disk_ID_1:1 is the name of the head partition.

Expanding a VMFS Datastore

Instead of adding an extent to a VMFS datastore, you can increase the size of an existing datastore. Use the vmkfstools -G command.

You might increase the datastore size after the underlying storage had its capacity increased.

The command uses the following option:

-G|--growfs device device
This option expands the VMFS datastore or its specific extent. For example,
vmkfstools --growfs /vmfs/devices/disks/disk_ID:1 /vmfs/devices/disks/disk_ID:1