You can use ESXCLI commands to list the secure ESXi configuration recovery key, rotate the recovery key, and change the TPM policies (for example, enforcing UEFI Secure Boot).
List the Contents of the Secure ESXi Configuration Recovery Key
You can use ESXCLI to show the contents of the secure ESXi configuration recovery key.
Prerequisites
- Have access to the ESXCLI command set. You can run ESXCLI commands remotely, or run them in the ESXi Shell.
- Required privilege for using ESXCLI standalone version or through PowerCLI:
Procedure
Results
The recovery key ID and key are displayed.
Example: List the Secure ESXi Configuration Recovery Key
[root@host1] esxcli system settings encryption recovery list Recovery ID Key -------------------------------------- --- {2DDD5424-7F3F-406A-8DA8-D62630F6C8BC} 478269-039194-473926-430939-686855-231401-642208-184477-602511 -225586-551660-586542-338394-092578-687140-267425
Rotate the Secure ESXi Configuration Recovery Key
You can use ESXCLI to rotate the secure ESXi configuration recovery key.
Prerequisites
- Have access to the ESXCLI command set. You can run ESXCLI commands remotely, or run them in the ESXi Shell.
- Required privilege for using ESXCLI standalone version or through PowerCLI:
Procedure
Results
The recovery key is now set to the contents of the key referenced by key ID, if provided. Otherwise, ESXi provides a new key ID.
Troubleshooting and Recovering the Secure ESXi Configuration
You can troubleshoot and recover from boot problems that you might encounter with a secure ESXi Configuration.
If you clear a TPM (that is, the seed values in the TPM are reset), if a TPM fails, or if you replace the motherboard or TPM device, or both, you must take steps to recover the ESXi secure configuration. You must have the recovery key to recover the configuration. Until you recover the configuration, the ESXi host cannot boot. See Recover the Secure ESXi Configuration.
Although uncommon, it is possible that an ESXi host might fail to restore or decrypt the secure configuration, preventing the host from booting. Possible situations include:
- Change to secure boot setting (or other policy)
- Actual tampering
- The recovery key is unavailable
To troubleshoot these conditions, see the VMware knowledge base article at https://kb.vmware.com/s/article/81446.
Recover the Secure ESXi Configuration
If a TPM fails, or if you clear a TPM, you must recover the secure ESXi Configuration. Until you recover the configuration, the ESXi host cannot boot.
- You cleared the TPM (that is, the seeds in the TPM were reset).
- The TPM failed.
- You replaced the motherboard or the TPM device, or both.
To troubleshoot other secure ESXi configuration problems, see the VMware knowledge base article at https://kb.vmware.com/s/article/81446.
Perform the recovery manually. Do not perform the recovery as part of an installation or upgrade script.
Prerequisites
Procedure
What to do next
When you enter the recovery key, it is temporarily displayed in an untrusted environment and is in memory. Though not necessary, as a best practice, you can remove residual traces of the key in memory by rebooting the host. Or, you can rotate the key. See Rotate the Secure ESXi Configuration Recovery Key.
Activate or Deactivate the Secure Boot Enforcement for a Secure ESXi Configuration
You can choose to activate UEFI secure boot enforcement, or deactivate a previously activated UEFI secure boot enforcement. You must use ESXCLI to change the setting in the TPM on the ESXi host.
This task applies only to ESXi hosts that have a TPM. UEFI Secure boot is a firmware setting for ensuring that the software launched by the firmware is trusted. To learn more, see UEFI Secure Boot for ESXi Hosts. The enablement of UEFI Secure boot can be enforced upon every boot by using the TPM.
Prerequisites
- Have access to the ESXCLI command set. You can run ESXCLI commands remotely, or run them in the ESXi Shell.
- Required privilege for using ESXCLI standalone version or through PowerCLI:
Procedure
Results
esxcli system settings encryption set --mode=TPMOnce you have activated the TPM, you cannot undo the setting.
The esxcli system settings encryption set
command fails on some TPMs even when the TPM is activated for the host.
- In vSphere 7.0 Update 2: TPMs from NationZ (NTZ), Infineon Technologies (IFX), and certain new models (like NPCT75x) from Nuvoton Technologies Corporation (NTC)
- In vSphere 7.0 Update 3: TPMs from NationZ (NTZ)
If an installation or upgrade of vSphere 7.0 Update 2 or later is unable to use the TPM during the first boot, the installation or upgrade continues, and the mode defaults to NONE (that is, --mode=NONE
). The resulting behavior is as though the TPM is not activated.
Activate or Deactivate the execInstalledOnly Enforcement for a Secure ESXi Configuration
You can choose to activate execInstalledOnly enforcement, or deactivate a previously enabled execInstalledOnly enforcement. You must use ESXCLI to change the setting in the TPM on the ESXi host. UEFI secure boot enforcement must be activated before you can activate the execInstalledOnly enforcement.
This task applies only to ESXi hosts that have a TPM. The execInstalledOnly advanced ESXi boot option, when set to TRUE, guarantees that the VMkernel executes only those binaries that have been packaged and signed as part of a VIB. The enablement of this boot option can be enforced upon every boot by using the TPM.
Prerequisites
- To activate the execInstalledOnly enforcement, you must first activate the UEFI secure boot enforcement. The execInstalledOnly enforcement is built on top of the UEFI secure boot enforcement. See Activate or Deactivate the Secure Boot Enforcement for a Secure ESXi Configuration.
- Have access to the ESXCLI command set. You can run ESXCLI commands remotely, or run them in the ESXi Shell.
- Required privilege for using ESXCLI standalone version or through PowerCLI:
Procedure
Results
The ESXi host runs with execInstalledOnly enforcement activated or deactivated, depending on your choice.