Upgrade to vSphere ESXi 6 via command line


The other day i had to upgrade my lab ESXi mgmt server from version 5.5 to 6.0 host via the command prompt and it’s actually pretty straight forward. I took the following steps to perform the upgrade:

  1. Download the latest ESXi version from the VMware website
  2. Log on to the ESXi server using SSH
  3. Verify running ESXi version using e.g.
    1. run the following command:
      vmware -v
      In my case i was running ESXi 5.5.0 build-2143827
      Screen Shot 2015-06-25 at 11.36.32
    2. Starting the Direct Console User Interface (DCUI) from the SSH session by typing:
      Screen Shot 2015-06-25 at 12.04.40
      Press ctrl c to leave the DCUI mode and get back to the original SSH session
  4. Upload the ESXi .zip depot to the ESXi host by running the following command:
    scp VMware-ESXi-6.0.0-2494585-depot.zip root@10.10.100.xyz:/vmfs/volumes/54aeddbd-e5943701-1cf2-f8db88fbd420/
    Screen Shot 2015-06-25 at 11.59.16
    The 54aeddbd-e5943701-1cf2-f8db88fbd420 directory is scratch directory where e.g. the core, downloads, var directories exists. When upgrading multiple ESXi hosts you should use a shared datastore but i didn’t have one available for my single ESXi mgmt host. Thanks Mostafa for pointing this out.
    Screen Shot 2015-06-25 at 11.59.32
  5. Shut down the running virtual machines on the host byt first identify their VM IDs and then shutting them down:
    1. Identify VM IDs by running:
      vim-cmd vmsvc/getallvms
      This will give you output like:
      Vmid/Name/File/Guest OS/Version/Annotation
      In my case e.g:
      12/ad01/[MGMT-DS02] ad01/ad01.vmx/windows8Server64Guest/vmx-10
    2. Shut down the VMs by running:
      vim-cmd vmsvc/power.shutdown 12
  6. Put the ESXi host in maintenance mode by running the following command:
    vim-cmd /hostsvc/maintenance_mode_enter
    Screen Shot 2015-06-25 at 11.56.34
  7. Verify the existing ESXi host software profile by running the following command:
    esxcli software profile get
    In my case i was using the Standard profileScreen Shot 2015-06-25 at 11.53.24
  8.  Verify the profiles available in the VMware VMware-ESXi-6.0.0-2494585-depot.zip file by running the following command:
    esxcli software sources profile list –depot=/vmfs/volumes/54aeddbd-e5943701-1cf2-f8db88fbd420/VMware-ESXi-6.0.0-2494585-depot.zip
    Important: Make sure to use two minus – – signs before depot
    Both the Standard and no-tools profiles were includedScreen Shot 2015-06-25 at 12.02.48
  9. Perform the upgrade by running the following command:
    esxcli software profile update –depot=/vmfs/volumes/54aeddbd-e5943701-1cf2-f8db88fbd420/VMware-ESXi-6.0.0-2494585-depot.zip –profile=ESXi-6.0.0-2494585-standard
    Important: Make sure you use
    * the update and not install command
    * use two minus – – signs before profile
    This was the output from the successful upgrade: Screen Shot 2015-06-25 at 12.04.18
  10. Reboot the ESXi host, via DCUI
  11. Log on via SSH when the host has been rebooted
  12. Verify that the new version is running using “vmware -v”,  “dcui” or “esxcli software profile get”
    Screen Shot 2015-06-25 at 12.47.52
  13. Exit maintenance mode by running the following command:
    vim-cmd /hostsvc/maintenance_mode_exit
    Screen Shot 2015-06-25 at 12.50.15
  14. Power on your VMs by running the following command:
    vim-cmd vmsvc/power.on VMid
    In my case i started with the VM ID = 2

Simple as that to upgrade the ESXi host from version 5.5 to 6.0 via CLI.

3 pings

Comments have been disabled.