SHIFT

--- Sjoerd Hooft's InFormation Technology ---

User Tools

Site Tools


Sidebar

Recently Changed Pages:

View All Pages


View All Tags


LinkedIn




WIKI Disclaimer: As with most other things on the Internet, the content on this wiki is not supported. It was contributed by me and is published “as is”. It has worked for me, and might work for you.
Also note that any view or statement expressed anywhere on this site are strictly mine and not the opinions or views of my employer.


Pages with comments

View All Comments

upgradevmfs

Upgrade VMFS 3 to 5

About VMFS 5

Benefits VMFS 5 over VMFS 3:

  • VMFS-5 has improved scalability and performance.
  • VMFS-5 does not use SCSI-2 Reservations, but uses the ATS VAAI primitives.
  • VMFS-5 uses GPT (GUID Partition Table) rather than MBR, which allows for pass-through RDM files greater than 2TB.
  • Newly created VMFS-5 datastores use a single block size of 1MB.
  • VMFS-5 has support for very small files (<1KB) by storing them in the metadata rather than in the file blocks.
  • VMFS-5 uses sub-blocks of 8K rather than 64K, which reduces the space used by small files.
  • VMFS-5 uses SCSI_READ16 and SCSI_WRITE16 cmds for I/O (VMFS-3 used SCSI_READ10 and SCSI_WRITE10 cmds for I/O).

VMFS 5 limitations:

  • VMFS-5 still limits the number of extents to 32 and the total datastore size to 64TB, but the individual extents are no longer limited to 2TB each. For example, a datastore can be created with a LUN size of 64TB, or a datastore can be created with up to 32 extents up to maximum size of 64TB.
  • Only pass-through RDMs (Raw Device Mapping) can be created with a size >2TB. Non-pass-through RDMs and virtual disk files are still limited to 512B ~ 2TB.
  • Passthrough RDMs are supported up to ~60TB in size.
  • Both upgraded and newly-created VMFS-5 volumes supported the larger Passthrough RDM size.

Upgrade Using vSphere Client

To manually upgrade a VMFS 3 datastore to VMFS 5, follow these steps once logged on with the vSphere client to vCenter or a individual host:

  • Select a host and open the configuration tab
  • Click storage and make sure the datastore view is selected
  • Select a datastore
  • In the right top corner of datastore details click the blue “Upgrade to VMFS-5…” link
  • A check will automatically started to make sure all connected hosts support VMFS-5. If so, you can click OK to start the update.

Upgrade Using PowerCLI

Below is a script written by LucD. I tested this in my environment and it worked perfectly. Saved a lot of time.

# This script is completely written by LucD, right here:
# http://www.lucd.info/2011/12/19/vsphere-5-top-10-vmfs5/
 
function ConvertTo-Vmfs5{
<#
.SYNOPSIS  Upgrade a datastore to VMFS5
.DESCRIPTION The function will convert the datastores that
  are passed to it to VMFS5.
.NOTES  Author:  Luc Dekens
.PARAMETER Datastore
  The datastore(s) to be upgraded
  The parameter accepts a string or an object returned by the
  Get-Datastore cmdlet.
.EXAMPLE
  PS> ConvertTo-Vmfs5 -Datastore "DS*"
.EXAMPLE
  PS> Get-Datastore -Name "DS1" | ConvertTo-Vmfs5
#>
 
  param(
  [CmdletBinding()]
  [parameter(Mandatory = $true, ValueFromPipeline = $true)]
  [PSObject[]]$Datastore
  )
 
  process{
    foreach($ds in $Datastore){
      if($ds.getType().Name -eq "string"){
        $ds = Get-Datastore -Name $ds
      }
      $poweredHosts = $ds.ExtensionData.Host | %{Get-View -Id $_.Key} |
      where {$_.Runtime.PowerState -eq "PoweredOn"}
 
      $oldHost = $poweredHosts | 
      where {$_.Capability.SupportedVmfsMajorVersion -notcontains 5}
      if($oldHost){
        Write-Warning "One of the connected hosts doesn't support VMFS5"
        exit
      }
      $vmfsPath = $ds.ExtensionData.Host[0].MountInfo.Path
      $storSys = Get-View ($poweredHosts | Get-Random).ConfigManager.StorageSystem
 
      $storSys.UpgradeVmfs($vmfsPath)
    }
  }
}
 
function Get-VmfsPartitionInfo{
<#
.SYNOPSIS  Retrieves partition info for a datastore
.DESCRIPTION The function will retrieve partition information
  for one or more datastores
.NOTES  Author:  Luc Dekens
.PARAMETER Datastore
  The datastore(s) for which the partition info shall be
  returned. The parameter accepts a string or an object
  returned by the Get-Datastore cmdlet.
.EXAMPLE
  PS> Get-VmfsPartitionInfo -Datastore "DS*"
.EXAMPLE
  PS> Get-Datastore -Name "DS1" | Get-VmfsPartitionInfo
#>
  param(
  [CmdletBinding()]
  [parameter(Mandatory = $true, ValueFromPipeline = $true)]
  [PSObject[]]$Datastore
  )
 
  process{
    foreach($ds in $Datastore){
      if($ds.getType().Name -eq "string"){
        $ds = Get-Datastore -Name $ds
      }
      $poweredHosts = $ds.ExtensionData.Host | %{Get-View -Id $_.Key} |
      where {$_.Runtime.PowerState -eq "PoweredOn"}
      $storSys = Get-View ($poweredHosts | Get-Random).ConfigManager.StorageSystem
 
      $ds.ExtensionData.Info.Vmfs.Extent | %{
        $devicePath = "/vmfs/devices/disks/" + $_.DiskName
        $storSys.RetrieveDiskPartitionInfo($devicePath) | %{
          New-Object PSObject -Property @{
            Name = $ds.Name
            Version = $ds.FileSystemVersion
            Device = $_.DeviceName
            PartitionFormat = $_.Spec.PartitionFormat
            BlockSizeMB = $ds.ExtensionData.Info.Vmfs.BlockSizeMb
            Blocks = $_.Layout.Total.Block
          }
        }
      }
    }
  }
}
 
# Get-VMHost esxprd56.prd.domain | Get-Datastore | Get-VmfsPartitionInfo
Get-Datastore DS_*_PRD | ConvertTo-Vmfs5

Resources

You could leave a comment if you were logged in.
upgradevmfs.txt · Last modified: 2021/09/24 00:25 (external edit)