Save to My DOJO
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.
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:
- Storage Space Reclamation
- How to reclaim VMFS deleted blocks on thin-provisioned LUNs (2014849)
- vSphere 6.5 what’s new – VMFS 6 / Core Storage
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.
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
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
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.
- Right-click on the datastore name and select Delete Datastore. Confirm the deletion process to proceed.
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.
- Name the datastore and select the device (iSCSI LUN or otherwise) where you want the datastore created.
- Select the VMFS version, VMFS-6 in this case.
- 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.
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.
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
- 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
- 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.
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″]
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"
Thanks for this tutorial, it’s perfect and so i have a easy way to update my storage. My way was over the GUI from vCenter.
Glad to hear. Thanks!
good articles, thanks