How to upgrade datastores to VMFS-6 in vSphere 6.5

Table of contents

 

 

 

VMware’s Virtual Machine File System (VMFS) is the filesystem of choice for local and block-level storage (ex. SAN) based datastores. If you haven’t upgraded to vSphere 6.5, chances are that you’re still running VMFS-5 or earlier. Upgrading VMFS datastores to the latest version, might be a task to include in your project plan when upgrading to the latest vSphere release. Today’s post takes you through the process of moving a VMFS-5 datastore to VMFS-6.

 

Why upgrade?

VMFS-6 is only available in vSphere 6.5. There are several reasons why you would want to upgrade to this latest version. One of its most anticipated features is Automatic Space Reclamation (ASR) which allows storage arrays to reclaim deleted or unmapped disk blocks from a VMFS datastore so they can be used elsewhere.

Note: ASR only works with volumes that have been thin-provisioned and that support the vStorage API for Array Integration (VAAI) Unmap primitive.

With earlier versions of VMFS, something like esxcli storage vmfs unmap or vmkfstools is used to reclaim these blocks. With VMFS-6, the functionality is now automated and fully integrated in the vSphere 6.5 UI as shown in Fig. 1.

Figure 1 - Automatic space reclamation with vSphere 6.5 and VMFS-6 datastores

Figure 1 – Automatic space reclamation with vSphere 6.5 and VMFS-6 datastores

One other new feature provides support for large capacity drives. 4KN sector drives, where metadata is aligned over 4KB blocks, are now supported. Variable block sizes is yet another feature that greatly improves file creation times. In truth, there are too many goodies to list them all so if you want the full details, have a look at the vSphere 6.5 Storage whitepaper.

References:

 

Which VMFS version am I running?

There are several ways to determine the VMFS version datastores are formatted in. The easiest, of course, is using a vSphere client or the embedded host client. Irrespective of the client used, the Datastores view should give you the required information. Figure 2 shows a list of datastores I have in my test environment – both local and shared – along with the respective VMFS version.

Figure 2 - Datastores view in vSphere Web Client

Figure 2 – Datastores view in vSphere Web Client

 

Alternatively, the Get-Datastore PowerCLI cmdlet returns the same information for datastores mounted on a single ESXi instance or those managed by vCenter. In the example given below, I restricted the output, using Format-table (FT),  to what’s actually required.

Get-Datastore | ft Name, Type, FileSystemVersion
Figure 3 - Listing datastores and VMFS type using PowerCLI

Figure 3 – Listing datastores and VMFS type using PowerCLI

 

Similarly, you can use ESXi’s command line tools such as esxcli to retrieve the same. Using putty or otherwise, SSH to an ESXi host and run the following:

esxcli storage filesystem list
Figure 4 - Retrieving datastore details using the esxcli command line tool

Figure 4 – Retrieving datastore details using the esxcli command line tool

 

How to upgrade to VMFS-6

Starting afresh, the easy way

The term upgrade is somewhat misleading since in reality no upgrade path is available. Instead, you must format the volume or LUN on which the current datastore resides using VMFS-6. The easiest way to this is as follows:

  • Evacuate the datastore of all virtual machines and other stuff you’d like to keep.
  • You may need to unmount a datastore first more so if it resides on a SAN provisioned LUN or volume which is accessed by multiple ESXi hosts.
Figure 5 - Unmounting a shared datastore provisioned on a SAN

Figure 5 – Unmounting a shared datastore provisioned on a SAN

 

  • Right-click on the datastore name and select Delete Datastore. Confirm the deletion process to proceed.
Figure 6 - Datastore deletion confirmation

Figure 6 – Datastore deletion confirmation

 

Note: At this point, the device or LUN on which the datastore originally resided is still visible to ESXi or vCenter. You can verify from the list of devices under Storage Devices for a selected ESXi host. It’s now just a matter of running the New Datastore wizard and re-create the datastore afresh this time formatted with VMFS-6.

  • Run the New Datastore (see Fig. 2 above) and select the VMFS option.
