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

vsphere-iso: multiple NICs; only one NIC with IP reachability #133

Open
hc-github-team-packer opened this issue Nov 23, 2021 · 7 comments
Open
Assignees
Milestone

Comments

@hc-github-team-packer
Copy link

This issue was originally opened by @heitmanr in hashicorp/packer#11409 and has been migrated to this repository. The original issue description is below.


Building a VM with two NICs mapped to their vSphere-Portgroups works just fine.

Description

In my Setup, only one Portgroup contains a DHCP-Server.

  • the 2nd NIC doesn't get an IP-Address (by design)
  • the 2nd Portgroup would be in an isolated IP-Range
    • so an SSH-Connection to n IP-Address at this 2nd-NIC wouldn't be possible anyway.

Right now, the whole build-process gets stuck, in "Waiting for IP"
=> I assume, the script looks to the "wrong" NIC [which doesn't get an IP]
=> or it wait's, until all NICs got an IP-Address

Use Case(s)

Any dual-homed Server connecting different "network security zones, perimeter networks, etc."

Potential configuration

I'd suggest the possibility, to flag one or more NICs as "management"-Interface usable for packer.
//of course, defaulting to "true" would make sense to avoid changes to standard, single-homed setups.

  network_adapters {
    network_card = "vmxnet3"
    network      = "LAB.Management"
    management = true
  }
 network_adapters {
    network_card = "vmxnet3"
    network      = "isolated LAN without DHCPd"
   management = false
  }

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.

@tenthirtyam
Copy link
Collaborator

@heitmanr - are both NICs required for the build processes? Typically one would add the additional NICs and configuration at time of provisioning. For example, deploying using the Terraform provider.

Ryan

@tenthirtyam
Copy link
Collaborator

tenthirtyam commented Nov 23, 2021

If such a feature is required, I’d instead suggest a connected state bool that defaults to true and allow the ability to define which NIC is used by the Packer host for communications.

network_adapters {
    network_card = "vmxnet3"
    network      = "Blue"
    connected = false
  }
 network_adapters {
    network_card = "vmxnet3"
    network      = "Green"
    connected = true
  }

Ryan

@heitmanr
Copy link

@heitmanr - are both NICs required for the build processes? Typically one would add the additional NICs and configuration at time of provisioning. For example, deploying using the Terraform provider.

Ryan

@tenthirtyam for the build-process itself only the first nic is required.

Right now i'm using this in a terraform workflow, kicking packer using local-exec/powershell to directly build VMs [with packer/convert_to_template:=false].

Since this is part of a separate self-written terraform-module in my setup, adding the additional NIC after the build-process has been completed - this could be a valid "workaround".

@tenthirtyam
Copy link
Collaborator

This does sound like a good workaround process, in my opinion.

Ryan

@tenthirtyam tenthirtyam added the builder/vsphere-iso Builder: vsphere-iso label Nov 4, 2022
@tenthirtyam tenthirtyam changed the title multiple NICs for vsphere-iso - only one NIC with IP-Reachability vsphere-iso: multiple NICs; only one NIC with IP reachability Nov 5, 2022
@lindhe
Copy link

lindhe commented Sep 8, 2023

If such a feature is required, I’d instead suggest a connected state bool that defaults to true and allow the ability to define which NIC is used by the Packer host for communications.

network_adapter_index = 1      // vmnic1
network_adapters {
    network_card = "vmxnet3"
    network      = "Blue"
    connected = false
  }
 network_adapters {
    network_card = "vmxnet3"
    network      = "Green"
    connected = true
  }

Ryan

I cannot find network_adapter_index or connected in the documentation. Are they undocumented features, or am I looking at the wrong place?

EDIT: Adding them did not do me much good:

image

@tenthirtyam
Copy link
Collaborator

I cannot find network_adapter_index or connected in the documentation. Are they undocumented features, or am I looking at the wrong place?

Those were hypothetical enhancements.

@tenthirtyam tenthirtyam self-assigned this Apr 4, 2024
@tenthirtyam tenthirtyam added this to the Backlog milestone Apr 17, 2024
@tenthirtyam
Copy link
Collaborator

I took a look at this one today and ran some reproduction cases. So far, I only see the issue occur if an IP is set on the image build on one of the NICs. However, if one of the NICs is on a DHCP-enabled network it will progress as soon as the IP is obtained.

More review is needed but this is the current state of review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants