DnsServerAddress: Fails when trying to rename network adapter when running Test
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- powershell
- 领域
- networking
调研方向
从 DnsServerAddress 资源的 Test-TargetResource 路径开始,并在所述的 Windows 环境中复现 NetAdapterName/DnsServerAddress 配置。验证无效或暂时不可用的 InterfaceAlias 会将资源报告为不处于所需状态,同时不会终止 Test-TargetResource 进程。
由索引模型根据 Issue 内容生成。
描述
Problem description
Imagine a scenario where a user wants to perform both these steps in the same configuration:
- Rename a network adapter
- Assign a DNS server address to the same adapter
If a configuration like this is put through a Test-TargetResource phase before being applied (see example), it will fail with 'System.InvalidOperationException: A network adapter with the alias '' could not be found.'
Verbose logs
VERBOSE: [Test-VM]: LCM: [ Start Resource ] [[DnsServerAddress]Ethernet0-IPv6::[DomainController]Test-VM]
VERBOSE: [Test-VM]: LCM: [ Start Test ] [[DnsServerAddress]Ethernet0-IPv6::[DomainController]Test-VM]
VERBOSE: [Test-VM]: [[DnsServerAddress]Ethernet0-IPv6::[DomainController]Test-VM]
Test-TargetResource: Checking the DNS server addresses.
VERBOSE: [Test-VM]: [[DnsServerAddress]Ethernet0-IPv6::[DomainController]Test-VM]
Get-DnsClientServerStaticAddress: Getting staticly assigned DNS server IPv6 address for interface alias 'Ethernet0'.
VERBOSE: [Test-VM]: LCM: [ End Test ] [[DnsServerAddress]Ethernet0-IPv6::[DomainController]Test-VM] False in
0.1090 seconds.
VERBOSE: [Test-VM]: LCM: [ *FAILED*Compare ] Completed processing compare operation. The operation returned
False.
PowerShell DSC resource DSC_DnsServerAddress failed to execute Test-TargetResource functionality with error message:
System.InvalidOperationException: A network adapter with the alias 'Ethernet0' could not be found.
+ CategoryInfo : InvalidOperation: (root/Microsoft/...gurationManager:String) [], CimException
+ FullyQualifiedErrorId : ProviderOperationExecutionFailure
+ PSComputerName : Test-VM
DSC configuration
NetAdapterName "Ethernet0"
{
NewName = "Ethernet0"
InterfaceNumber = 1
}
DnsServerAddress "Ethernet0-IPv6"
{
InterfaceAlias = "Ethernet0"
AddressFamily = "IPv6"
DependsOn = "[NetAdapterName]Ethernet0"
}
Suggested solution
The DnsServerAddress resource should not return a terminating error when the network interface specified in InterfaceAlias is invalid - instead, it should just return that the resource is not in the desired state. There is no need to tank the entire Test-TargetResource process.
Operating system the target node is running
OsName : Microsoft Windows Server 2022 Datacenter Azure Edition
OsOperatingSystemSKU : 407
OsArchitecture : 64-bit
WindowsVersion : 2009
WindowsBuildLabEx : 20348.1.amd64fre.fe_release.210507-1500
OsLanguage : en-US
OsMuiLanguages : {en-US}
PowerShell version and build the target node is running
Name Value
---- -----
PSVersion 5.1.20348.558
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.20348.558
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
NetworkingDsc version
Name Version Path
---- ------- ----
NetworkingDsc 9.0.0 C:\Program Files\WindowsPowerShell\Modules\NetworkingDsc\9.0.0\NetworkingDsc.psd1
- 主要语言
- PowerShell
- 星标
- 234
- 派生
- 92
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
dsccommunity/NetworkingDsc 的其他 Issue
-
chore
难度 2/5 1-3 小时 新手友好度 72/100
dsccommunity/NetworkingDsc#544 ·
-
chore
难度 4/5 3-5 天 新手友好度 72/100
dsccommunity/NetworkingDsc#542 ·
-
chore
难度 3/5 1-2 天 新手友好度 68/100
dsccommunity/NetworkingDsc#543 ·
-
难度 2/5 1-3 小时 新手友好度 25/100
dsccommunity/NetworkingDsc#539 ·
-
难度 2/5 1-3 小时 新手友好度 25/100
dsccommunity/NetworkingDsc#538 ·
查看 dsccommunity/NetworkingDsc 的全部 Issue
相似的 Issue
-
Object Manager 1.13 resets a vCLU after sending a project可能已有人在做 @tciunelis 今天认领。 未关闭bug ready ticket
难度 2/5 1-3 小时 新手友好度 84/100
Domktorymysli/vclu#152 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
joshschmelzle/lswifi#170 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
-
bug
难度 2/5 1-3 小时 新手友好度 80/100
rossoctl/cortex#1546 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
PowerShell/Win32-OpenSSH#2482 · 1 个 reaction ·