On the second, and subsequent, vSphere templates (within a cloud), the "Check Template" button uses the SSH credentials specified in the previous template to log in to vSphere when checking instead of using the credentials specified in the vSphere cloud.
This means that the "Check Template" button only works on the first template in any given cloud.
- Define a vSphere cloud, setting host and credentials etc.
- Define a vSphere template, setting SSH credentials to either "none" or ones that are not valid for your vSphere cloud.
- Define a second vSphere template, set the Master Image name etc and press the "Check Template" button.
- Now change the SSH credentials for the first template to be the same as those used to log in to vSphere and press the "Check Template" button again.
- The first check fails because it is unable to log in to vSphere in order to carry out the check.
- The second passes.
What should happen instead:
- Both checks should use the credentials specified for the cloud login (and pass!) instead of using the SSHLauncher's credentials for the template above.
This seems to be because the code uses the same name "credentialsId" for both the SSHLauncher configuration and the cloud credentials, meaning that jelly/stapler can't tell them apart and blindly uses "the closest credentialsId above us".
My guess is that renaming the credentialsId field for the cloud (in a backwards-compatible way!) would probably solve this.