13 Replies Latest reply on Sep 30, 2020 10:02 AM by bgr5899

    ESXi 6.7u3 - Install-VMHostPatch -LocalPath

    bgr5899 Novice

      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.

        • 1. Re: ESXi 6.7u3 - Install-VMHostPatch -LocalPath
          LucD Guru
          vExpertUser ModeratorsCommunity Warriors

          Do you also get an issue when you are using HostPath (after you uploaded the patch/vib to a datastore)?

          Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
          • 2. Re: ESXi 6.7u3 - Install-VMHostPatch -LocalPath
            bgr5899 Novice

            I did test with HostPath and it was successful.

            • 3. Re: ESXi 6.7u3 - Install-VMHostPatch -LocalPath
              LucD Guru
              vExpertUser ModeratorsCommunity Warriors

              Did you check the vpxd log if there is any additional information in there?
              And the esxupdate.log on the targetted ESXi node?

              Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
              • 4. Re: ESXi 6.7u3 - Install-VMHostPatch -LocalPath
                bgr5899 Novice

                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.

                • 5. Re: ESXi 6.7u3 - Install-VMHostPatch -LocalPath
                  LucD Guru
                  User ModeratorsCommunity WarriorsvExpert

                  That looks like a bug.
                  I would suggest you open an SR.

                  Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                  • 6. Re: ESXi 6.7u3 - Install-VMHostPatch -LocalPath
                    bgr5899 Novice

                    Thanks LucD, I just submitted a SR. For my own sanity were you able to replicate the issue?

                    • 7. Re: ESXi 6.7u3 - Install-VMHostPatch -LocalPath
                      LucD Guru
                      User ModeratorsvExpertCommunity Warriors

                      No, I'm fully migrated to 7I'm afraid

                      Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                      • 8. Re: ESXi 6.7u3 - Install-VMHostPatch -LocalPath
                        bgr5899 Novice

                        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).

                        • 9. Re: ESXi 6.7u3 - Install-VMHostPatch -LocalPath
                          bgr5899 Novice

                          For my sanity can anyone attempt to replicate the issue I am seeing?

                          • 10. Re: ESXi 6.7u3 - Install-VMHostPatch -LocalPath
                            LucD Guru
                            User ModeratorsvExpertCommunity Warriors

                            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: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                            • 11. Re: ESXi 6.7u3 - Install-VMHostPatch -LocalPath
                              bgr5899 Novice

                              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.

                              • 12. Re: ESXi 6.7u3 - Install-VMHostPatch -LocalPath
                                LucD Guru
                                vExpertCommunity WarriorsUser Moderators

                                Out of curiosity, can you try the following script?
                                That's one I use quite often for patching ESXi nodes.

                                 

                                $esxName = 'MyEsx'

                                $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: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                                • 13. Re: ESXi 6.7u3 - Install-VMHostPatch -LocalPath
                                  bgr5899 Novice

                                  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.