wsman cli 2.3.2 can't parse keys (selectors) properly caused <s:Value>wsman:InvalidSelectors</s:Value>

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

wsman cli 2.3.2 can't parse keys (selectors) properly caused <s:Value>wsman:InvalidSelectors</s:Value>

nitetweaker
I installed the latest wsman cli below. I can use any other wsman commands except for the invoke method. I copied the wsman invoke command straight out of the Dell provided wsman scripts as well as consulted the Lifecycle_Controller_2_0_Web_Services_Interface_Guide_for_Linux_v1.0.pdf to verify the command. So I know I got the right command. I added the debug option and -R to print out the output and notice that wsman cli couldn't parse the keys (selectors) and their values properly, which caused the LifeCycle Controller not interpret the selectors accordingly. Please provide any suggestions on how to pass the selectors on the wsman cli accordingly. I also noticed that Dell's LifeCycle Controller used SMASH 2.0.0 from WS Inc. for WSMAN implementation. Not sure that makes a difference or not.

Dell WSMAN scripts

Lifecycle_Controller_2_0_Web_Services_Interface_Guide_for_Linux_v1.0.pdf

rpm -qa | grep wsman
wsmancli-2.3.2-54.6
libwsman1-2.4.15-148.1

wsman invoke -a GetRAIDLevels http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_RAIDService?SystemCreationClassName=DCIM_ComputerSystem,CreationClassName=DCIM_RAIDService,SystemName=DCIM:ComputerSystem,Name=DCIM:RAIDService -h 192.168.1.100 -V -v -c dummy.cert -P 443 -u root -p calvin -J GetRAIDLevels.xml -j utf-8 -y basic -R -d 6

----------------------------------------------------------------------------------------------------------------------
May 29 10:11:48  key=SystemCreationClassName value=DCIM_ComputerSystem,CreationClassName=DCIM_RAIDService,SystemName=DCIM:ComputerSystem,Name=DCIM:RAIDService
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd" xmlns:n1="http://schemas.dell.com/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_RAIDService">
  <s:Header>
    <wsa:Action s:mustUnderstand="true">http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_RAIDService/GetRAIDLevels</wsa:Action>
    <wsa:To s:mustUnderstand="true">https://192.168.1.100:443/wsman</wsa:To>
    <wsman:ResourceURI s:mustUnderstand="true">http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_RAIDService</wsman:ResourceURI>
    <wsa:MessageID s:mustUnderstand="true">uuid:92458538-173b-173b-8002-1c266d671e00</wsa:MessageID>
    <wsa:ReplyTo>
      <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
    </wsa:ReplyTo>
    <wsman:SelectorSet>
      <wsman:Selector Name="SystemCreationClassName">DCIM_ComputerSystem,CreationClassName=DCIM_RAIDService,SystemName=DCIM:ComputerSystem,Name=DCIM:RAIDService</wsman:Selector>
    </wsman:SelectorSet>

  </s:Header>
  <s:Body>
    <n1:GetRAIDLevels_INPUT>
      <n1:Target>RAID.Integrated.1-1</n1:Target>
      <n1:DiskType>0</n1:DiskType>
      <n1:Diskprotocol>0</n1:Diskprotocol>
      <n1:DiskEncrypt>0</n1:DiskEncrypt>
      <n1:PDArray>Disk.Bay.24:Enclosure.Internal.0-0:RAID.Integrated.1-1</n1:PDArray>
      <n1:PDArray>Disk.Bay.25:Enclosure.Internal.0-0:RAID.Integrated.1-1</n1:PDArray>
    </n1:GetRAIDLevels_INPUT>
  </s:Body>
