Windows Server TechCenter > Windows Server Forums > Management > Issue with winrm INVOKE for GetFcpTargetMapping method
Ask a questionAsk a question
 

AnswerIssue with winrm INVOKE for GetFcpTargetMapping method

  • Monday, November 30, 2009 10:52 AMunnisworld Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I am trying to INVOKE GetFcpTargetMapping method of MSFC_HBAFCPInfo class using winrm on a Windows 2008 R2 (64 bit OS) machine.

    The signature of GetFcpTargetMapping method is


    void GetFcpTargetMapping  (
      [in, HBAType("HBA_WWN")] uint8  HbaPortWWN[8],
      [in ] uint32  InEntryCount,
      [out, HBA_STATUS_QUALIFIERS ] HBA_STATUS  HBAStatus,
      [out] uint32  TotalEntryCount,
      [out] uint32  OutEntryCount,
      [out, WmiSizeIs("OutEntryCount")] HBAFCPScsiEntry  Entry[]
    );


    The command used is,

    winrm invoke GetFcpTargetMapping "wmi/root/wmi/MSFC_HBAFCPInfo?InstanceName=PCI\VEN_10DF&DEV_FE00&SUBSYS_FE0010DF&REV_02\4&1a67bb55&0&0020_0" -file:input.xml -format:pretty

    I am passing HBA WWN and InEntryCount in the input.xml file.

    <p:GetFcpTargetMapping_INPUT xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wmi/root/wmi/MSFC_HBAFCPInfo">
     <p:HbaPortWWN>16</p:HbaPortWWN>
     <p:HbaPortWWN>0</p:HbaPortWWN>
     <p:HbaPortWWN>0</p:HbaPortWWN>
     <p:HbaPortWWN>0</p:HbaPortWWN>
     <p:HbaPortWWN>201</p:HbaPortWWN>
     <p:HbaPortWWN>54</p:HbaPortWWN>
     <p:HbaPortWWN>13</p:HbaPortWWN>
     <p:HbaPortWWN>208</p:HbaPortWWN>
     <p:InEntryCount>7</p:InEntryCount>   
    </p:GetFcpTargetMapping_INPUT>

    The ouput that i get from winrm is given below,

    <p:GetFcpTargetMapping_OUTPUT xml:lang="en-US" xmlns:xsi="http://www.w3.org/2001
    /XMLSchema-instance" xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wmi/root
    /wmi/MSFC_HBAFCPInfo" xmlns:cim="http://schemas.dmtf.org/wbem/wscim/1/common">
        <p:HBAStatus>5</p:HBAStatus>
        <p:TotalEntryCount>0</p:TotalEntryCount>
        <p:OutEntryCount>0</p:OutEntryCount>
    </p:GetFcpTargetMapping_OUTPUT>

    If the method invocation is sussessful, it is expected to return an OutEntryCount greater than zero and an array of HBAFCPScsiEntry, representing each LUN on the target Array.

    I am able to invoke the same method and get expected result using WMI Browser (and also VBScript). As i understand it, at least theoretically winrm can be used to query any data available in WMI repository. So I suspect this to be an issue with winrm layer.

    My question here is, am i missing some winrm command options here?
    In this case, Winrm has to invoke a method and serialize the entire result array into XML and send it to client. Is winrm capable of doing that?

Answers

  • Tuesday, December 01, 2009 1:34 PMunnisworld Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    It was a silly mistake. I was passing wrong value for HbaPortWWN. I just had to pass the correct PortWWN value and increase size of MaxEnvelopeSizekb parameter to allow the huge xml output to pass through. Used the following command to set the size,

    winrm s winrm/config @{MaxEnvelopeSizekb="desired-int-value"}

    Anyways, i hope this post will be helpful for others who are trying to fetch Target LUN details through winrm.
     
    Just note that you need to remove one of the two back slash characters ("\") from the value that you see in WMI object browser, for the winrm command to work correctly.
    • Marked As Answer byunnisworld Tuesday, December 01, 2009 1:39 PM
    •  

All Replies

  • Tuesday, December 01, 2009 1:34 PMunnisworld Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    It was a silly mistake. I was passing wrong value for HbaPortWWN. I just had to pass the correct PortWWN value and increase size of MaxEnvelopeSizekb parameter to allow the huge xml output to pass through. Used the following command to set the size,

    winrm s winrm/config @{MaxEnvelopeSizekb="desired-int-value"}

    Anyways, i hope this post will be helpful for others who are trying to fetch Target LUN details through winrm.
     
    Just note that you need to remove one of the two back slash characters ("\") from the value that you see in WMI object browser, for the winrm command to work correctly.
    • Marked As Answer byunnisworld Tuesday, December 01, 2009 1:39 PM
    •