If a host was deployed using vSphere Auto Deploy, you can use Auto Deploy to reprovision the host with a new image profile that contains an ESXi upgrade. You can use vSphere ESXi Image Builder PowerCLI to create and manage image profiles.
These instructions assume that you are reprovisioning a host that has already been provisioned with Auto Deploy. Provisioning a host that has never been provisioned with Auto Deploy differs from the process described here to upgrade a host. For information about using vSphere Auto Deploy and ESXi Image Builder PowerCLI, see the information about using vSphere Auto Deploy and vSphere ESXi Image Builder CLI in the vSphere Installation and Setup documentation.