我在玩DSC来管理2个节点,我已经能够设置我的拉取服务器,但现在的问题是从拉取服务器推送/拉出配置,这是不工作的。
我尝试解决这个问题,我可以在GetAction请求的响应中看到错误,但我不知道它是什么意思。
http://server1:8080/PSDSCPullServer.svc/Action(ConfigurationId='8394f90e-0525-4d0d-aa75-653b64981fc4')/GetAction
{
"odata.error": {
"code": "",
"message": {
"lang": "en-US",
"value": "nodeComplianceStatus or mofChecksum not found for MSFT.PSDSCAction."
},
"innererror": {
"message": "nodeComplianceStatus or mofChecksum not found for MSFT.PSDSCAction.",
"type": "System.ArgumentException",
"stacktrace": ""
},
"MODATA.Exception.ErrorRecord": {
"odata.type": "MODATA.Exception.DataServiceException",
"ErrorCode": "",
"MessageLanguage": "en-US",
"StatusCode": 400,
"Message": "nodeComplianceStatus or mofChecksum not found for MSFT.PSDSCAction.",
"Data": [],
"InnerException": {
"Message": "nodeComplianceStatus or mofChecksum not found for MSFT.PSDSCAction.",
"Data": [],
"InnerException": null,
"TargetSite": null,
"StackTrace": null,
"HelpLink": null,
"Source": null,
"HResult": -2147024809
},
"TargetSite": null,
"StackTrace": " at Microsoft.Management.Odata.Core.OperationManagerAdapter.InvokeMethod(IInvoker invoker, String functionName, String resourceTypeName, Boolean ignoreNotImplementedException)\r\n at Microsoft.Management.Odata.Core.OperationManagerAdapter.InvokeOperationManagerFunction[T](Func`1 func, String functionName, String resourceTypeName, Boolean ignoreNotImplementedException, T defaultResultForNotImplementedException)\r\n at Microsoft.Management.Odata.Core.OperationManagerAdapter.InvokeAction(ResourceType resourceType, IEnumerable`1 resourceKeys, String actionName, IEnumerable`1 inputParameters, ResourceType returnType)\r\n at Microsoft.Management.Odata.Core.DataServiceInvokable.InvokeActionOnAst(RequestAstNode root)\r\n at Microsoft.Management.Odata.Core.DataServiceInvokable.Invoke()\r\n at Microsoft.Management.Odata.Core.DataServiceUpdateProvider.SaveChanges()\r\n at System.Data.Services.DataService`1.HandleNonBatchRequest(RequestDescription description)\r\n at System.Data.Services.DataService`1.HandleRequest()",
"HelpLink": null,
"Source": "Microsoft.Management.OData",
"HResult": -2146233079
}
}
}知道出什么问题了吗?
发布于 2016-04-21 00:05:36
当您将配置放在拉取服务器上时,您必须包括从配置生成的校验和文件。您可以使用the New-DscChecksum cmdlet生成此代码。
发布于 2016-04-22 05:10:05
从错误中看,呼叫似乎没有到达DSC pull服务端点,并且被OData服务拒绝,因为请求的正文中缺少某些内容。您可以使用Invoke-WebRequest尝试该请求进行故障排除。
$bodyArgs = @{Checksum="somechecksum"; ChecksumAlgorithm="SHA 256";NodeCompliant="false"}
$jsonBodyArgs = $bodyArgs|ConvertTo-Json
Invoke-WebRequest -Uri "http://server1:8080/PSDSCPullServer.svc/Action(ConfigurationId='8394f90e-0525-4d0d-aa75-653b64981fc4')/GetAction"
-UseBasicParsing -Method Post -Body $jsonBodyArgs -Headers @{Accept="application/json"} -ContentType "application/json;odata=minimalmetadata;charset=utf-8"拉取服务器日志将包含有关报告给节点的故障的信息。日志可以通过以下方式获取:
Get-WinEvent -LogName
"Microsoft-Windows-Powershell-DesiredStateConfiguration-PullServer/Operational"
Get-WinEvent -LogName
"Microsoft-Windows-ManagementOdataService/Operational"这些日志通常包含足够的信息来排除底层问题。
发布于 2017-04-14 17:52:48
尝试检查您的pullserver是否真的指向proram files\windowspowershell而不是program files(x86)\windowspowershell。这可能就是问题所在。DSC错误消息并不总是非常有用。
查看您的pullservers webconfig文件,以了解pullserver尝试将其配置拉入客户端的位置。
https://stackoverflow.com/questions/36748830
复制相似问题