Upgrading to ESXi 6.5 from the command line

When rebuilding ESXi hosts, people tend to just go for the easiest option which is to wipe the disk array and completely reinstall the operating system. However, doing an in place upgrade from the command line is really simple. Here’s how it’s done:

  1. SSH onto the host you want to upgrade using Putty.ssh-upgrade-1
  2. Enter your root credentialsssh-upgrade-2
  3. Put the host into maintenance mode by running ‘vim-cmd /hostsvc/maintenance_mode_enter’. You could also do this via vCenter if you choose.ssh-upgrade-3
  4. Next you need to enable the firewall to allow http traffic through. To do this enter ‘esxcli network firewall ruleset set -e true -r httpClient’ssh-upgrade-4
  5. Now that we can get out to the web, we need to find the correct version of ESXi to download. To retrieve a list, enter ‘esxcli software sources profile list -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml | grep -i ESXi-6′. If you want to look for ESXI-6.5 just add.5 onto the linessh-upgrade-5
  6. It should return a list of versions in the repository.ssh-upgrade-6
  7. Now we can run the upgrade by entering ‘esxcli software profile update -p ESXi-6.5.0-4564106-standard -d http://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml‘. Replace the ESXI version with whichever one you want from the repository list.ssh-upgrade-7
  8. The command will start to downlad the ESXi code from the repository. Depending on the speed of your internet connection this could take a while. After a while you should see the screen fill up with filenames and you should be returned to the command linessh-upgrade-8
  9. Now if you use your slider on the putty window and scroll up a couple of pages you should see the command you typed. A few lines underneath it you should see a message saying the update completed successfully.ssh-upgrade-9
  10. That’s it. All you need to do now is reboot by typing ‘reboot’ and when you host boots back up it should be running the updated version of ESXi. The only think you may with to do is go back into the firewall settings and close the http port.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s