vSphere 5 Top 10 – VMFS5

Continuing my Dutch VMUG Event 2011 presentation series with a post on the VMFS5 feature. This feature clocked in at position 8 in the Top 10.

With VMFS5 comes a bunch of new features. Just to name a few:

  • 64TB VMFS Volumes in 1 extent
  • 64TB physical RDM
  • Unified block size of 1MB
  • Support for more files (> 100000)

For a complete list of the features that VMFS5 introduces, have a look at Cormac‘s post, called vSphere 5.0 Storage Features Part 1 – VMFS-5.

The vSphere 5 Client has an option to upgrade your VMFS3 datastores to VMFS5 datastores.

Handy option, but we want to automate this of course 😉

And as a bonus I’ll throw in a function to get the partition information from a datastore.

The script

Annotations

Line 25-27: A rather simple Object By Name implementation.

Line 28-29: Collect the hosts, connected to the datastore, that are powered on. The reason is that we can’t use the UpgradeVmfs method via the StorageSystem of a powered off host.

Line 31-36: Check if all the powered on and connected hosts support VMFS5. If not, leave the function.

Line 37: Get the devicepath to the datastore.

Line 38: Get the HostStorageSystem. Note that the function randomly selects 1 host from the powered on hosts. There is no real reason to do this, but I wanted to spread the method call over all available hosts.

Line 40: Convert the datastore to VMFS5

Line 68-70: Another example of my rather simple Object By Name implementation.

Line 71-73: We randomly take 1 of the connected hosts to fetch the HostStorageSystem.

Line 75: We loop through each VMFS extent of the datastore

Line 76-77: The function uses the RetrieveDiskPartitionInfo method to fetch the partition information.

Line 78-85: The function fetches the information for each partition and puts it on the pipeline as a PSObject.

Sample usage

In our vSphere 4 environment we have a number of VMFS3 datastores.

First, I use the Get-VmfsPartition function to check the partitioninfo of each datastore.

The result.

Notice the BlockSizeMB column in the output, all 4 possible blocksizes for VMFS3 datastores are present.

Let’s upgrade these VMFS3 datastores to VMFS5 datastores.

The convert function produces no output, but we can check what the new properties are with the Get-VmfsPartitionInfo function.

The VMFS version is 5.54, so the conversion worked.

But the attentive viewer might have noticed a couple of values he didn’t expect.

  • The PartitionFormat still says ‘MBR’. Shouldn’t that be ‘GPT’ ?
  • The BlocksizeMB stayed the same as before the VMFS5 conversion. Shouldn’t that be 1MB for VMFS5 datastores ?

The answer to both questions can be found in Cormac’s post called vSphere 5.0 Storage Features Part 1 – VMFS-5.

  • A converted datastores keeps the ‘MBR’ format until it grows bigger than 2TB.
  • A converted datastores keeps the original VMFS3 blocksize.

And I want to repeat Cormac’s final advise in his post, if you have the luxury to do so, it’s better to create new VMFS5 datastores instead of converting VMFS3 datastores !

VIProperty

Derived from the Get-VmfsPartitionInfo function, I created a New-VIProperty definition to return the format of the first datastore partition.

Note that you will only get the partition format (MBR or GPT) when you use this in a vSphere 5, or higher, environment. The partitionFormat property in the HostDiskPartitionSpec object is only available since API 5.

Enjoy !

4 Comments

    Robert van den Nieuwendijk

    I was a bit fast with my comment and $ds.FileSystemversion -eq 3 does not work. I modified it into $ds.FileSystemversion -lt 5.
    The exit command at line 35 stops my PowerCLI session. I don’t like this so I removed the exit command and put lines 37-40 in an else scriptblock.

      admin

      No problem, I will update the function accordingly.

    Robert van den Nieuwendijk

    These are two very useful functions. I made a small modification to the ConvertTo-Vmfs5 function so that it checks that the datastore is of type VMFS and also checks that the VMFS version is 3.x before it tries to upgrade the datastore to VMFS5. Otherwise you will get an error message for NFS datastores or datastores that are already upgraded. Before line 28 I inserted the following line:
    if ($ds.Type -eq “VMFS” -and $ds.FileSystemversion -eq 3) {
    And of course I added an extra } character at the end of the function.

      admin

      Thanks Robert, very useful improvements.
      I will add the lines to the functions.

Leave a Reply

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

*
*

This site uses Akismet to reduce spam. Learn how your comment data is processed.