4 Replies Latest reply on Jul 4, 2017 4:51 PM by bgwallace

    Automate ESXi Embedded Host Client upgrades

    bgwallace Novice

      Team,

      Is there a simple, recommended solution folks typically use to automate upgrades of the client in ESXi 6.5?

      Thanks,
      Brad

        • 1. Re: Automate ESXi Embedded Host Client upgrades
          yezdi Master
          vExpert

          Hi Brad,

           

          The following article has the script for automating installation of vibs. A minor tweak will help you to use it for upgrading the VIBs.

           

           

          https://www.brianjgraf.com/2015/08/13/automate-install-embedded-host-client-esxi-fling-hosts-cluster/

          comment this condition.

          if (($ESXCLI.software.vib.list() | Select AcceptanceLevel,ID,InstallDate,Name,ReleaseDate,Status,Vendor,Version | Where {$_.Name -match "esx-ui"})) {Write-host "It appears ESX-UI is already installed on $_. Skipping..." -ForegroundColor Yellow} else {

          -SD [vExpert 14-20, VCIX6-NV&DCV,RHCE,AWS-SAA]
          https://pingforinfo.com
          https://twitter.com/sreejeshd

          • 2. Re: Automate ESXi Embedded Host Client upgrades
            bgwallace Novice

            Hi yezdi,

             

            Thanks for your help!  This is a great start and I'll definitely take a look into it.  However, I'm primarily a macOS user so it would be great if I didn't have to rely on PowerCLI and Windows for this to work.

             

            If you or anyone else knows of a solution out there which can be loaded directly onto the ESXi server and do what it needs to do from there in order to monitor for the latest release and automatically upgrade when one is found that would be invaluable.

             

            Best regards,

            Brad

            • 4. Re: Automate ESXi Embedded Host Client upgrades
              bgwallace Novice

              I couldn't find anything online so I put together the solution below.  It's pretty basic and crude, but feel free to use it or tweak/enhance it if you like.  The solution will automatically update the ESXi Host Client to the latest version every morning at 4am and if a reboot is needed it will shutdown any powered on VMs and then reboot the host.  For the VMs to restart automatically after the reboot, I'm using the built-in Autostart feature of ESXi.

               

              • FTP the attached hostStartup.sh and updateEsxiHostClient.sh script files to a datastore location on the ESXi host.  For this example, I'll be using /vmfs/volumes/datastore1/bin.  If you use a different location, you'll need to substitute the path inside the hostStartup.sh script.
              • SSH to the ESXi host as root.
                • Run the following commands.  If you used a different script location in the very first step, you'll need to substitute the path.

              cd /vmfs/volumes/datastore1/bin

              chmod +x hostStartup.sh

              chmod +x updateHostClient.sh

                • Add the script text below to the end of /etc/rc.local.d/local.sh but before the "exit 0" statement.  If you used a different script location in the very first step, you'll need to substitute the path.

              # Call hostStartup.sh

              /vmfs/volumes/datastore1/bin/hostStartup.sh