I had to rebuild vCenter 5.1 and re-attach it to an external database some time ago. Since then I had not tried to deploy a VM from a template and use the Customization script. The customization process would error out with this message:
‘the public key in specification does not match the vCenter public key. You have to reenter the password in order to proceed’
Craig does a good step-by-step on how to fix this:
Re-entering the administrator password within the customization script will stop the error. You can do this via the web interface.