Figure 7 - Creating a new VMFS datastore

Figure 7 – Creating a new VMFS datastore

 

  • Name the datastore and select the device (iSCSI LUN or otherwise) where you want the datastore created.
Figure 8 - Selecting the device on which the datastore will be created

Figure 8 – Selecting the device on which the datastore will be created

 

  • Select the VMFS version, VMFS-6 in this case.
Figure 9 - Selecting the VMFS type for the new datastore

Figure 9 – Selecting the VMFS type for the new datastore

 

  • On the next screen, specify whether the datastore should consume the device’s full capacity or part of it. You cannot change the Block Size and Space Reclamation Granularity values, you can however set the Space Reclamation Priority to either None or Low (there’s no in-between). Pressing Finish completes the datastore creation process.
Figure 10 - Sizing the datastore and configuring space reclamation

Figure 10 – Sizing the datastore and configuring space reclamation

 

The command-line way!

As mentioned, upgrading from VMFS-x to VMFS-6 is not an option. Regardless, let’s try upgrading a VMFS-5 datastore from the command line.

To test this out, I’ve used vmkfstools while connected to the ESXi host via SSH. The command syntax is vmkfstools -T <volume path>. The volume path is retrieved by running the esxcli command mentioned earlier or from the datastore’s summary page in vSphere Web Client (value next to Location) .

As expected, upgrading the datastore fails as per the error highlighted in Figure 11.

Figure 11 - Trying an in-place VMFS upgrade using vmkfstools

Figure 11 – Trying an in-place VMFS upgrade using vmkfstools

 

So, let’s go ahead and format it instead.

  • To do this, we first need to get hold of the device’s ID using the following command while still SSH’ed to ESXi. You can also use vSphere Web Client.
esxcfg-scsidevs -m
Figure 12 - Retrieving a list of datastore and associated devices from ESXi's command line

Figure 12 – Retrieving a list of datastore and associated devices from ESXi’s command line

 

  • Next, we use vmkfstool to format this device – which corresponds to an iSCSI LUN – and create the VMFS-6 datastore. The parameters supplied to vmkfstool are -C (create filesystem), vmfs6 which is self-explanatory and the device ID which we grabbed earlier on. The command syntax is as follows:
vmkfstools -C vmfs6 /vmfs/devices/disks/naa.60003ff44dc75adca2c1874f366d257a:1
Figure 13 - Creating a VMFS-6 datastore from the command line

Figure 13 – Creating a VMFS-6 datastore from the command line

 

  • This creates a new datastore named after its new UID. The “old” datastore is left in place on the ESXi host where the command was executed. The “old” datastore keeps showing up as (unmounted)(inaccessible) on all the other ESXi hosts where it was mounted until an adapter rescan is carried out. After the rescan, you can safely rename the datastore to something more user friendly. The name change is picked up automatically by all the other hosts where the datastore is mounted.
Figure 14 - The newly created datastore is named after its UUID

Figure 14 – The newly created datastore is named after its UUID

 

Note: Add -S <datastore name> to vmkfstools’ list of parameters to assign a name to the datastore being created.

 

Conclusion

As we have seen, there are several reasons why you would want to upgrade to VMFS-6, the most salient feature being Automatic Space Reclamation, which is UI driven, and support for 4KN drives. Keep in mind that there is no in-place upgrade path, so reformatting the datastore is your only option. You can do this using the vSphere Web Client or command-line tools.

[the_ad id=”4738″][the_ad id=”4796″]

Altaro VM Backup
Share this post

Not a DOJO Member yet?

Join thousands of other IT pros and receive a weekly roundup email with the latest content & updates!

5 thoughts on "How to upgrade datastores to VMFS-6 in vSphere 6.5"

Leave a comment

Your email address will not be published. Required fields are marked *