-
Notifications
You must be signed in to change notification settings - Fork 108
vsphere-supervisor: use a shorter default source_name #455
Description
Community Note
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.
Description
Currently, if the source_name config is not provided, the Supervisor builder will use packer-vsphere-supervisor-<random-suffix> as the default source name as documented in https://developer.hashicorp.com/packer/integrations/hashicorp/vsphere/latest/components/builder/vsphere-supervisor#source-vm-creation
This is causing issues for deploying Windows VMs as they require a shorter hostname.
Use Case(s)
Provide a default source name that satisfies the Windows hostname requirement of 1 to 15 characters long.
Potential configuration
Instead of using a prefix, generate a random 4-character long name if the source_name config is not specified. This name should be generic since it's used for creating all required source objects (e.g., VM, VMService, Secret, etc.).
Potential References
Windows hostname requirement: https://learn.microsoft.com/en-us/troubleshoot/windows-server/active-directory/naming-conventions-for-computer-domain-site-ou
Current prefix code: https://github.com/hashicorp/packer-plugin-vsphere/blob/main/builder/vsphere/supervisor/step_create_source.go#L26