Skip to content
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

Issue with Networkteaminterface when vlanid is used #505

Open
gir960 opened this issue Mar 16, 2022 · 0 comments
Open

Issue with Networkteaminterface when vlanid is used #505

gir960 opened this issue Mar 16, 2022 · 0 comments

Comments

@gir960
Copy link

gir960 commented Mar 16, 2022

Hello DSC gurus,

Scenario is physical servers with trunk network ports that need to be teamed on Server 2019 and vlanid assigned. Config is created successfully the first time but fails on re-apply. This is related to how windows names the interfaces when team is created and when vlanid is assigned.
When new team is created, a team nic with the same name is created. It is possible with powershell to set vlanid on that nic or to create new nic.
when DSC Networkteaminterface is used if the name matches the team name, the vlanid is set but the name changes, and subsequent re-apply fails. If different name is used, it adds a second interface with the new name which is undesirable (having two interfaces on two vlans).

Undersired behavior
Even though the name of the interface is specified as "Prod" it is created with name "Prod - VLAN 390" and it is not recognized on re-apply. Playing with the name adds a second interface and doesn't appear to be a solution

error message on re-apply
PowerShell DSC resource DSC_NetworkTeamInterface failed to execute Set-TargetResource functionality with error message: The running command stopped because the
preference variable "ErrorActionPreference" or common parameter is set to Stop: VlanID 390 is already being used by another TeamNic 'Prod - VLAN 390' in team
'Prod'
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : ProviderOperationExecutionFailure
+ PSComputerName :

sample code (requires two nics for teaming). Run in push mode

Configuration teamnic
{
Import-DSCResource -ModuleName NetworkingDsc

node $allnodes.nodename
{

NetworkTeam Prod
{
Name = "Prod"
TeamMembers = $node.TeamMembers
TeamingMode = $node.TeamingMode
LoadBalancingAlgorithm = $node.LoadBalancingAlgorithm
}
NetworkTeamInterface Prod
{
Name = "Prod - VLAN $($node.vlanid)"
TeamName = "Prod"
VlanId = $node.VlanId
DependsOn = "[NetworkTeam]Prod"
}
NetIPInterface Prod
{
AddressFamily = $node.AddressFamily
Dhcp = "Disabled"
InterfaceAlias = "Prod - VLAN $($node.vlanid)"
DependsOn = "[NetworkTeamInterface]Prod"
}
IPAddress NewIPv4Address
{
IPAddress = $node.IPAddress
InterfaceAlias = "Prod - VLAN $($node.vlanid)"
AddressFamily = $node.AddressFamily
DependsOn = "[NetIPInterface]Prod"
}
DefaultGatewayAddress Gateway
{
InterfaceAlias = "Prod - VLAN $($node.vlanid)"
AddressFamily = $node.AddressFamily
Address = $node.Gateway
}
DnsServerAddress DNSConfig
{
InterfaceAlias = "Prod - VLAN $($node.vlanid)"
AddressFamily = $node.AddressFamily
Address = $node.DNS
}
}
}
teamnic -ConfigurationData teamnic.psd1

sample teamnic.psd1 file:
@{
AllNodes = @(
@{
NodeName="$($env:computername)"
IPAddress = "192.168.1.10/24"
Gateway = "192.168.1.1"
DNS = @("8.8.8.8","1.1.1.1")
VLANID="390"
TeamMembers=@("slot 1","slot 1 2")
TeamingMode = "LACP"
LoadBalancingAlgorithm = "Dynamic"
AddressFamily = "IPv4"
}
)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant