Resource Computer: Error 0x80041033 when VM joins AD domain
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- azure, powershell
- Lĩnh vực
- devops, operating-systems
Hướng nghiên cứu
Bắt đầu trong DSC_Computer.psm1, cụ thể là Set-TargetResource và thao tác JoinDomain của Computer, sau đó tái hiện lỗi bằng script Azure CLI và cấu hình DSC được cung cấp. So sánh hành vi hiện có của Add-Computer với cách khắc phục bằng việc khởi động lại đã được báo cáo; hoàn tất khi việc tham gia miền trên các image SharePoint Azure hoàn thành mà không có lỗi WS-Management 0x80041033.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Details of the scenario you tried and the problem that is occurring
This problem happens only with the SharePoint public images of Azure:
When resource "Computer" joins the VM to the domain, this error systematically occurs just after resource completes:
"The WS-Management service cannot process the request. The WMI service or the WMI provider returned an unknown error: HRESULT 0x80041033"
Verbose logs showing the problem
Notice that the error is not in resource Computer, but just after:
VERBOSE: [2021-01-12 15:32:34Z] [VERBOSE] [SP1]: LCM: [ Start Set ] [[Computer]JoinDomain]
VERBOSE: [2021-01-12 15:32:34Z] [VERBOSE] [SP1]: [[Computer]JoinDomain] Setting computer state for 'SP1'.
VERBOSE: [2021-01-12 15:32:34Z] [VERBOSE] [SP1]: [[Computer]JoinDomain] Perform operation 'Enumerate CimInstances' with following parameters, ''namespaceName' = root\cimv2,'className' = Win32_ComputerSystem'.
VERBOSE: [2021-01-12 15:32:34Z] [VERBOSE] [SP1]: [[Computer]JoinDomain] Operation 'Enumerate CimInstances' complete.
VERBOSE: [2021-01-12 15:32:34Z] [WARNING] [SP1]: [[Computer]JoinDomain] The changes will take effect after you restart the computer SP1.
VERBOSE: [2021-01-12 15:32:35Z] [VERBOSE] [SP1]: [[Computer]JoinDomain] Added computer to domain 'contoso.local'.
VERBOSE: [2021-01-12 15:32:35Z] [VERBOSE] [SP1]: LCM: [ End Set ] [[Computer]JoinDomain] in 1.7970 seconds.
VERBOSE: [2021-01-12 15:32:35Z] [VERBOSE] [SP1]: LCM: [ End Resource ] [[Computer]JoinDomain]
VERBOSE: [2021-01-12 15:32:41Z] [ERROR] The WS-Management service cannot process the request. The WMI service or the
WMI provider returned an unknown error: HRESULT 0x80041033
VERBOSE: [2021-01-12 15:32:41Z] [VERBOSE] Operation 'Invoke CimMethod' complete.
VERBOSE: [2021-01-12 15:32:41Z] [VERBOSE] Time taken for configuration job to complete is 497.2 seconds
VERBOSE: [2021-01-12 15:32:42Z] Settings handler status to 'transitioning'
Suggested solution to the issue
I found a dirty workaround that works 90% of the time:
I edited function Set-TargetResource in DSC_Computer.psm1 to add the following if this is a SharePoint VM:
- Add "Restart" to cmdlet Add-Computer
- Set the flag "$global:DSCMachineStatus = 1"
The DSC configuration that is used to reproduce the issue (as detailed as possible)
It repro every time, merely by joining an AD domain:
Computer JoinDomain
{
Name = $ComputerName
DomainName = $DomainFQDN
Credential = $DomainAdminCredsQualified
DependsOn = "[WaitForADDomain]WaitForDCReady"
}
I made an az cli script that creates a DC and a SP VM and fully repro from scratch:
# Create DC VM and SP VM
read -s -p "Type your password: " password
resourceGroupName="ydcli1"
adminUserName=yvand
dcip="10.0.0.4"
vmName=DC
az group create --name $resourceGroupName --location "west europe"
az vm create -g $resourceGroupName --name ${vmName} --os-disk-name "${vmName}-Disk-OS" --size Standard_D2_v3 \
--image "MicrosoftWindowsServer:WindowsServer:2019-Datacenter:latest" --private-ip-address $dcip --public-ip-address "" \
--admin-username $adminUserName --admin-password $password
az vm extension set -g $resourceGroupName --vm-name $vmName --name DSC --publisher Microsoft.Powershell --version 2.9 \
--settings '{"ModulesURL": "https://github.com/Yvand/AzureRM-Templates/raw/bug-join-domain/Templates/DTL-SharePoint-AllVersions-light/dsc/ConfigureDCVM.zip", "configurationFunction": "ConfigureDCVM.ps1\\ConfigureDCVM", "Properties": {"domainFQDN": "contoso.local", "PrivateIP": "'${dcip}'", "ConfigureADFS": 0 } }' \
--protected-settings '{"Properties": {"AdminCreds": {"UserName": "'${adminUserName}'", "Password": "'${password}'" }, "AdfsSvcCreds": {"UserName": "'${adminUserName}'", "Password": "'${password}'" }}}' --no-wait
vmName=SP1
az vm create -g $resourceGroupName --name ${vmName} --os-disk-name "${vmName}-Disk-OS" --size Standard_D2_v3 \
--image "MicrosoftSharePoint:MicrosoftSharePointServer:sp2019:1.0.2" \
--admin-username $adminUserName --admin-password $password
az vm extension set -g $resourceGroupName --vm-name $vmName --name DSC --publisher Microsoft.Powershell --version 2.9 \
--settings '{"ModulesURL": "https://github.com/Yvand/AzureRM-Templates/raw/bug-join-domain/Templates/DTL-SharePoint-AllVersions-light/dsc/ConfigureSPVM.zip", "configurationFunction": "ConfigureSPVM.ps1\\ConfigureSPVM", "Properties": {"domainFQDN": "contoso.local", "DNSServer": "'${dcip}'" } }' \
--protected-settings '{"Properties": {"DomainAdminCreds": {"UserName": "'${adminUserName}'", "Password": "'${password}'"}}}' --no-wait
The operating system the target node is running
It reproduces on SharePoint 2019/2016/2013 public images of Azure. Below is the output for the SharePoint 2019 VM:
OsName : Microsoft Windows Server 2019 Datacenter
OsOperatingSystemSKU : DatacenterServerEdition
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
Name Value
---- -----
PSVersion 5.1.17763.1007
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.1007
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Version of the DSC module that was used ('dev' if using current dev branch)
ComputerManagementDsc 8.4.0
- Ngôn ngữ chính
- PowerShell
- Star
- 338
- Fork
- 80
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của dsccommunity/ComputerManagementDsc
-
chore
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
chore
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
-
chore
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 64/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 55/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Tất cả issue của dsccommunity/ComputerManagementDsc
Issue tương tự
-
agentic-workflows
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
microsoft/ebpf-for-windows#5604 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Theme: Bots Type: Bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
internetarchive/openlibrary#13743 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
blinklabs-io/actions#138 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
.Needs Triage .Run Repro Bot Priority:P2 Type:Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
metabase/metabase#83153 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày