Skip to main content
  • Place orders quickly and easily
  • View orders and track your shipping status
  • Enjoy members-only rewards and discounts
  • Create and access a list of your products
  • Manage your Dell EMC sites, products, and product-level contacts using Company Administration.

열거 이상의 WSMAN 탐색

Summary: Dell TechCenter의 Dell OS 및 애플리케이션 솔루션 - Project Sputnik, Microsoft Windows, Red Hat Linux, SUSE, Ubuntu 등

This article may have been automatically translated. If you have any feedback regarding its quality, please let us know using the form at the bottom of this page.

Article Content


Symptoms

Dell iDRAC용 관리 API로 WSMAN을 선택했으며 원격 시스템을 최대한 포괄적으로 그리고 쉽게 관리하기 위해 광범위한 노력이 진행 중입니다. 최근에 플러그인을 구현하기 위해 WSMAN 프로토콜을 이해하는 데 약간의 시간을 보냈고 초기 WSMAN 열거 작업 후 WSMAN 프로토콜 상황이 잘 풀리지 않았습니다. 올바른 주요 속성을 사용하여 get/put/create/delete/custom 동작을 호출하는 방법에 대한 쉬운 문서/예시는 없습니다.  이 정보의 주요 출처는 DMTF의 WSMAN 사양 및 WSMAN-CIM 바인딩 사양으로 따르기에는 너무 길고 복잡합니다. 다시 말하지만, 이 문서 콘텐츠의 대부분은 DMTF 사양 문서의 내용입니다. 이것은 정보를 몇 가지 예로 쉽게 소화하기 위한 시도입니다(Linux에서).

 이미 다음에서 SFCB와 openwsman을 시작하는 방법에 대한 백서를 게시했습니다. https://linux.dell.com/files/whitepapers/WBEM_based_management_in_Linux.pdf명령을 입력합니다. WSMAN/SFCB를 처음 접하는 경우 pdf가 이 문서보다 더 좋은 출발점이 될 것입니다. 위의 백서에서와 같이 이 문서에서는 openwsman 및 SFCB CIMOM 구현을 주로 다룰 것입이다.

 이제 WSMAN 서버를 고려할 때 WSMAN API로 관리할 수 있는 모든 구성 요소를 나열하는 방법이 있습니까? 대부분의 WSMAN 서버는 백엔드의 CIMOM과 통신하며 CIMOM의 관리 기능을 노출합니다. 즉, WSMAN 서버의 관리 기능은 백엔드의 CIMOM에 등록된 CIM 공급자에 따라 달라집니다. CIMOM에는 CIMOM에 등록된 모든 클래스를 나열하기 위해 호출할 수 있도록 정의된 EnumerateClassNames라는 이름의 내장 함수가 있습니다.

Cause

WSMAN 사양에는 EnumerateClassNames에 대한 일대일 매핑이 없으므로 WSMAN의 다른 맞춤형 함수와 마찬가지로 이 메서드가 호출됩니다. 이는 구현에 따라 다르며 wsmancli 구현에 적용됩니다. 이 내용은 향후 릴리스에서 달라지거나 업데이트될 수 있습니다.

Resolution

CIMOM의 내장 EnumerateClassNames 함수는 wsmancli를 사용하여 다음과 같이 호출할 수 있습니다.
wsman invoke -a EnumerateClassNames --hostname=test_host --port=5985 --username=abc --password=password http://schemas.openwsman.org/wbem/wscim/1/instrinsic  --namespace=root/cimv2
   
 <s:Body>

    <n1:EnumerateClassNames>

      <n1:name>root/cimv2:CIM_Service</n1:name>

      <n1:name>root/cimv2:Syslog_RecordInLog</n1:name>

      <n1:name>root/cimv2:Linux_SambaValidUsersForShare</n1:name>

       <n1:name>root/cimv2:Linux_BaseBoard</n1:name>

      <n1:name>root/cimv2:Linux_SambaForceUserForShare</n1:name>

      <n1:name>root/cimv2:Linux_Processor</n1:name>

      <n1:name>root/cimv2:CIM_RecordForLog</n1:name>

      <n1:name>root/cimv2:Linux_SambaShareForService</n1:name>

      <n1:name>root/cimv2:Linux_SambaServiceConfigurationForService</n1:name>

      <n1:name>root/cimv2:Linux_SambaHostsForService</n1:name>

      <n1:name>root/cimv2:Linux_SambaForceUserForGlobal</n1:name>

      <n1:name>root/cimv2:CIM_OSProcess</n1:name>

      <n1:name>root/cimv2:CIM_RunningOS</n1:name>...................
 
