Update ESXi Server Using SSH¶
Overview¶
How to update an existing ESXi server using the Offline Bundle ZIP image via SSH.
Enable SSH on ESXi server¶
To use SSH the TPM-SSH service needs to be running. Services can be found in the ESXi web client under Host -> Manage -> Services Tab. If it is not running, click on TSM-SSH line and hit Start upper left of the table.
Copy Offline Bundle ZIP image¶
There are many ways to copy the ZIP image to the ESXi server. The two most common are via SCP (SSH Secure Copy) and using the Datastore Browser in the ESXI web client. I will show you know to copy the image using SCP, which is my preferred way.
SSH to the ESXi server.
ssh root@192.168.0.176
Get the datastore name¶
To find the path to the datastore use either the PowerCLI or esxcli commands
Using VMware PowerCLI¶
Use PowerShell on the workstaion, connect to the server and list the datastore(s).
Connect to the ESXi server, use force option if you have self signed cert (must do).
connect-VIServer 192.168.0.176 -Force
Specify Credential
Please specify server credential
User: root
Password for user root: *******
Name Port User
---- ---- ----
192.168.0.176 443 root
Get the configured datastore(s) and free space. The ZIP image is ~550Mb, so make sure you have storage space.
Get-Datastore
Name FreeSpaceGB CapacityGB
---- ----------- ----------
datastore1 74.493 337.500
datastore2 613.825 931.250
Using ESXi shell (SSH login)¶
Log in using SSH to the ESXi server and use the esxcli command to list the datastore(s).
esxcli storage filesystem list | grep -E "VMFS-|Mount"
Mount Point Volume Name UUID Mounted Type Size Free
------------------------------------------------- ------------------------------------------ ----------------------------------- ------- ------ ------------ ------------
/vmfs/volumes/63e74560-30f39de0-3f4f-a0cec8062788 datastore1 63e74560-30f39de0-3f4f-a0cec8062788 true VMFS-6 362387865600 81711333376
/vmfs/volumes/63e809cd-49506b80-1d48-a0cec8062788 datastore2 63e809cd-49506b80-1d48-a0cec8062788 true VMFS-6 999922073600 659089784832
You can use either the UUID or Volume Name. The Volume Name is a symbolic link to the UUID.
ls -l /vmfs/volumes/ | grep datastore
lrwxr-xr-x 1 root root 35 May 18 15:27 datastore1 -> 63e74560-30f39de0-3f4f-a0cec8062788
lrwxr-xr-x 1 root root 35 May 18 15:27 datastore2 -> 63e809cd-49506b80-1d48-a0cec8062788
Get the full path to the datastore¶
Once you have the datastore name use the BASH df command to get the full path.
df -h | grep datastore
VMFS-6 337.5G 261.4G 76.1G 77% /vmfs/volumes/datastore1
VMFS-6 931.2G 317.4G 613.8G 34% /vmfs/volumes/datastore2
Copy the image to the server¶
Make a new directory to store the offline Bundle ZIP image on the ESXi server.
mkdir /vmfs/volumes/datastore1/updates
Open a new PowerShell tab (session) on your workstation and copy the offline bundle (depot) ZIP, to the ESXi server.
scp $HOME\ESXi-8.0U1-build\ESXi-8.0U1-USBNIC.zip root@192.168.0.176:/vmfs/volumes/datastore1/updates/.
Switch back to the ESXi server PowerShell tab that you used to SSH into the ESXi server and verify the file was transferred.
ls /vmfs/volumes/datastore1/updates
ESXi-8.0U1-USBNIC.zip
Get the current ESXi server version¶
esxcli system version get
Product: VMware ESXi
Version: 8.0.0
Build: Releasebuild-21493926
Update: 0
Patch: 25
Make sure all VM’s are shutdown¶
List current running VM’s, should return with no running VM’s.
esxcli vm process list
List current VIB’s¶
Get the current installed VIB’s. This is a long list and we are only interested in USB Network driver FLING information. If you want to see the complete list issue the command without grep.
esxcli software vib list | grep vmkusb-nic-fling
vmkusb-nic-fling 1.11-1vmw.800.1.20.61054763 VMW VMwareCertified 2023-05-18
Update the the ESXi server¶
Get the image profile name.
esxcli software sources profile list -d /vmfs/volumes/datastore1/updates/ESXi-8.0U1-USBNIC.zip
Name Vendor Acceptance Level Creation Time Modification Time
-------------------------- -------- ---------------- ------------------- -----------------
ESXi-8.0U1-21495797-USBNIC Home Lab PartnerSupported 2023-04-18T00:00:00 2023-05-10T02:05:35
Preform a dry run (test) of the update. The full path to the ZIP images and image profile name are required.
esxcli software profile update -d /vmfs/volumes/datastore1/updates/ESXi-8.0U1-USBNIC.zip -p ESXi-8.0U1-21495797-USBNIC --dry-run
Update Result
Message: Dryrun only, host not changed. The following installers will be applied: [BootBankInstaller, LockerInstaller]
Reboot Required: true
VIBs Installed: VMW_bootbank_atlantic_1.0.3.0-11vmw.801.0.0.21495797, VMW_bootbank_bcm-mpi3_8.4.2.0.0.0-1vmw.801.0.0.21495797,
VMW_bootbank_bfedac-esxio_0.1-1vmw.801.0.0.21495797, VMW_bootbank_bnxtnet_223.0.0.0-1vmw.801.0.0.21495797,
VMW_bootbank_bnxtroce_223.0.0.0-1vmw.801.0.0.21495797, VMW_boot
....many more lines not shown
If no errors, apply the update, (tip - use the up arrow for previous command and remove –dry-run option from the command)
esxcli software profile update -d /vmfs/volumes/datastore1/updates/ESXi-8.0U1-USBNIC.zip -p ESXi-8.0U1-21495797-USBNIC
Update Result
Message: The update completed successfully, but the system needs to be rebooted for the changes to be effective.
Reboot Required: true
VIBs Installed: VMW_bootbank_atlantic_1.0.3.0-11vmw.801.0.0.21495797, VMW_bootbank_bcm-mpi3_8.4.2.0.0.0-1vmw.801.0.0.21495797,
VMW_bootbank_bfedac-esxio_0.1-1vmw.801.0.0.21495797, VMW_bootbank_bnxtnet_223.0.0.0-1vmw.801.0.0.21495797,
VMW_bootbank_bnxtroce_223.0.0.0-1vmw.801.0.0.21495797, VMW_boot
....many more lines not shown
Update is complete reboot the system.
reboot
Note
You may need to start SSH on the ESXi server, if you did not set the policy to start and stop with host.
Get the updated ESXi server version¶
SSH back into the ESXi server once it comes back up.
ssh root@192.168.0.176
List the ESXi version.
esxcli system version get
Product: VMware ESXi
Version: 8.0.1
Build: Releasebuild-21495797
Update: 1
Patch: 0
List updated VIB’s¶
Get the updated installed VIB’s. This is a long list and we are only interested in USB Network driver FLING information. If you want to see the complete list issue the command without grep.
esxcli software vib list | grep vmkusb-nic-fling
vmkusb-nic-fling 1.12-1vmw.801.0.0.64098092 VMW VMwareCertified 2023-05-18