By now you must be switching onto vSphere 6.5. During this time you would have also figured it out that there is no online upgrade for VMFS5 to VMFS6, which means that there is a little bit of planning would require to upgrade your VMFS datastores to VMFS6 version.
As of now, the most common approach (and I believe the only approach) is to-
- Create a temporary VMFS5 datastore
- Migrate VM, files, and folder from source datastore to temporary datastore
- Unmount source datastore and delete the source datastore
- Re-create a new VMFS6 datastore with the same LUN
- Move back all the VMs and its folder to new VMFS6 datastore
A lot of manual pieces of work right! if its a matter of 5-10 datastore then there should not be any problem in upgrading datastores manually. However, almost all enterprise infrastructures work with hundreds or even thousands of datastores and you certainly need an automated way to do the upgrade.
Update-VMfsdatastore
PowerCLI has introduced this cmdlet with PowerCLI 6.5, and all the steps which I explained to you earlier are done by this cmdlet.
The “Script”
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
$dslist = Get-Content J:\PSScripts\VMFS6\ds.txt $credential= Get-Credential $vc= Read-Host "Enter vCenter Name" $tempDs= Read-Host "Specify Temp Datastore Name" Connect-VIServer -Server $vc -Credential $credential Foreach ($ds in $dslist) { $datastore=Get-Datastore-Name $ds $tempdatastore=Get-Datastore-Name $tempds Update-VmfsDatastore-server $Global:defaultVIserver-Datastore $datastore-TemporaryDatastore $tempdatastore-Confirm:$false-Verbose } Disconnect-VIServer |
The above script is just a snippet from my actual production script, You can modify this to suit your environment and need.
Key Take Aways
-
- There should be an update required from VMware to allow users to define max number of VMs to storage vMotion at a time. This will eventually speed up the upgrade process. As of now update-vmfsdatastore migrates one VM at a time.
@PowerCLI it would be great if update-vmfsdatastore allows users to define number of VMs which can be simultaneously migrated during the upgrade process. Prod env datastores contains many VMs and only one VM migration at a time will take much time during overall upgrade process.
— Jatin purohit (@jatinpurohit92) September 15, 2018
- During my tests in POC, It was observed that upgrade was failing on datastores which had vmkdump files stored on it, skip any datastore which has vmkdump files, You can skip those datastores by doing something like this-
1 2 3 4 5 6 7 8 |
if((Get-ChildItem $datastore.DatastoreBrowserPath).Name -contains 'vmkdump') { Write-Host"skipping this $ds" } else { Update-VmfsDatastore-server $Global:defaultVIserver-Datastore $datastore-TemporaryDatastore $tempdatastore-Confirm:$false-Verbose } |
- After migrating all active or registered VMs from the source datastore, if swap files or delta.vmdk (snapshots of a virtual disk) files are found, the datastore will not be upgraded.
Visit PowerCLI reference to know more about this cmdlet and its usage.
Hope you have enjoyed this post. Would love to hear back your feedback, challenges and use case regarding VMFS6 upgrade.
Thanks,