SHIFT

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

User Tools

Site Tools


upgradevmfs
Differences

This shows you the differences between two versions of the page.

Link to this comparison view

upgradevmfs [2013/04/20 13:46] (current)
sjoerd created
Line 1: Line 1:
 += 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.
 +<code powershell>​
 +# 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
 +</​code>​
 +
 += Resources =
 +[[http://​www.lucd.info/​2011/​12/​19/​vsphere-5-top-10-vmfs5/​|LucDs Script]] \\
 +[[http://​kb.vmware.com/​kb/​2003813 |VMFS-5 FAQ]] \\
 +
 +{{tag>​vmware scripts storage}}
upgradevmfs.txt ยท Last modified: 2013/04/20 13:46 by sjoerd