Skip to content

Instantly share code, notes, and snippets.

@FlorianHeigl
Last active June 19, 2022 17:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FlorianHeigl/5e8a2cfb3ad798aaafcce44ecf9cd047 to your computer and use it in GitHub Desktop.
Save FlorianHeigl/5e8a2cfb3ad798aaafcce44ecf9cd047 to your computer and use it in GitHub Desktop.
ESXi Updates via CLI/SSH/ansible

alle laufenden vms suspenden

https://gist.githubusercontent.com/jpluimers/44c54e680b5d2887e3a5/raw/98aad36cc84376a84b608eafc686873f0376e997/esxi-suspend-all-VMs.sh

gibt einige coredumps. das sind vermutlich wieder vms mit sonderzeichen o.ae. im namen kommando fehlt

dann das hier

[u@h:~] vim-cmd /hostsvc/maintenance_mode_enter

updatepaket inhalt pruefen

[root@h:/vmfs/volumes/uuid-uuid-uuid] cd ; esxcli software sources profile list -d /vmfs/vol
umes/systemstore/VMware-ESXi-7.0U3d-19482537-depot.zip
Name                            Vendor        Acceptance Level  Creation Time        Modification Time
------------------------------  ------------  ----------------  -------------------  -----------------
ESXi-7.0U3sd-19482531-standard  VMware, Inc.  PartnerSupported  2022-03-29T00:00:00  2022-03-29T00:00:00
ESXi-7.0U3sd-19482531-no-tools  VMware, Inc.  PartnerSupported  2022-03-29T00:00:00  2022-03-11T13:53:29
ESXi-7.0U3d-19482537-standard   VMware, Inc.  PartnerSupported  2022-03-29T00:00:00  2022-03-29T00:00:00
ESXi-7.0U3d-19482537-no-tools   VMware, Inc.  PartnerSupported  2022-03-29T00:00:00  2022-03-11T15:01:02

sd: security only d: bugfix + security

update machen

fehlermeldung wegen cpu mittels uebergehen --no-hardware-warning

u@h:~] esxcli software profile update -d /vmfs/volumes/systemstore/VMware-ESXi-7.0U3d-19482537-depot.zip -p E
SXi-7.0U3d-19482537-standard
[...]
Update Result
   Message: The update completed successfully, but the system needs to be rebooted for the changes to be effective.
   Reboot Required: true

rebooten

(reboot)

dann wenn update fertig ist

[u@h:~] vim-cmd /hostsvc/maintenance_mode_exit

vms starten [u@h:~] vim-cmd vmsvc/getallvms | awk '{print "vim-cmd vmsvc/power.getstate " $1" 2>/dev/null | grep -q Suspended && vim-cmd vmsvc/power.on "$1}' | sh

[u@h:~] esxcli software profile update -d /vmfs/volumes/systemstore/VMware-ESXi-7.0U3d-19482537-depot.zip -p E
SXi-7.0U3d-19482537-standard

Update Result
   Message: The update completed successfully, but the system needs to be rebooted for the changes to be effective.
   Reboot Required: true

rebooten

(reboot)

dann wenn update fertig ist

[root@h:~] vim-cmd /hostsvc/maintenance_mode_exit

vms starten [root@h:~] vim-cmd vmsvc/getallvms | awk '{print "vim-cmd vmsvc/power.getstate " $1" 2>/dev/null | grep -q Suspen ded && vim-cmd vmsvc/power.on "$1}' | sh

Fehler:

warum keine esxi konfig sicherung gemacht

direkt via http

patchuebersicht https://esxi-patches.v-front.de/

esxcli network firewall ruleset set -e true -r httpClient

esxcli software sources profile list -d ...

=> aussuchen: ESXi-7.0U3e-19898904-standard

To upgrade/update ESXi from VMware repository run the below esxcli command

esxcli software profile update -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml -p ESXi-7.0U3-18644231-standard

geht hier auch profile list?

You're done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment