-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Make vagrant respect already-configured PCI slots for network interfaces #8095
Labels
Comments
cbednarski
changed the title
VMware: Make vagrant respect already-configured PCI slots for network interfaces
Make vagrant respect already-configured PCI slots for network interfaces
Dec 8, 2016
@cbednarski I was able to reliable reproduce the pci slot number change on startup and isolate it to show that the Vagrant plugin is the cause of the slot number modification. I'll get the device setup to not drop custom defined configurations which should clear this up. |
Also, this in the Vagrant.configure(2) do |config|
...
config.vm.provider :vmware_fusion do |vmware|
vmware.vmx["ethernet0.pcislotnumber"] = "33"
end
end |
Thanks for looking into this @chrisroberts ! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This is a follow-up item to #4590.
In systemd linux, NICs are no longer identified by
eth0
oreth1
, but instead by an id likeens32
orens33
. The systemd id is based on the NIC's PCI slot. When Vagrant boots a VM it reinitializes the NIC and this can cause the PCI slot to change.The problem is that the OS has configuration (usually in /etc/network/interfaces) that instructs the OS to initialize a network interface at a particular location (e.g. ens33). When Vagrant changes the PCI slot to 32 the network inside the VM fails to start.
There are two approaches here:
I can guess that Vagrant is going to use PCI slot 32 all the time (this maybe holds true in certain circumstances, but I don't know which ones).
Vagrant can use deterministic behavior to identify the existing NIC specified in the VMX file (which should reflect what is already configured inside the VM).
In any case I just want this to be deterministic so that:
Packer -> Vagrant
By default packer initializes the NIC in PCI slot 33, but Vagrant changes this to 32. Instead, I would prefer that Vagrant parse the VMX file and reassign the same PCI slot that is already assigned.
I am also happy to change Packer to always use PCI slot 32 for the NIC if and only if it can be shown that Vagrant will deterministically use PCI slot 32 when the NIC is reinitialized. I have not been able to prove this.
I can work around this in at least 3 ways but out of the box this functionality is broken and Vagrant breaks other workflows like VMX builds in Packer, and the workarounds vary by OS so this is rather tedious.
The text was updated successfully, but these errors were encountered: