In the Part 1 of this series, I was writing about the most common cases which might prevent a successful migration to VMFS-6. There is another one to cover.
For ESXi hosts that boot from a flash storage or from memory, a diagnostic core dump file can also be placed on a shared datastore. You won’t be able to un-mount this datastore without deleting a core dump first.
VMware recommends using an esxcli utility to view/edit the core dump settings. This also can be automated via PowerCLI.
To check if the core dump file exists and is active, please use the following code:
# File name: Get-VMHostCoredumpLocation.ps1 | |
# Description: This script checks the core dump location for ESXi hosts. | |
# | |
# 11/10/2018 - Version 1.0 | |
# - Initial Release | |
# | |
# Author: Roman Dronov (c) | |
# Get information about the core dump location for ESXi hosts | |
Write-Host "`nCore Dump Settings:`r" -ForegroundColor Green | |
ForEach ($vmhost in $(Get-VMHost | sort Name)) { | |
$esxcli2 = Get-EsxCli -VMHost $vmhost -V2 | |
$esxcli2.system.coredump.file.get.Invoke() | Select @{N='Host Name';E={$vmhost}},@{N='Active Core Dump File';E={$_.Active}} #| Format-List | |
} | |
Clear-Variable vmhost,esxcli2 -Scope Global |
To delete an old configuration that points to the VMFS-5 datastore, the following script can help:
# File name: Remove-VMHostCoredumpLocation.ps1 | |
# Description: This script removes a core dump file for the particular ESXi host. | |
# | |
# 11/03/2019 - Version 1.0 | |
# - Initial release | |
# | |
# Author: Roman Dronov (c) | |
# Define common functions | |
function ex {exit} | |
# Get the host name and check it is valid | |
$vmhosts = Get-VMHost | ? {$_.ConnectionState -eq "Connected" -or $_.ConnectionState -eq "Maintenance"} | ForEach-Object {$_.Name.Split('.')[0]} | |
$vmhost = (Read-Host -Prompt "`n Please type in the ESXi host name").Split('.')[0] | |
While ($vmhosts.Contains("$vmhost") -ne "True") { | |
Write-Host "`n Checking the host exists..." -NoNewline | |
Write-Host " The host is not reachable." -ForegroundColor Yellow | |
$vmhost = Read-Host -Prompt "`n Please type in the host name correctly" | |
} | |
$vmhost = $vmhost + "*" | |
# Get the system configuration | |
$esxcli2 = Get-EsxCli -VMHost $vmhost -V2 | |
# Activate the current coredump (this is to identify it properly later in this script) | |
Write-Host "`n Searching for a coredump file and trying to activat it..." -NoNewline | |
$arguments = $esxcli2.system.coredump.file.set.CreateArgs() | |
$arguments.Item('enable') = $true | |
$arguments.Item('smart') = $true | |
Try { | |
$activation = $esxcli2.system.coredump.file.set.Invoke($arguments) | |
} | |
Catch [Exception]{ | |
Write-Host " File doen't exist!" -ForegroundColor Yellow | |
} | |
# Get the current coredump configuration | |
$dumpConfigured = $esxcli2.system.coredump.file.get.Invoke().Configured | |
# Prompt for the coredump removal | |
If ($dumpConfigured -ne ''){ | |
Write-Host " File exists." -ForegroundColor Green | |
Write-Host "`n Current configuration: $dumpConfigured" | |
$choice = $null | |
While ("Yes","No" -notcontains $choice) { | |
$choice = Read-Host -Prompt "`n Would you like to remove this file? (Yes/No)" | |
} | |
Switch ($choice){ | |
"Yes" { | |
# Remove the coredump file | |
Write-Host " Removing the old coredump file..." -NoNewline | |
$arguments = $esxcli2.system.coredump.file.remove.CreateArgs() | |
$arguments.Item('force') = $true | |
$arguments.Item('file') = "$dumpConfigured" | |
$remove = $esxcli2.system.coredump.file.remove.Invoke($arguments) | |
Write-Host " Done!" -ForegroundColor Green | |
} | |
"No" { | |
# Exit this script | |
Write-Host "`n Exiting..." | |
ex | |
} | |
} | |
} | |
Write-Host "`n Exiting..." |
With this change made you would be able to continue migrating to VMFS-6 without any issue.
If you have any suggestions or concerns, feel free to share them in the comments below.