출력은 위와 같이 나타나며, 네임스페이스 root/cimv2에서 Linux_Processor가 등록된 클래스 중 하나임을 나타냅니다. root/cimv2 네임스페이스에 새 클래스가 등록될 때 상속되는 CIM 클래스가 많이 있으며 위의 명령은 이러한 클래스 이름도 모두 나열합니다. 일반적으로 CIM_ 접두사가 있는 클래스는 모두 무시할 수 있습니다. Linux_ 접두사가 있는 모든 클래스는 Linux 시스템에 설치된 공급자가 등록한 클래스입니다. Dell의 iDRAC으로 작업하는 동안 주로 DCIM_ 접두사가 있는 클래스에 관심이 있을 것입니다.

 이제 모든 클래스 이름이 포함된 목록이 있으므로 getClass 내장 함수를 사용하여 다음과 같이 Linux_Processor 클래스의 정의를 얻을 수 있습니다.
wsman invoke -a GetClass --hostname=test_host --port=5985 --username=abc --password=password http://schemas.openwsman.org/wbem/wscim/1/intrinsic/Linux_Processor  --namespace=root/cimv2
 
 위의 명령은 Linux_Processor에서 로컬로 정의된 모든 속성을 나열합니다. 즉, 다른 CIM_* 클래스에서 상속된 모든 속성이 현재 구현으로 나열되지 않습니다. 일반적으로 클래스 정의를 통해 클래스에 정의된 메서드, 해당 메서드에 전달해야 하는 매개변수 및 클래스의 주요 속성 등을 파악할 수 있습니다. 그러나 위 명령은 로컬 속성만 반환하므로 클래스의 주요 속성을 식별할 수 없습니다. 다시 말하지만, 이것은 현재 wsmancli의 구현 제한 사항입니다.

따라서 GetClass 함수가 좋은 시작점이지만 get/put/create/custom 동작이 호출될 수 있도록 클래스의 어떤 속성을 주요 속성으로 사용할 수 있는지를 결정하기에는 해당 출력으로는 충분하지 않습니다. 그러면 이를 결정하기 위해 어떤 다른 기법을 사용할 수 있습니까? EPR이 도움이 될 수 있습니다.


EPR(End Point Reference)은 ResourceURI와 Selector Set의 두 가지 정보를 가진 인스턴스에 대한 포인터입니다. ResourceURI에는 인스턴스가 생성되는 클래스 이름이 있으며 Selector Set에는 인스턴스를 고유하게 식별할 수 있는 속성이 나열됩니다. 특정 클래스의 EPR은 다음과 유사한 명령을 사용하여 열거할 수 있습니다.
wsman enumerate -M epr  http://sblim.sf.net/wbem/wscim/1/cim-schema/2/Linux_Processor -h test_host-P 5985 -u abc -p password -O out

 <?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: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.xmlsoap.org/ws/2004/09/enumeration/PullResponse</wsa:Action>

    <wsa:RelatesTo>uuid:ca52c9e9-cd47-1d47-8003-a52924d9bed4</wsa:RelatesTo>

    <wsa:MessageID>uuid:ca622bb3-cd47-1d47-8097-a52924d9bed4</wsa:MessageID>

  </s:Header>

  <s:Body>

    <wsen:PullResponse>

      <wsen:EnumerationContext>ca4fdd21-cd47-1d47-8095-a52924d9bed4</wsen:EnumerationContext>

      <wsen:Items>

        <wsa:EndpointReference>

          <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>

          <wsa:ReferenceParameters>

            <wsman:ResourceURI>http://sblim.sf.net/wbem/wscim/1/cim-schema/2/Linux_Processor</wsman:ResourceURI>

            <wsman:SelectorSet>

              <wsman:Selector Name="__cimnamespace">root/cimv2</wsman:Selector>

              <wsman:Selector Name="SystemCreationClassName">Linux_ComputerSystem</wsman:Selector>

              <wsman:Selector Name="SystemName">localhost.localdomain</wsman:Selector>

              <wsman:Selector Name="CreationClassName">Linux_Processor</wsman:Selector>

              <wsman:Selector Name="DeviceID">0</wsman:Selector>

            </wsman:SelectorSet>

          </wsa:ReferenceParameters>

        </wsa:EndpointReference>

      </wsen:Items>

    </wsen:PullResponse>

  </s:Body>

</s:Envelope>
 타겟 시스템의 모든 프로세서 중에서 위의 출력은 하나의 프로세서일 뿐입니다. 출력에서 resourceURI는 http://sblim.sf.net/wbem/wscim/1/cim-schema/2/Linux_Processor로 나열되고 SelectorSet는 __cimnamespace, SystemCreationClassName, SystemName, CreationClassName 및 DeviceID 값을 나열합니다. 이는 Linux_Processor 클래스(상속되고 로컬로 정의됨)의 모든 속성을 의미합니다. 이러한 속성은 인스턴스를 고유하게 식별하는 데 사용할 수 있습니다.

 따라서 다음과 같은 명령에서 유효한 응답을 기대할 수 있습니다.
