Under some conditions, a VM can be created in labs with a mismatch between its "instance name" and its hostname; in those cases, our autosigner fails and puppet never runs.
Steps to reproduce:
- Create an instance with an underscore in the name, i.e. "test_autosign"
- since test_autosign.projectname.domain is not a valid hostname per RFC 1123, the hostname assigned to the VM will be test-autosign.projectname.domain
- Autosign will fail on labspuppetmasters:
# /usr/local/sbin/validatelabsfqdn.py test-autosign.projectname.eqiad.wmflabs && echo OK certname test-autosign.projectname.eqiad.wmflabs is not for a real instance # /usr/local/sbin/validatelabsfqdn.py test_autosign.projectname.eqiad.wmflabs && echo OK OK
Solutions I see are either:
- Apply some heuristics when autosigning
- Return a clear error in horizon when someone tries to create an instance with an invalid hostname