VMWARE ESX Quick Notes:

Reading Time: 2 minutes

The following are some quick notes I am leaving myself as I rebuild an ESX Host. These are things that I commonly do and keep around on a text file. I figure I would just bring them together on a single post to be a little more user friendly.

In this we are basically going to:
1 – Establish the common DATASTORES that are going to be used
2 – Set the hostname
3 – Set NTP server / establish NTP service
4 – Patch ESXi host using depot / standard profile.

SET DATASTORES:

The following esxcli commands can be used to establish a NF SDATASTORE. These are the common ones. You may have additonal ones. For example I keep a datastore just for dictionaries used with John.

esxcfg-nas -a lvnfs -o 172.16.104.251 -s /mnt/lvnfs
esxcfg-nas -a lviso -o 172.16.104.251 -s /mnt/lviso

If you have done things out of order or made a typo you may find that you might want to remove a datastore. You can do so the following.

esxcli storage nfs remove -v lvnfs
esxcli storage nfs remove -v lviso

SET HOSTNAME:

esxcli system hostname set --host=esx1
esxcli system hostname set --fqdn=esx1.sparelab.net

ESTABLISH NTP:

esxcli system ntp set -s=0.pool.ntp.org

This will modify /etc/ntp.conf

chkconfig ntpd on
[root@esx0:/etc] esxcli system ntp get
   Enabled: false
   Loglevel: warning
   Servers: 0.pool.ntp.org
[root@esx0:/etc] /etc/init.d/ntpd status
ntpd is not running
[root@esx0:/etc] /etc/init.d/ntpd start
Starting ntpd

Patching the ESXi Host

esxcli system maintenanceMode set --enable=true

In this scenario we have placed the depot/update file from VMWare on a NFS mount point that is on our datastore. This makes it conveniently handy to directly reference. One of the first things we are going to want to do is to list the profiles contained in the update so that we can reference them. Note the path was found by iteratively descending down the path to where the update was stored.

esxcli software sources profile list -d /vmfs/volumes/2c83942f-ac39f9a8/VMWare/Update/VMware-ESXi-7.0U3c-19193900-depot.zip

We see the results as

[root@esx0:~] esxcli software sources profile list -d /vmfs/volumes/2c83942f-ac3
9f9a8/VMWare/Update/VMware-ESXi-7.0U3c-19193900-depot.zip
Name                           Vendor        Acceptance Level  Creation Time        Modification Time
-----------------------------  ------------  ----------------  -------------------  -----------------
ESXi-7.0U3c-19193900-standard  VMware, Inc.  PartnerSupported  2022-01-18T00:00:00  2022-01-18T00:00:00
ESXi-7.0U3c-19193900-no-tools  VMware, Inc.  PartnerSupported  2022-01-18T00:00:00  2022-01-12T00:03:42

Now we can actually invoke an update to the system.

esxcli software profile update --depot /vmfs/volumes/2c83942f-ac39f9a8/VMWare/Update/VMware-ESXi-7.0U3c-19193900-depot.zip -p ESXi-7.0U3c-19193900-standard --no-hardware-warning

Note: do not include –depot path in quotes or you are going to get a “can’t find /index.xml” error

reboot:

reboot -f

NOTE: During reboot most like will loose SSH service so you won’t be able SSH into it.

esxcli system maintenanceMode set --enable=false

Reference:
https://kb.vmware.com/s/article/57147
https://kb.vmware.com/s/article/1010821
https://kb.vmware.com/s/article/57147
https://docs.vmware.com/en/VMware-vSphere/7.0/rn/vsphere-esxi-70u3c-release-notes.html
https://www.vladan.fr/upgrade-vmware-esxi-to-7-0-u3-via-command-line/

This entry was posted in ntp, VMware. Bookmark the permalink.