User Tools

Site Tools


os:esxi:update

This is an old revision of the document!


ESXi - Update ESXi Host on CLI

This page describes the update procedure of a standalone ESXi host on command line. The commands can be performed over SSH or on the ESXi Shell.

Check current Version

Get the version and build information about the host just to know what you are working on.

~ # esxcli system version get
   Product: VMware ESXi
   Version: 6.0.0
   Build: Releasebuild-2494585
   Update: 0
   Patch: 0

Configure firewall for outgoing HTTP connections

To update your host with VIB's from the internet you have to allow httpClient in the firewall. You can check if the connections are alowed with the following command.

~ # esxcli network firewall ruleset  list -r httpClient
Name        Enabled
----------  -------
httpClient     true

If the command returns false you can allow it with the following command.

~ # esxcli network firewall ruleset set -r httpClient -e true

Get the latest profile name

Now you have to determine the profile you want to update to.

You can perform this action on command line.

~ # esxcli software sources profile list -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml | grep ESXi-6
ESXi-6.0.0-20150404001-standard   VMware, Inc.  PartnerSupported
ESXi-6.0.0-20150704001-standard   VMware, Inc.  PartnerSupported
ESXi-6.0.0-20150704001-no-tools   VMware, Inc.  PartnerSupported
ESXi-6.0.0-20150404001-no-tools   VMware, Inc.  PartnerSupported
ESXi-6.0.0-2494585-standard       VMware, Inc.  PartnerSupported
ESXi-6.0.0-20150504001-no-tools   VMware, Inc.  PartnerSupported
ESXi-6.0.0-20150701001s-no-tools  VMware, Inc.  PartnerSupported
ESXi-6.0.0-20150701001s-standard  VMware, Inc.  PartnerSupported
ESXi-6.0.0-20150504001-standard   VMware, Inc.  PartnerSupported
ESXi-6.0.0-2494585-no-tools       VMware, Inc.  PartnerSupported

There is a web page with detailed information about the updates, including VIB names with link, short description, imageprofile name and a lot more. I really like it. It is more comfortable to get the profile name on the web page than on CLI. VMware ESXi Patch Tracker

Stop running VM's

To update the host, you have to enter the maintenance mode which requires no running machines. So let's stop the running machines.

Show which VM's are running:

~ # esxcli vm process list
my_vm_x
   World ID: 35930
   Process ID: 0
   VMX Cartel ID: 35699
   UUID: 56 4d 67 bf 2c 52 e1 e0-33 1b 57 42 02 d8 d8 3b
   Display Name: my_vm_x
   Config File: /vmfs/volumes/5463f5fa-e9e1b35a-983d-6451066626e8/my_vm_x/my_vm_x.vmx

my_vm_y
   World ID: 36398
   Process ID: 0
   VMX Cartel ID: 36397
   UUID: 56 4d f9 f5 10 4e fa e0-42 e8 80 17 a2 bf b5 93
   Display Name: my_vm_y
   Config File: /vmfs/volumes/5463f5fa-e9e1b35a-983d-6451066626e8/my_vm_y/my_vm_y.vmx

Now get the Vmid's of this VM's:

~ # vim-cmd vmsvc/getallvms
Vmid  Name     File                                    Guest OS               Version  Annotation                                                                                                             
1     my_vm_x  [my_host_storage1] my_vm_x/my_vm_x.vmx  windows8Server64Guest  vmx-11   
11    my_vm_z  [my_host_storage1] my_vm_z/my_vm_z.vmx  solaris10_64Guest      vmx-11   
13    my_vm_y  [my_host_storage1] my_vm_y/my_vm_y.vmx  debian8_64Guest        vmx-11   

Repeat the following command with every Vmid of your running VM's:

~ # vim-cmd vmsvc/power.shutdown 1

I use the following one-liner to shutdown all my running vm's. Use it at your own risk.

~ # for vmid in $(vim-cmd vmsvc/getallvms | egrep "$(esxcli vm process list | grep "^[^ ]" | xargs | sed 's/ /|/g')" | awk '{ if($1 ~ /^[0-9]*$/ ) { print $1} }'); do vim-cmd vmsvc/power.shutd
own $vmid; done

Set host to maintenance mode

Now set the host to maintenance mode:

~ # esxcli system maintenanceMode set -e true

If the command won't return, there are some problems entering maintenance mode. Probably some VM's are still running. Check and shutdown them on another SSH session or with VMware vSphere Client.

If the command returns you can check the current mode with the following command.

~ # esxcli system maintenanceMode get
Enabled

Start upgrade process

Now you are ready to upgrade. Replace the profile name of the following command (ESXi-6.0.0-20150704001-standard) with your prefered profile name to upgrade to. It takes some minutes until the Update Result is displayed.