wsman get  http://sblim.sf.net/wbem/wscim/1/cim-schema/2/Linux_Processor?SystemCreationClassName="Linux_ComputerSystem",SystemName="localhost.localdomain",CreationClassName="Linux_Processor",DeviceID="3",__cimnamespace="root/cimv2" -h test_host -P 5985 -u abc -p password -O get
 위의 요청에 다른 속성이 사용되는 경우 백엔드의 CIMOM은 인스턴스를 고유하게 식별할 수 없습니다. 마찬가지로 인스턴스를 실행해야 하는 맞춤형 메서드가 있는 경우 클래스의 EPR을 사용하여 메서드를 호출할 주요 속성을 식별할 수 있습니다.

연관 EPR도 열거할 수 있습니다. 클래스 이름이 주어진 경우 표준 클래스 이름인지 연관 클래스인지 알 수 없습니다. 연관 인스턴스에는 두 인스턴스에 대한 포인터가 있으므로 연관 EPR에는 연관이 참조하는 인스턴스/오브젝트의 EPR이 있습니다. 다음은 동일한 예시입니다.
wsman enumerate -M epr  http://sblim.sf.net/wbem/wscim/1/cim-schema/2/Linux_CSProcessor -h test_host -P 5985 -u abc -p password -O out

 <?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: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.xmlsoap.org/ws/2004/09/enumeration/PullResponse</wsa:Action>

    <wsa:RelatesTo>uuid:2efbfcad-cd4b-1d4b-8003-a52924d9bed4</wsa:RelatesTo>

    <wsa:MessageID>uuid:2efc1c6f-cd4b-1d4b-80b3-a52924d9bed4</wsa:MessageID>

  </s:Header>

  <s:Body>

    <wsen:PullResponse>

      <wsen:EnumerationContext>2ef7f6f5-cd4b-1d4b-80b1-a52924d9bed4</wsen:EnumerationContext>

      <wsen:Items>

        <wsa:EndpointReference>

          <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>

          <wsa:ReferenceParameters>

            <wsman:ResourceURI>http://sblim.sf.net/wbem/wscim/1/cim-schema/2/Linux_CSProcessor</wsman:ResourceURI>

            <wsman:SelectorSet>

              <wsman:Selector Name="__cimnamespace">root/cimv2</wsman:Selector>

              <wsman:Selector Name="GroupComponent">

                <wsa:EndpointReference>

                  <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>

                  <wsa:ReferenceParameters>

                    <wsman:ResourceURI>http://sblim.sf.net/wbem/wscim/1/cim-schema/2/Linux_ComputerSystem</wsman:ResourceURI>

                    <wsman:SelectorSet>

                      <wsman:Selector Name="CreationClassName">Linux_ComputerSystem</wsman:Selector>

                      <wsman:Selector Name="Name">localhost.localdomain</wsman:Selector>

                      <wsman:Selector Name="__cimnamespace">root/cimv2</wsman:Selector>

                    </wsman:SelectorSet>

                  </wsa:ReferenceParameters>

                </wsa:EndpointReference>

              </wsman:Selector>

              <wsman:Selector Name="PartComponent">

                <wsa:EndpointReference>

                  <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>

                  <wsa:ReferenceParameters>

                    <wsman:ResourceURI>http://sblim.sf.net/wbem/wscim/1/cim-schema/2/Linux_Processor</wsman:ResourceURI>

                    <wsman:SelectorSet>

                      <wsman:Selector Name="SystemCreationClassName">Linux_ComputerSystem</wsman:Selector>

                      <wsman:Selector Name="SystemName">localhost.localdomain</wsman:Selector>

                      <wsman:Selector Name="CreationClassName">Linux_Processor</wsman:Selector>

                      <wsman:Selector Name="DeviceID">0</wsman:Selector>

                      <wsman:Selector Name="__cimnamespace">root/cimv2</wsman:Selector>

                    </wsman:SelectorSet>

                  </wsa:ReferenceParameters>

                </wsa:EndpointReference>

              </wsman:Selector>

            </wsman:SelectorSet>

          </wsa:ReferenceParameters>

        </wsa:EndpointReference>

      </wsen:Items>

    </wsen:PullResponse>

  </s:Body>

</s:Envelope>
Linux_CSProcessorLinux_ComputerSystemLinux_Processor 클래스 간의 연관으로 프로세서가 컴퓨터 시스템에 포함되어 있는 관계와 GroupComponent 및 PartComponent 섹션의 관계를 설정합니다.

다른 사람들에게 유용할 수 있다고 생각했기 때문에 EPR을 파악하고 EPR을 사용하여 개별 인스턴스에 액세스하는 방법을 알아내야 했습니다. 아래에 여러분의 의견/제안 사항을 남겨 주시기 바랍니다.

면책:

위 문서는 정보 제공 목적으로만 제공됩니다. 해당 콘텐츠는 언급된 기술/용어에 대한 개인적인 해석에서 비롯된 것입니다. 이 정보는 있는 그대로 제공되며 일부 오타 및/또는 기술적으로 부정확한 내용이 포함되어 있을 수 있습니다.

Article Properties


Affected Product

Ubuntu Server LTS

Last Published Date

11 Jun 2024

Version

4

Article Type

Solution