PlagueHO / LabBuilder

PowerShell Module for building a Hyper-V Lab environment from a simple XML configuration file.
MIT License
223 stars 39 forks source link

Error binding physical network adapter #366

Open eliassal opened 4 years ago

eliassal commented 4 years ago

PSVersion 5.1.18362.752 Console Win 10 64bit ModuleType Version Name ExportedCommands

I updated the sample file "Sample_WS2016_NanoDomain.xml" to use my external switch as follows

<switches managementvlan="97">
    <switch name="USBEth" type="External">
      <adapters>
        <adapter name="Cluster" macaddress="00155D010701" />
        <adapter name="Management" macaddress="00155D010702" />
        <adapter name="SMB" macaddress="00155D010703" />
        <adapter name="LM" macaddress="00155D010704" />
      </adapters>
    </switch>

when I run the build step I get

VERBOSE: Repository details, Name = 'PSGallery', Location = 'https://www.powershellgallery.com/api/v2'; IsTrusted = '**** VERBOSE: [12:59:47]: Initializing Lab Folders. VERBOSE: [12:59:48]: Initializing Lab Management virtual switch 'NANOTEST.COM Lab Management'. VERBOSE: [12:59:49]: Creating Lab Management Switch 'NANOTEST.COM Lab Management' on Vlan 97. VERBOSE: [12:59:50]: Updating Lab Management Switch 'NANOTEST.COM Lab Management' to Vlan 97. VERBOSE: [12:59:50]: Creating External Virtual Switch 'General Purpose External'. New-LabException : Error binding physical network adapter 'USBEth' to External Switch 'General Purpose External' because it is already bound to another External Switch. At C:\Program Files\WindowsPowerShell\Modules\LabBuilder\1.0.5.105\LabBuilder.psm1:8453 char:25

  • New-LabException @exceptionParameters
  • 
    + CategoryInfo          : InvalidArgument: (:) [New-LabException], Exception
    + FullyQualifiedErrorId : BindingAdapterUsedError,New-LabException
PlagueHO commented 4 years ago

Hi @eliassal - sorry about the delay. This is because adapter USBEth is already bound to another external Hyper-V switch. A physical (or virtual) adapter in your host system can only be bound to a single External switch. Run Get-VMSwitch -SwitchType 'External' to list all External switches in your system.