~ # esxcli software profile update -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml -p ESXi-6.0.0-20150704001-standard

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: VMware_bootbank_esx-base_6.0.0-0.11.2809209, VMware_bootbank_lsu-lsi-lsi-mr3-plugin_1.0.0-2vmw.600.0.11.2809209, VMware_bootbank_lsu-lsi-megaraid-sas-plugin_1.0.0-2vmw.600.0.11.2809209, VMware_bootbank_misc-drivers_6.0.0-0.11.2809209, VMware_bootbank_sata-ahci_3.0-21vmw.600.0.11.2809209, VMware_bootbank_scsi-hpsa_6.0.0.44-4vmw.600.0.0.2494585, VMware_bootbank_scsi-mpt2sas_19.00.00.00-1vmw.600.0.0.2494585, VMware_locker_tools-light_6.0.0-0.11.2809209
   VIBs Removed: Hewlett-Packard_bootbank_scsi-hpsa_5.5.0.106-1OEM.550.0.0.1331820, LSI_bootbank_scsi-mpt2sas_15.10.06.00.1vmw-1OEM.550.0.0.1198610, VMware_bootbank_esx-base_6.0.0-0.0.2494585, VMware_bootbank_lsu-lsi-lsi-mr3-plugin_1.0.0-1vmw.600.0.0.2494585, VMware_bootbank_lsu-lsi-megaraid-sas-plugin_1.0.0-1vmw.600.0.0.2494585, VMware_bootbank_misc-drivers_6.0.0-0.0.2494585, VMware_bootbank_sata-ahci_3.0-21vmw.600.0.0.2494585, VMware_locker_tools-light_6.0.0-0.0.2494585
   VIBs Skipped: VMWARE_bootbank_mtip32xx-native_3.8.5-1vmw.600.0.0.2494585, VMware_bootbank_ata-pata-amd_0.3.10-3vmw.600.0.0.2494585, VMware_bootbank_ata-pata-atiixp_0.4.6-4vmw.600.0.0.2494585, VMware_bootbank_ata-pata-cmd64x_0.2.5-3vmw.600.0.0.2494585, VMware_bootbank_ata-pata-hpt3x2n_0.3.4-3vmw.600.0.0.2494585, VMware_bootbank_ata-pata-pdc2027x_1.0-3vmw.600.0.0.2494585, VMware_bootbank_ata-pata-serverworks_0.4.3-3vmw.600.0.0.2494585, VMware_bootbank_ata-pata-sil680_0.4.8-3vmw.600.0.0.2494585, VMware_bootbank_ata-pata-via_0.3.3-2vmw.600.0.0.2494585, VMware_bootbank_block-cciss_3.6.14-10vmw.600.0.0.2494585, VMware_bootbank_cpu-microcode_6.0.0-0.0.2494585, VMware_bootbank_ehci-ehci-hcd_1.0-3vmw.600.0.0.2494585, VMware_bootbank_elxnet_10.2.309.6v-1vmw.600.0.0.2494585, VMware_bootbank_emulex-esx-elxnetcli_10.2.309.6v-0.0.2494585, VMware_bootbank_esx-dvfilter-generic-fastpath_6.0.0-0.0.2494585, VMware_bootbank_esx-tboot_6.0.0-0.0.2494585, VMware_bootbank_esx-xserver_6.0.0-0.0.2494585, VMware_bootbank_ima-qla4xxx_2.02.18-1vmw.600.0.0.2494585, VMware_bootbank_ipmi-ipmi-devintf_39.1-4vmw.600.0.0.2494585, VMware_bootbank_ipmi-ipmi-msghandler_39.1-4vmw.600.0.0.2494585, VMware_bootbank_ipmi-ipmi-si-drv_39.1-4vmw.600.0.0.2494585, VMware_bootbank_lpfc_10.2.309.8-2vmw.600.0.0.2494585, VMware_bootbank_lsi-mr3_6.605.08.00-6vmw.600.0.0.2494585, VMware_bootbank_lsi-msgpt3_06.255.12.00-7vmw.600.0.0.2494585, VMware_bootbank_lsu-hp-hpsa-plugin_1.0.0-1vmw.600.0.0.2494585, VMware_bootbank_lsu-lsi-lsi-msgpt3-plugin_1.0.0-1vmw.600.0.0.2494585, VMware_bootbank_lsu-lsi-mpt2sas-plugin_1.0.0-1vmw.600.0.0.2494585, VMware_bootbank_lsu-lsi-mptsas-plugin_1.0.0-1vmw.600.0.0.2494585, VMware_bootbank_misc-cnic-register_1.78.75.v60.7-1vmw.600.0.0.2494585, VMware_bootbank_net-bnx2_2.2.4f.v60.10-1vmw.600.0.0.2494585, VMware_bootbank_net-bnx2x_1.78.80.v60.12-1vmw.600.0.0.2494585, VMware_bootbank_net-cnic_1.78.76.v60.13-2vmw.600.0.0.2494585, VMware_bootbank_net-e1000_8.0.3.1-5vmw.600.0.0.2494585, VMware_bootbank_net-e1000e_2.5.4-6vmw.600.0.0.2494585, VMware_bootbank_net-enic_2.1.2.38-2vmw.600.0.0.2494585, VMware_bootbank_net-forcedeth_0.61-2vmw.600.0.0.2494585, VMware_bootbank_net-igb_5.0.5.1.1-5vmw.600.0.0.2494585, VMware_bootbank_net-ixgbe_3.7.13.7.14iov-20vmw.600.0.0.2494585, VMware_bootbank_net-mlx4-core_1.9.7.0-1vmw.600.0.0.2494585, VMware_bootbank_net-mlx4-en_1.9.7.0-1vmw.600.0.0.2494585, VMware_bootbank_net-nx-nic_5.0.621-5vmw.600.0.0.2494585, VMware_bootbank_net-tg3_3.131d.v60.4-1vmw.600.0.0.2494585, VMware_bootbank_net-vmxnet3_1.1.3.0-3vmw.600.0.0.2494585, VMware_bootbank_nmlx4-core_3.0.0.0-1vmw.600.0.0.2494585, VMware_bootbank_nmlx4-en_3.0.0.0-1vmw.600.0.0.2494585, VMware_bootbank_nmlx4-rdma_3.0.0.0-1vmw.600.0.0.2494585, VMware_bootbank_nvme_1.0e.0.35-1vmw.600.0.0.2494585, VMware_bootbank_ohci-usb-ohci_1.0-3vmw.600.0.0.2494585, VMware_bootbank_qlnativefc_2.0.12.0-5vmw.600.0.0.2494585, VMware_bootbank_rste_2.0.2.0088-4vmw.600.0.0.2494585, VMware_bootbank_sata-ata-piix_2.12-10vmw.600.0.0.2494585, VMware_bootbank_sata-sata-nv_3.5-4vmw.600.0.0.2494585, VMware_bootbank_sata-sata-promise_2.12-3vmw.600.0.0.2494585, VMware_bootbank_sata-sata-sil24_1.1-1vmw.600.0.0.2494585, VMware_bootbank_sata-sata-sil_2.3-4vmw.600.0.0.2494585, VMware_bootbank_sata-sata-svw_2.3-3vmw.600.0.0.2494585, VMware_bootbank_scsi-aacraid_1.1.5.1-9vmw.600.0.0.2494585, VMware_bootbank_scsi-adp94xx_1.0.8.12-6vmw.600.0.0.2494585, VMware_bootbank_scsi-aic79xx_3.1-5vmw.600.0.0.2494585, VMware_bootbank_scsi-bnx2fc_1.78.78.v60.8-1vmw.600.0.0.2494585, VMware_bootbank_scsi-bnx2i_2.78.76.v60.8-1vmw.600.0.11.2809209, VMware_bootbank_scsi-fnic_1.5.0.45-3vmw.600.0.0.2494585, VMware_bootbank_scsi-ips_7.12.05-4vmw.600.0.0.2494585, VMware_bootbank_scsi-megaraid-mbox_2.20.5.1-6vmw.600.0.0.2494585, VMware_bootbank_scsi-megaraid-sas_6.603.55.00-2vmw.600.0.0.2494585, VMware_bootbank_scsi-megaraid2_2.00.4-9vmw.600.0.0.2494585, VMware_bootbank_scsi-mptsas_4.23.01.00-9vmw.600.0.0.2494585, VMware_bootbank_scsi-mptspi_4.23.01.00-9vmw.600.0.0.2494585, VMware_bootbank_scsi-qla4xxx_5.01.03.2-7vmw.600.0.0.2494585, VMware_bootbank_uhci-usb-uhci_1.0-3vmw.600.0.0.2494585, VMware_bootbank_xhci-xhci_1.0-2vmw.600.0.0.2494585

Exit maintenance mode

You may want to exit the maintenance mode so your VM's will start automatically after reboot. This can be especially useful if your management machine is on this ESXi host and you update to another major version because it can occur that SSH is disabled after reboot.

Exit maintenance mode:

~ # esxcli system maintenanceMode set -e false

Check status:

~ # esxcli system maintenanceMode get
Disabled

Reboot host

Reboot your host. You will loose your SSH connection to it.

~ # reboot 
~ # Connection to my_host closed by remote host.
Shared connection to my_host closed.

Reconnect to host

Restart your SSH connection to your host if it is back.

manu@automatix:~$ ssh my_host
The time and date of this login have been sent to the system logs.

VMware offers supported, powerful system administration tools.  Please
see www.vmware.com/go/sysadmintools for details.

The ESXi Shell can be disabled by an administrative user. See the
vSphere Security documentation for more information.
~ # 

Check running version

Now check again your current ESXi host version. The output should differ from the last execution.

~ # esxcli system version get
   Product: VMware ESXi
   Version: 6.0.0
   Build: Releasebuild-2809209
   Update: 0
   Patch: 11

Credits

os/esxi/update.1437857876.txt.gz · Last modified: 2015-07-25 22:57 by root