Having an issue trying to install VIBs using "Install-VMHostPatch -LocalPath <Path to File>". Getting the following error: Error occured when connecting to host Response status code does not indicate success: 404 (Not Found). Error only happens with ESXi 6.7, no issues running the same command against 6.5.
Do you also get an issue when you are using HostPath (after you uploaded the patch/vib to a datastore)?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I did test with HostPath and it was successful.
Did you check the vpxd log if there is any additional information in there?
And the esxupdate.log on the targetted ESXi node?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
LucD -
Installed a new ESXi host using Image ESXi-6.7.0-8169922-standard
This is all I can find in the hostd log that might be of use:
Accepted password for user root from 192.168.10.10
2020-09-17T21:29:01.998Z info hostd[2099171] [Originator@6876 sub=Vimsvc.ha-eventmgr] Event 98 : User root@192.168.10.10 logged in as PowerCLI
2020-09-17T21:29:01.998Z info hostd[2099171] [Originator@6876 sub=HTTP server /folder req=000000ed6d50e470 user=root] Got HTTP GET request for /folder?dcPath=ha-datacenter
IpmiIfcOpenIpmiOpen: open(/dev/ipmi0, RDWR) failed 2 No such file or directory
Just to verify the file path again; I installed a new ESXi 6.5 host and was able to install the VIB using the same command.
That looks like a bug.
I would suggest you open an SR.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks LucD, I just submitted a SR. For my own sanity were you able to replicate the issue?
No, I'm fully migrated to 7I'm afraid
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Lucd -
Submitted logs for the SR. I decided to test Install-VMHostPatch -LocalPath <path to vib> against ESXI 7.0 and received the same error:
Error occurred when connecting to host : Response status code does not indicate success: 404 (Not Found).
For my sanity can anyone attempt to replicate the issue I am seeing?
I tried on several of my ESXi nodes, and I can't reproduce your issue I'm afraid.
Are you connected to the VCSA or a specific ESXi node?
That ha-datacenter message is confusing
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I am connecting directly to a ESXI node that is not connected to any vCenter. So weird the command runs against a 6.5 host but not a 6.7 or 7 host.
Out of curiosity, can you try the following script?
That's one I use quite often for patching ESXi nodes.
$user = 'root'
$pswd = 'VMware1!'
$patchFile = 'C:\ESXi-Patch\VMware-ESXi-7.0b-16324942-depot.zip'
$patchName = $patchFile.Split('\')[-1].TrimEnd('.zip')
# Uncompress patch locally
$tempFolder = New-TemporaryFile | %{
Remove-Item -Path $_.FullName
New-Item -Path "$($_.FullName)\$patchName" -ItemType Directory
}
Expand-Archive -Path $patchFile -DestinationPath $tempFolder
$fileSizeGB = (Get-ChildItem -Path $tempFolder -Recurse | Measure-Object -Property Length -Sum).Sum/1GB
# Copy patch to datastore on ESXi node
Connect-VIServer -Server $esxName -User $user -Password $pswd | Out-Null
$esx = Get-VMHost
$patchMgr = Get-View -Id $esx.ExtensionData.ConfigManager.PatchManager
$metaUrl = @("$($ds.ExtensionData.Info.Url)/$patchName/metadata.zip")
$task = $patchMgr.CheckHostPatch_Task($metaUrl,$null,$null)
$repo = New-Object VMware.Vim.HostPatchManagerLocator
$repo.Url = "$($ds.ExtensionData.Info.Url)/$patchName/vib20"
$taskMoRef = $patchMgr.ScanHostPatchV2_Task($metaUrl,$null,$null)
$oldVersion = "$($esx.Version) $($esx.Build)"
$ds = Get-Datastore -RelatedObject $esx | where{$_.FreeSpaceGB -gt $fileSizeGB} | Get-Random
if($ds){
Set-VMHost -VMHost $esx -State Maintenance -Confirm:$false | Out-Null
Copy-DatastoreItem -Item $tempFolder -Destination $ds.DatastoreBrowserPath -Recurse
Install-VMHostPatch -VMHost $esx -HostPath "$($ds.ExtensionData.Info.Url)/$patchName/metadata.zip"
if($esx.ExtensionData.Summary.RebootRequired){
Restart-VMHost -VMHost $esx -Confirm:$false
Disconnect-VIServer -Server $esxName -Force -Confirm:$false
while(!(Test-Connection -ComputerName $esxName -Quiet)){
sleep 5
}
Connect-VIServer -Server $esxName -User $user -Password $pswd | Out-Null
}
$esx = Get-VMHost
$newVersion = "$($esx.Version) $($esx.Build)"
Set-VMHost -VMHost $esx -State Connected -Confirm:$false | Out-Null
[ordered]@{
VMHost = $esx.Name
OldVersion = $oldVersion
NewVersion = $newVersion
}
$si = Get-View ServiceInstance
$fileMgr = Get-View -Id $si.Content.FileManager
$fileMgr.DeleteDatastoreFile("[$($ds.Name)] $patchName/",(Get-View -Id $ds.DatacenterId).MoRef)
}
else{
Write-Error "Could not find a datastore with sufficient free space ($([math]::Round($fileSizeGB,1)) GB)"
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
LucD - This script worked. I am still waiting on a response to the SR. For now I will just use Update Manager until I get a resolution from support. Thank you for the assistance.
LucD - Software bug was found by Engineering. Fix will be applied in PowerCLI 12.2!
Thanks for sharing that
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference