简体   繁体   English

WSMan Windows的“ PUT”方法不会更新必要的值

[英]WSMan windows 'PUT' method do not update necessary values

all. 所有。

I'm trying to update some WMI class instance like Msvm_ComputerSystem, Msvm_ProcessorSettingData with the different WsMan utilities: one is written by our company, the next one is the openwsman for linux-based systems, and the last is winrm from the other windows 2012 computer. 我正在尝试使用其他WsMan实用程序更新一些WMI类实例,例如Msvm_ComputerSystem,Msvm_ProcessorSettingData:一个是由我们公司编写的,下一个是针对基于linux的系统的openwsman,最后一个是从另一台Windows 2012计算机上获得的winrm 。 From all of it I could request put query with soap body like this one: 从所有这些中,我可以请求像这样的带有皂体的put查询:

<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\0</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>

And I'm getting the response with the old VirtualQuantity values without any error response: 我得到的是带有旧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\0</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>

As I could said, I have tried another utilities like winrm. 正如我可以说的那样,我尝试了另外一种实用程序,例如winrm。 My winrm request were like this: 我的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"}

But for this request I'm getting the response with previous values too. 但是对于这个请求,我也得到了以前值的响应。 And the same situation with wsman on the Linux-based system. 与基于Linux的系统上的wsman情况相同。 So, my question is what's wrong? 所以,我的问题是怎么了? Is it something in my request? 是我的要求吗? Maybe 'PUT' functionality is not supported by the Windows WsManagement service? Windows WsManagement服务可能不支持“ PUT”功能吗?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM