Blog articles

How to manage VMFS datastores in VMware

By Jean Francois Landry    |    August 17, 2020

Virtual machine file system (VMFS), exclusive to VMware, functions as both a volume manager and a filesystem; it controls block devices associated with a host or hosts and resides on the same pool of storage resources that it manages. VMFS is used to store disc images and the files that make up a virtual machine or template. Unlike most other filesystems, VMFS is optimized for use with large files.

Multiple servers can write data to, and read data from, a VMFS volume. ESX and ESXi server use a file-locking mechanism, called SCSI reservation, to preserve the integrity of data contained on a volume. SCSI reservation occurs when a VMFS operation modifies the metadata of logical unit number (LUN), an individual, unique, block-based storage device. (The term "LUN" is often used interchangeably with "disk" or "drive.") Examples of VMFS operations include creating a virtual machine or template, turning a VM on or creating or deleting a file. These reservations are dynamic, rather than static; once an operation is complete, the host will release the lock.

VMFS deposits files in a storage container called a datastore, a separate filesystem that runs on top of a volume. Datastores reside on a block-based device such as iSCSI. Virtual machine disks (VMDKs) are housed in the datastore.

VMFS-6, released with vSphere 6.5, offers a new feature that is automatic space reclamation. In VMFS-5, space reclamation had to be done manually via ESXCLI. It’s still possible to use the command line tool for space reclamation using VMFS-6.

To ensure the best performance, administrators should determine what kind of datastore is most suitable for a particular virtual machine. Datastores running on low-end disks or lacking redundancy, for example, should be associated with low-priority VMs. Continue reading to learn how to configure and manage your datastores in VMware vSphere.

 

Create a new datastore

 

VMFS volumes should be created in vSphere, rather than via the fdisk tool or from the ESXi installer. The start sectors on volumes formatted in the ESXi installer or via command line will not be aligned at 128K, negatively impacting disk performance as a result.

 

  1. Connect to the ESXi host vSphere web interface. Click the “Storage” tab on the left pane.

vmware esxi storage tab

 

2. Click "New datastore."

create new datastore

 

3. Select "Create new VMFS datastore" as the storage type and then click "Next."

create new vmfs datastore

 

4. Create a unique name for the datastore and then click “Next”.

naming your datastore

 

5. There are two partitioning options available: “Use full disk” or “Custom.” You can also select the VMFS version you want to use. Select “Use full disk” and choose “VMFS 6” as the VMFS version and click “Next.”

select partitioning options for new datastore

 

6. Review your configuration and click “Finish” to complete the process.

ready to complete screen for new VMFS datastore

 

7. Click “Yes” when receiving the warning that the entire contents of this disk will be erased.

vmfs datastore contents erased warning

 

Mount a datastore

Available datastores in VMware can be mounted to, or unmounted from, a server. To associate an existing datastore with a new server:

1. Select the "Mount" option from the datastore you are wanting to mount.

how to mount a vmfs datastore

 

Unmount a datastore

1. Connect to the ESXi host and select the “Storage” tab on the left panel. Right-click the required datastore and select “Unmount.”

how to unmount a vmfs datastore

 

2. Confirm that you want to unmount the datastore by clicking “Yes.”

prompt to unmount datastore

 

Increase the size of the datastore

Administrators can increase the size of a VMFS datastore using an extent, which represents a partition on a LUN. You can also grow an existing extent so long as it has available free space after it.

1.     Log into the ESXi server and choose "Storage" from the left pane.

esxi server storage

 

2.     Select the appropriate datastore.

selecting the appropriate vmfs datastore

 

3.     Click "Increase capacity."

increase capacity of vmfs datastore

 

4.     From here you can “Add an extent to existing VMFS datastore” or “Expand an existing VMFS datastore extent.” When ready, click “Next.”

vmfs datastore select creation type

 

5.     Select the device and then click “Next.”

select device for new datastore

 

6.     Claim the amount of free space you want to add to the datastore and then click “Next.”

select partitioning options for vmfs datastore

 

7.     Review the new configuration and click “Finish.”

vmfs datastore ready to complete

 

And there you have it! From creating a new datastore, to mounting/unmounting a datastore, to increasing the size of the datastore. You should now feel confident in managing your own VMFS datastores in VMware.

About the author

Working in the IT field for the last 15 years, Jean-Francois has been exchanging roles. From Systems Administrator to teaching Microsoft Official Curriculum courses as a MCT (Microsoft Certified Trainer) as well as a consultant providing solutions to challenging IT projects. Jean-Francois also faced IT challenges in the world of Linux, Citrix, Hyper-V, VMware, Azure and AWS. Some certifications: Microsoft Certified Professional Microsoft® Certified IT Professional: Microsoft® Certified Solutions Associate Microsoft® Certified Technology Specialist.