Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User is not warned when using uppercase MAC in vsphere builder #324

Closed
olinux-dev opened this issue May 16, 2023 · 3 comments · Fixed by #336
Closed

User is not warned when using uppercase MAC in vsphere builder #324

olinux-dev opened this issue May 16, 2023 · 3 comments · Fixed by #336
Assignees
Labels

Comments

@olinux-dev
Copy link

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 other comments that do not add relevant new information or questions, 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

When filing a bug, please include the following headings if possible. Any
example text in this template can be deleted.

Overview of the Issue

When defining a mac address in the vsphere-iso builder, there is no information that the mac address has to be lowercase. It just fails to obtain the IP address without knowing why.

Reproduction Steps

source "vsphere-iso" "client-node" {
network_adapters {
mac_address ="52:3A:7D:F1:9B:EC"
network_card = "vmxnet3"
}
}

Packer version

v1.6.6

Operating system and Environment details

docker.io/bitnami/python:3.10-debian-11 vpshere 7

@olinux-dev olinux-dev added the bug label May 16, 2023
@tenthirtyam
Copy link
Collaborator

This should be transferred to the hashicorp/packer-plugin-vsphere project.

@nywilken nywilken transferred this issue from hashicorp/packer Nov 10, 2023
@tenthirtyam
Copy link
Collaborator

tenthirtyam commented Nov 13, 2023

@nywilken

I think we could just set MacAddress to lowercase where it's set in vsphere-iso and vsphere-clone builders.

	var networkCards []driver.NIC
	for _, nic := range s.Config.NICs {
		networkCards = append(networkCards, driver.NIC{
			Network:     nic.Network,
			NetworkCard: nic.NetworkCard,
			MacAddress:  strings.ToLower(nic.MacAddress),
			Passthrough: nic.Passthrough,
		})
	}
	vm, err := template.Clone(ctx, &driver.CloneConfig{
		Name:            s.Location.VMName,
		Folder:          s.Location.Folder,
		Cluster:         s.Location.Cluster,
		Host:            s.Location.Host,
		ResourcePool:    s.Location.ResourcePool,
		Datastore:       s.Location.Datastore,
		LinkedClone:     s.Config.LinkedClone,
		Network:         s.Config.Network,
		MacAddress:      strings.ToLower(s.Config.MacAddress)
		Annotation:      s.Config.Notes,
		VAppProperties:  s.Config.VAppConfig.Properties,
		PrimaryDiskSize: s.Config.DiskSize,
		StorageConfig: driver.StorageConfig{
			DiskControllerType: s.Config.StorageConfig.DiskControllerType,
			Storage:            disks,
		},
	})

Thoughts?

@tenthirtyam tenthirtyam self-assigned this Nov 13, 2023
tenthirtyam added a commit that referenced this issue Dec 2, 2023
- Sets the MAC address to lowercase.
- Update "Mac address" to "MAC address".

Ref: #324
Ref: https://kb.vmware.com/s/article/82139

Signed-off-by: Ryan Johnson <[email protected]>
@tenthirtyam
Copy link
Collaborator

lbajolet-hashicorp pushed a commit that referenced this issue Dec 6, 2023
- Sets the MAC address to lowercase.
- Update "Mac address" to "MAC address".

Ref: #324
Ref: https://kb.vmware.com/s/article/82139

Signed-off-by: Ryan Johnson <[email protected]>
@hashicorp hashicorp locked and limited conversation to collaborators Jun 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants