You can use the automatically applied tag rules to create the tags for your esxi hosts.
Here is how you would do that, settings -> tags -> automatically applied tags -> create tag and then select rule applies to hosts -> conditions would allow you to select vmware name or esxi host name.
You can also define your tag value name based on those metrics as well.
Thank you for your answer. The thing is that in the customer environment, the esx servers does not have oneagent installed. So this procedure, would end up tagging the virtual machines, not the esx servers.
Later, I asked this in the product chat, and it is not possible automatically, only manually.