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:
- Download the latest ESXi version from the VMware website
- Log on to the ESXi server using SSH
- Verify running ESXi version using e.g.
- 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/
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.
- Shut down the running virtual machines on the host byt first identify their VM IDs and then shutting them down:
- 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 - Shut down the VMs by running:
vim-cmd vmsvc/power.shutdown 12
- Identify VM IDs by running:
- Put the ESXi host in maintenance mode by running the following command:
vim-cmd /hostsvc/maintenance_mode_enter
- Verify the existing ESXi host software profile by running the following command:
esxcli software profile get
In my case i was using the Standard profile - 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 included - 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: - Reboot the ESXi host, via DCUI
- Log on via SSH when the host has been rebooted
- Verify that the new version is running using “vmware -v”, “dcui” or “esxcli software profile get”
- Exit maintenance mode by running the following command:
vim-cmd /hostsvc/maintenance_mode_exit
- 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