I'm sure this question will have been asked somewhere before. In fact I'm sure I've read about it before too, but I can find any resources to help me along my way.
What I'm trying to do is deploy a set of Hyper-V servers without having to do anything other than start the process. I can think of ways to configure everything through PowerShell and/or unattend.xml
, except for the network adapters. The commands are available, but there's one significant problem:
How do I get Windows to consistently detect the correct adapter to assign each network to?
These are clustered Hyper-V hosts with multiple IP addresses and VLANs, and teamed adapters but my understanding is that Windows detects adapters in a random order. To script it, I need consistency. I can't assume that Local Area Connection 12
is always port 3 on card 2, for example. The same physical port on each cluster node will be connected to the same VLAN or aggregate.
- Do I have to go around and collect the MAC address of every port on every adapter and have some kind of lookup table in my scripts?
- Is there an attribute in WMI/registry that I can reference when configuring my adapters and teams?