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

NetAdapterLso - limit to only Protocol = V1IPv4 #475

Closed
phbits opened this issue Oct 21, 2020 · 2 comments
Closed

NetAdapterLso - limit to only Protocol = V1IPv4 #475

phbits opened this issue Oct 21, 2020 · 2 comments
Labels
enhancement The issue is an enhancement request. in progress The issue is being actively worked on by someone.

Comments

@phbits
Copy link
Contributor

phbits commented Oct 21, 2020

My DSC config is:

Configuration NetAdapterLsoTest
{
    Import-DscResource -Module NetworkingDsc
    Node localhost
    {
        NetAdapterLso Ethernet_V1IPv4_NetAdapterLso
        {
            Name     = 'Ethernet'
            Protocol = 'V1IPv4'
            State    = $false
        }
        NetAdapterLso Ethernet_IPv4_NetAdapterLso
        {
            Name     = 'Ethernet'
            Protocol = 'IPv4'
            State    = $false
        }
        NetAdapterLso Ethernet_IPv6_NetAdapterLso
        {
            Name     = 'Ethernet'
            Protocol = 'IPv6'
            State    = $false
        }
    }
}

. NetAdapterLsoTest -OutputPath C:\DscTest\NetAdapterLsoTest -Verbose

Running the above file creates the following error:

Test-ConflictingResources : A conflict was detected between resources '[NetAdapterLso]Ethernet_V1IPv4_NetAdapterLso (C:\DscTest\NetAdapterLsoTest.ps1::7::9::NetAdapterLso)' and '[NetAdapterLso]Ethernet_IPv4_NetAdapterLso
(C:\DscTest\NetAdapterLsoTest.ps1::14::9::NetAdapterLso)' in node 'localhost'. Resources have identical key properties but there are differences in the following non-key properties: 'State;Protocol'. Values 'NULL;V1IPv4' don't match values 'True;IPv4'. Please update
these property values so that they are identical in both cases.
At line:289 char:9
+         Test-ConflictingResources $keywordName $canonicalizedValue $k ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Write-Error], InvalidOperationException
    + FullyQualifiedErrorId : ConflictingDuplicateResource,Test-ConflictingResources
Test-ConflictingResources : A conflict was detected between resources '[NetAdapterLso]Ethernet_V1IPv4_NetAdapterLso (C:\DscTest\NetAdapterLsoTest.ps1::7::9::NetAdapterLso)' and '[NetAdapterLso]Ethernet_IPv6_NetAdapterLso
(C:\DscTest\NetAdapterLsoTest.ps1::20::9::NetAdapterLso)' in node 'localhost'. Resources have identical key properties but there are differences in the following non-key properties: 'State;Protocol'. Values 'NULL;V1IPv4' don't match values 'True;IPv6'. Please update
these property values so that they are identical in both cases.
At line:289 char:9
+         Test-ConflictingResources $keywordName $canonicalizedValue $k ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Write-Error], InvalidOperationException
    + FullyQualifiedErrorId : ConflictingDuplicateResource,Test-ConflictingResources
Test-ConflictingResources : A conflict was detected between resources '[NetAdapterLso]Ethernet_IPv4_NetAdapterLso (C:\DscTest\NetAdapterLsoTest.ps1::14::9::NetAdapterLso)' and '[NetAdapterLso]Ethernet_IPv6_NetAdapterLso
(C:\DscTest\NetAdapterLsoTest.ps1::20::9::NetAdapterLso)' in node 'localhost'. Resources have identical key properties but there are differences in the following non-key properties: 'Protocol'. Values 'IPv4' don't match values 'IPv6'. Please update these property
values so that they are identical in both cases.
At line:289 char:9
+         Test-ConflictingResources $keywordName $canonicalizedValue $k ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Write-Error], InvalidOperationException
    + FullyQualifiedErrorId : ConflictingDuplicateResource,Test-ConflictingResources
Compilation errors occurred while processing configuration 'NetAdapterLsoTest'. Please review the errors reported in error stream and modify your configuration code appropriately.
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\PSDesiredStateConfiguration.psm1:3917 char:5
+     throw $ErrorRecord
+     ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (NetAdapterLsoTest:String) [], InvalidOperationException
    + FullyQualifiedErrorId : FailToProcessConfiguration

It seems an adapter can only be specified once using NetAdapterLso which restricts the configuration to just one protocol. Instead of fixing NetAdapterLso to accept multiple entries for a single adapter, I propose using NetAdapterLso for only V1IPv4. Then use NetAdapterAdvancedProperty for the other two. The following table shows how these values compare.

NetAdapterLso NetAdapterAdvancedProperty
V1IPv4 ??
IPv4 *LsoV2IPv4
IPv6 *LsoV2IPv6

The operating system the target node is running

PS C:\PowerShell> Get-ComputerInfo -Property @( 'OsName','OsOperatingSystemSKU','OSArchitecture','WindowsVersion','WindowsBuildLabEx','OsLanguage','OsMuiLanguages')


OsName               : Microsoft Windows Server 2019 Datacenter Evaluation
OsOperatingSystemSKU : 80
OsArchitecture       : 64-bit
WindowsVersion       : 1809
WindowsBuildLabEx    : 17763.1.amd64fre.rs5_release.180914-1434
OsLanguage           : en-US
OsMuiLanguages       : {en-US}

Version and build of PowerShell the target node is running

PS C:\PowerShell> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.17763.316
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.316
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
@PlagueHO PlagueHO added discussion The issue is a discussion. enhancement The issue is an enhancement request. labels Dec 1, 2020
@PlagueHO
Copy link
Member

PlagueHO commented Dec 1, 2020

Hi @phbits - that is a good catch.

But given that people are most likely going to expect to be able to use this resource to set LSO for V1IPv4, IPv4 and IPv6 it might be best to change it here. It is actually a pretty simple change to allow this - just change the MOF file to have both Name and Protocol as key properties.

If you want to submit this I can review and merge or I can submit it myself.

The fact that you can set these values via NetAdapterAdvancedProperty is actually an oversight because it could lead to configuration flapping. So it is worth also adding a note in the README.md for both resources.

@PlagueHO PlagueHO added the help wanted The issue is up for grabs for anyone in the community. label Dec 1, 2020
@phbits
Copy link
Contributor Author

phbits commented Dec 2, 2020

@PlagueHO - Thanks for the feedback! That all sounds like a better approach. Especially since it avoids a breaking change by dropping configuration support. I'll work on this after address the other two PRs.

@PlagueHO PlagueHO added in progress The issue is being actively worked on by someone. and removed discussion The issue is a discussion. help wanted The issue is up for grabs for anyone in the community. labels Dec 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is an enhancement request. in progress The issue is being actively worked on by someone.
Projects
None yet
Development

No branches or pull requests

2 participants