vagrant icon indicating copy to clipboard operation
vagrant copied to clipboard

Proposed Change: Multiple NICs on HyperV provider

Open wiltaylor opened this issue 8 years ago • 7 comments

Vagrant version

Vagrant 1.9.7

Host operating system

Windwos 10 Creative Update

Guest operating system

Any

Expected behavior

When defining multiple networks in a vagrant file it should result in multiple network cards being attached to the resultant virtual machine.

Actual behavior

The latest network entry becomes the network card added to the virtual machine.

Proposed Changes:

I am thinking of doing the following:

  • Move networking out to a new action.
  • New network action will clear existing network interfaces
  • New network action will then create a NIC for each network in config like other providers.
  • Treat the first network like the previous single network (i.e. mac config or which interface to get ip address from). Mainly done to preserve backwards compatibility
  • Add mac to property to network to set mac addresses per interface.

Out of scope: - Will probably add these later. Need to get some of the basics working first though.

  • Ability to assign static ip addresses
  • port forwarding

wiltaylor avatar Aug 04 '17 00:08 wiltaylor

@mwrock do you have any thoughts on this?

wiltaylor avatar Aug 04 '17 00:08 wiltaylor

I'd agree that specifying multiple network configs should result in multiple NICs. I'm not sure if this is a Hyper-V provider issue or accross all providers on windows guests. I wonder what happens on vbox for instance.

mwrock avatar Aug 05 '17 17:08 mwrock

Nah it looks like its just hyper v, basically the import action only takes the name of one vswitch, so whatever config was last in the config becomes that vswitch.

Instead I have now created an action that wipes out all the network adapters on a vm and then adds them back again for each switch in config.

I will try and post the PR in the next few days.

wiltaylor avatar Aug 06 '17 00:08 wiltaylor

@wiltaylor Any update on this?

gurry avatar Jan 26 '18 08:01 gurry

Can we please get this moving forward? There's also https://github.com/hashicorp/vagrant/pull/9439, but it too requires @wiltaylor's signature on CLA, and it seems he hasn't been as active on GitHub recently. I am willing to give this a try, but definitely one of the must-have features IMO.

Jaskaranbir avatar Aug 06 '19 02:08 Jaskaranbir

@briancain @Jaskaranbir Was there any change with this? I am working on a lab on Hyper-V and it would really help to be able to use multiple NICs.

elico avatar Oct 29 '20 17:10 elico

I commented on the static IP issue but it's somewhat relevant to this as well https://github.com/hashicorp/vagrant/issues/8384#issuecomment-1228509296

ShaunLawrie avatar Aug 26 '22 14:08 ShaunLawrie

This a very interesting feature, are there updates in this work?

rauldoliveira avatar Dec 06 '22 23:12 rauldoliveira