</s:Envelope>
May 29 10:11:48  cl->authentication.verify_peer: 0
May 29 10:11:48  *****set post buf len = 1480******
* About to connect() to 192.168.1.100 port 443 (#0)
*   Trying 192.168.1.100... * connected
* Connected to 192.168.1.100 (192.168.1.100) port 443 (#0)
* error setting certificate verify locations, continuing anyway:
*   CAfile: dummy.cert
  CApath: /etc/ssl/certs/
* SSL connection using RC4-SHA
* Server certificate:
*        subject: C=US; ST=Texas; L=Round Rock; O=Dell Inc.; OU=Remote Access Group; CN=iDRAC7 default certificate
*        start date: 2011-06-07 23:54:19 GMT
*        expire date: 2021-06-04 23:54:19 GMT
*        issuer: C=US; ST=Texas; L=Round Rock; O=Dell Inc.; OU=Remote Access Group; CN=iDRAC7 default certificate
*        SSL certificate verify result: self signed certificate (18), continuing anyway.
> POST /wsman HTTP/1.1
Host: 192.168.1.100
Accept: */*
Content-Type: application/soap+xml;charset=utf-8
User-Agent: WS-Management for all
Content-Length: 1480
Expect: 100-continue

< HTTP/1.1 401 Unauthorized
< Date: Fri, 29 May 2015 22:12:13 GMT
< Server: Mbedthis-Appweb/2.4.2
< Content-type: text/html
< Content-length: 0
< Connection: close
< WWW-Authenticate: Basic realm="OPENWSMAN"
<
* Closing connection #0
May 29 10:11:48  Basic authentication is used
* About to connect() to 192.168.1.100 port 443 (#0)
*   Trying 192.168.1.100... * connected
* Connected to 192.168.1.100 (192.168.1.100) port 443 (#0)
* error setting certificate verify locations, continuing anyway:
*   CAfile: dummy.cert
  CApath: /etc/ssl/certs/
* SSL re-using session ID
* SSL connection using RC4-SHA
* Server certificate:
*        subject: C=US; ST=Texas; L=Round Rock; O=Dell Inc.; OU=Remote Access Group; CN=iDRAC7 default certificate
*        start date: 2011-06-07 23:54:19 GMT
*        expire date: 2021-06-04 23:54:19 GMT
*        issuer: C=US; ST=Texas; L=Round Rock; O=Dell Inc.; OU=Remote Access Group; CN=iDRAC7 default certificate
*        SSL certificate verify result: self signed certificate (18), continuing anyway.
* Server auth using Basic with user 'root'
> POST /wsman HTTP/1.1
Authorization: Basic cm9vdDpjYWx2aW4=
Host: 192.168.1.100
Accept: */*
Content-Type: application/soap+xml;charset=utf-8
User-Agent: WS-Management for all
Content-Length: 1480
Expect: 100-continue

* Done waiting for 100-continue
< HTTP/1.1 200 OK
< Date: Fri, 29 May 2015 22:12:14 GMT
< Server: Mbedthis-Appweb/2.4.2
< Content-type: application/soap+xml;charset=UTF-8
< Content-length: 932
< Connection: keep-alive
< Keep-Alive: timeout=60, max=200
<
May 29 10:11:49  write_handler: recieved 932 bytes, all = 932

* Connection #0 to host 192.168.1.100 left intact
May 29 10:11:49  curl error code: 0.
May 29 10:11:49  cl->response_code: 200.
May 29 10:11:49  cl->last_error code: 0.
<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">
  <s:Header>
    <wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
    <wsa:Action>http://schemas.dmtf.org/wbem/wsman/1/wsman/fault</wsa:Action>
    <wsa:RelatesTo>uuid:92458538-173b-173b-8002-1c266d671e00</wsa:RelatesTo>
    <wsa:MessageID>uuid:c4b3aef0-173f-173f-8005-a33f0f1cb190</wsa:MessageID>
  </s:Header>
  <s:Body>
    <s:Fault>
      <s:Code>
        <s:Value>s:Sender</s:Value>
        <s:Subcode>
          <s:Value>wsman:InvalidSelectors</s:Value>
        </s:Subcode>
      </s:Code>
      <s:Reason>
        <s:Text xml:lang="en">The Selectors for the resource are not valid.</s:Text>
      </s:Reason>
      <s:Detail>
        <wsman:FaultDetail>http://schemas.dmtf.org/wbem/wsman/1/wsman/faultDetail/InsufficientSelectors</wsman:FaultDetail>
      </s:Detail>
    </s:Fault>
  </s:Body>
</s:Envelope>
* Closing connection #0
--------------end of wsman invoke method-------------------------------------------------------

wsman identify -h 192.168.1.100 -P 443 -u root -p calvin -c Dummy -y basic -V –v

<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:wsmid="http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd" xmlns:n1="http://schemas.dmtf.org/wbem/smash/1/smash.xsd" xmlns:n2="http://schemas.dell.com/wbem/wscim/1/cim-schema/2/wsmanidentity.xsd">
  <s:Header/>
  <s:Body>
    <wsmid:IdentifyResponse>
      <wsmid:ProtocolVersion>http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd</wsmid:ProtocolVersion>
      <wsmid:ProductVendor>Dell, Inc.</wsmid:ProductVendor>
      <wsmid:ProductVersion>iDRAC : System Type = 12G Monolithic : LC Version = 2.1.0 : Version = 1.57.57</wsmid:ProductVersion>
      <n1:SMASHVersion>2.0.0</n1:SMASHVersion>
      <n2:ProductName>iDRAC</n2:ProductName>
      <n2:SystemGeneration>12G Monolithic</n2:SystemGeneration>
      <n2:FirmwareVersion>1.57.57</n2:FirmwareVersion>
      <n2:LifecycleControllerVersion>2.1.0</n2:LifecycleControllerVersion>
      <wsmid:SecurityProfiles>
        <wsmid:SecurityProfileName>HTTP_TLS_1</wsmid:SecurityProfileName>
      </wsmid:SecurityProfiles>
    </wsmid:IdentifyResponse>
  </s:Body>
</s:Envelope>
-----------------------------------end of iDRAC identify------------------------------------------------

wsman enumerate http://schemas.dell.com/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_RAIDService -u root -p calvin -h 192.168.1.100 -P 443 -c Dummy -y basic -V –v –M epr

<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsen="http://schemas.xmlsoap.org/ws/2004/09/enumeration">
  <s:Header>
    <wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
    <wsa:Action>http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse</wsa:Action>
    <wsa:RelatesTo>uuid:baf3bf01-173b-173b-8002-1c266d671e00</wsa:RelatesTo>
    <wsa:MessageID>uuid:ed581bb6-173f-173f-8009-a33f0f1cb190</wsa:MessageID>
  </s:Header>
  <s:Body>
    <wsen:EnumerateResponse>
      <wsen:EnumerationContext>ed540b84-173f-173f-8008-a33f0f1cb190</wsen:EnumerationContext>
    </wsen:EnumerateResponse>
  </s:Body>
</s:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsen="http://schemas.xmlsoap.org/ws/2004/09/enumeration" xmlns:n1="http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_RAIDService">
  <s:Header>
    <wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
    <wsa:Action>http://schemas.xmlsoap.org/ws/2004/09/enumeration/PullResponse</wsa:Action>
    <wsa:RelatesTo>uuid:bafa9749-173b-173b-8003-1c266d671e00</wsa:RelatesTo>
    <wsa:MessageID>uuid:ed5befa6-173f-173f-800a-a33f0f1cb190</wsa:MessageID>
  </s:Header>
  <s:Body>
    <wsen:PullResponse>
      <wsen:Items>
        <n1:DCIM_RAIDService>
          <n1:CreationClassName>DCIM_RAIDService</n1:CreationClassName>
          <n1:ElementName>RAID Service</n1:ElementName>
          <n1:Name>DCIM:RAIDService</n1:Name>
          <n1:SystemCreationClassName>DCIM_ComputerSystem</n1:SystemCreationClassName>
          <n1:SystemName>DCIM:ComputerSystem</n1:SystemName>
        </n1:DCIM_RAIDService>
      </wsen:Items>
      <wsen:EndOfSequence/>
    </wsen:PullResponse>
  </s:Body>
</s:Envelope>
--------------------------------end of end point reference------------------------------------------------------
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: wsman cli 2.3.2 can't parse keys (selectors) properly caused <s:Value>wsman:InvalidSelectors</s:Value>

Klaus Kaempf
* nitetweaker <[hidden email]> [May 29. 2015 19:41]:
> I installed the latest wsman cli below. I can use any other wsman commands
> except for the invoke method.

It's not just the invoke command, it's about the resource URI with
more than one selector.

>
> wsman invoke -a GetRAIDLevels
> http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_RAIDService?SystemCreationClassName=DCIM_ComputerSystem,CreationClassName=DCIM_RAIDService,SystemName=DCIM:ComputerSystem,Name=DCIM:RAIDService
> -h 192.168.1.100 -V -v -c dummy.cert -P 443 -u root -p calvin -J
> GetRAIDLevels.xml -j utf-8 -y basic -R -d 6

Using comma ',' to separate selectors
(SystemCreationClassName=DCIM_ComputerSystem,CreationClassName=DCIM_RAIDService,...)
is wrong. It must be an ampersand. See
http://en.wikipedia.org/wiki/URI_scheme#Generic_syntax

Older versions (older than 2.4.15) of Openwsman (resp. libwsman1)
wrongly(!) accepted comma. However, comma is the the separator for
cim/xml ObjectPath selectors.

This change was needed since selector values, e.g. in Windows WINRM,
can contain comma characters which were wrongly interpreted as
seperators. Changing it in a backwards-compatible way was too complex.

Klaus

P.S.: I already informed DELL about the change and hope they will
update their documentation soon.
--
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Dilip Upmanyu, Graham Norton, HRB 21284 (AG Nürnberg)
Maxfeldstraße 5, 90409 Nürnberg, Germany

------------------------------------------------------------------------------
_______________________________________________
Openwsman-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openwsman-devel
Loading...