microsoft / MSLab

Azure Stack HCI, Windows 10 and Windows Server rapid lab deployment scripts
MIT License
1.18k stars 285 forks source link

[WIP] Support for additional network adapters in LabConfig #468

Closed machv closed 2 years ago

machv commented 2 years ago

Starting this pull request as work in progress to discuss further.

Sample working VM configuration using new options.

$LABConfig.VMs += @{ 
    VMName = 'Management' 
    ParentVHD = 'Win10_G2.vhdx' 
    AdditionalNetworkAdapters =
        @{
            VirtualSwitchName = 'Litware-LAN' # mandatory 
            Mac = '00-0C-29-04-8D-C6' 
            VlanId = 15 # Optional parameter if VLANs are used in the environment
            IpConfiguration = @{ # DHCP or specific IP set with Set-VMNetworkConfiguration function
               IpAddress = '172.17.1.15'
               Subnet = '255.255.255.0'
            }
        },
        @{
            VirtualSwitchName = 'Litware-LAN' # mandatory 
            IpConfiguration = @{
                IpAddress = '172.17.1.16'
                Subnet = '255.255.255.0'
            }
        }
  }
Karl-WE commented 2 years ago

I would like to add following parameters for all NICs on Lab and VMs to mirror production