I am trying to create a template in ESX that I can automate with PowerCLI. Everything works great so far, but because I have some specific settings, I had to create my own sysprep.inf. Now, the computername and the VM guest name are out of synch. I need to automate this for a sandbox enviornment, so I will constantly be deleting and rebuilding boxes. Thus, I need the VMhost name and the computername to be the same. Am I missing something?
While I'm not sure it's still relevant to the OP, it might be relevant to others. As johnshen64 stated, we can modify the OSCustomizationSpec to set the computer name. We can do it by using the NamingPrefix and the NamingScheme parameters.
will create a new specification named specName which will set the name of the VM to hostname.
You can modify the vm with OSCustomizationSpec to set the computer name to the vm name.