WSMan windows 'PUT' 方法不更新必要的值

WSMan windows 'PUT' method do not update necessary values

所有。

我正在尝试使用不同的 WsMan 实用程序更新一些 WMI class 实例,例如 Msvm_ComputerSystem、Msvm_ProcessorSettingData:一个是我们公司编写的,下一个是 openwsman对于基于 linux 的系统,最后一个是来自另一台 windows 2012 计算机的 winrm。从所有这些我可以请求像这样的肥皂体查询:

<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:addr="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">
<env:Header>
    <addr:To env:mustUnderstand="true">http://192.168.111.174:5985/wsman</addr:To>
    <addr:ReplyTo>
        <addr:Address env:mustUnderstand="true">http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</addr:Address>
    </addr:ReplyTo>
    <wsman:MaxEnvelopeSize env:mustUnderstand="true">131072</wsman:MaxEnvelopeSize>
    <addr:MessageID env:mustUnderstand="true">e32c7eab-a27b-46a8-9343-13dc447072fc</addr:MessageID>
    <wsman:ResourceURI env:mustUnderstand="true">http://schemas.microsoft.com/wbem/wsman/1/wmi/root/virtualization/v2/Msvm_ProcessorSettingData</wsman:ResourceURI>
    <addr:Action env:mustUnderstand="true">http://schemas.xmlsoap.org/ws/2004/09/transfer/Put</addr:Action>
    <wsman:OperationTimeout>PT60.000S</wsman:OperationTimeout>
    <wsman:SelectorSet>
        <wsman:Selector Name="InstanceID">Microsoft:D3662848-4C35-49EA-9680-010DF6A9E71B\b637f346-6a0e-4dec-af52-bd70cb80a21d[=12=]</wsman:Selector>
    </wsman:SelectorSet>
</env:Header>
<env:Body>
    <p:Msvm_ProcessorSettingData
        xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wmi/root/virtualization/v2/Msvm_ProcessorSettingData">
        <p:VirtualQuantity>2</p:VirtualQuantity>
    </p:Msvm_ProcessorSettingData>
</env:Body>

我得到的响应是旧的 VirtualQuantity 值,没有任何错误响应:

<s:Envelope xml:lang="en-US" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:x="http://schemas.xmlsoap.org/ws/2004/09/transfer" xmlns:w="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"
xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd">
<s:Header>
    <a:Action>http://schemas.xmlsoap.org/ws/2004/09/transfer/PutResponse</a:Action>
    <a:MessageID>uuid:9DFBC1D3-5E96-4917-86D6-CBBB6003A2A7</a:MessageID>
    <a:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:To>
    <a:RelatesTo>27b78a50-b328-44a8-aa43-038f35fd3028</a:RelatesTo>
</s:Header>
<s:Body>
    <p:Msvm_ProcessorSettingData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wmi/root/virtualization/Msvm_ProcessorSettingData"
        xmlns:cim="http://schemas.dmtf.org/wbem/wscim/1/common" xsi:type="p:Msvm_ProcessorSettingData_Type">
        <p:Address xsi:nil="true" />
        <p:AllocationUnits>Processor Cores</p:AllocationUnits>
        <p:AutomaticAllocation>true</p:AutomaticAllocation>
        <p:AutomaticDeallocation>true</p:AutomaticDeallocation>
        <p:Caption>Processor</p:Caption>
        <p:ConsumerVisibility>3</p:ConsumerVisibility>
        <p:Description>Settings for Microsoft Virtual Processor.</p:Description>
        <p:DeviceID xsi:nil="true" />
        <p:DeviceIDFormat xsi:nil="true" />
        <p:ElementName>Processor</p:ElementName>
        <p:InstanceID>Microsoft:D3662848-4C35-49EA-9680-010DF6A9E71B\b637f346-6a0e-4dec-af52-bd70cb80a21d[=13=]</p:InstanceID>
        <p:IsVirtualized>true</p:IsVirtualized>
        <p:Limit>100000</p:Limit>
        <p:LimitCPUID>false</p:LimitCPUID>
        <p:LimitProcessorFeatures>false</p:LimitProcessorFeatures>
        <p:MappingBehavior xsi:nil="true" />
        <p:OtherResourceType xsi:nil="true" />
        <p:Parent xsi:nil="true" />
        <p:PoolID>A4F3C4E4-5E15-4018-A713-96C2CFB4C9B8</p:PoolID>
        <p:ProcessorsPerSocket>6</p:ProcessorsPerSocket>
        <p:Reservation>0</p:Reservation>
        <p:ResourceSubType>Microsoft Processor</p:ResourceSubType>
        <p:ResourceType>3</p:ResourceType>
        <p:SocketCount>1</p:SocketCount>
        <p:ThreadsEnabled xsi:nil="true" />
        <p:VirtualQuantity>6</p:VirtualQuantity>
        <p:Weight>100</p:Weight>
    </p:Msvm_ProcessorSettingData>
</s:Body>

正如我所说,我已经尝试过其他实用程序,例如 winrm。我的 winrm 请求是这样的:

winrm s http://schemas.microsoft.com/wbem/wsman/1/wmi/root/virtualization/v2/Msvm_ComputerSystem?CreationClassName=Msvm_ComputerSystem+Name=<vmUUID> -r:http://<hostIP>/wsman -u:<username> -p:<password> @{ElementName="testName"}

但是对于这个请求,我得到的响应也是以前的值。在基于 Linux 的系统上与 wsman 的情况相同。 所以,我的问题是怎么了?这是我的要求吗? Windows WsManagement 服务可能不支持 'PUT' 功能?

您正在尝试更新只读字段Msvm_ProcessorSettingData.VirtualQuantity https://msdn.microsoft.com/en-us/library/hh850190%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396