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

WSMAN은 Dell iDRAC용으로 선택된 관리 API이며 원격 시스템 관리를 가능한 한 포괄적이고 쉽게 만들기 위해 광범위한 노력이 진행 중입니다. 나는 최근에 플러그인을 구현하기 위해 WSMAN 프로토콜을 이해하는 데 시간을 보냈고 초기 wsman 열거 작업 후에 WSMAN 프로토콜이 약간 털이 생겼습니다. 올바른 키 속성을 사용하여 get / put / create / delete / custom Actions를 호출하는 방법에 대한 쉬운 문서 / 예제가 없습니다.  이 정보의 기본 소스는 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_* 클래스에서 상속된 속성은 현재 구현에 나열되지 않습니다. 일반적으로 클래스의 정의에서 클래스에 정의되어있는 메소드, 해당 메소드에 전달되어야하는 매개 변수 및 클래스의 속성이 키 속성 등인지 파악 할 수 있습니다. 그러나 위의 명령은 Local 속성만 반환하므로 클래스의 키 속성을 식별할 수 없습니다. 다시 말하지만, 이것은 현재 wsmancli의 구현 제한 사항입니다.

따라서 GetClass 함수가 좋은 시작점이기는 하지만 이 함수의 출력만으로는 get/put/create/custom 액션을 호출할 수 있도록 클래스의 어떤 속성을 키 속성으로 사용할 수 있는지 결정하기에 충분하지 않습니다. 그렇다면 이를 달성하기 위해 사용할 수 있는 다른 기술은 무엇입니까? 바로 이 부분에서 EPR이 도움이 될 수 있습니다.


EPR(End Point Reference)은 ResourceURI와 선택기 집합이라는 두 가지 정보가 있는 인스턴스에 대한 포인터입니다. ResourceURI에는 인스턴스가 만들어지는 클래스 이름이 있고 선택기 집합에는 인스턴스를 고유하게 식별할 수 있는 속성이 나열됩니다. 특정 클래스의 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_ComputerSystem 클래스와 Linux_Processor 클래스 간의 연결로, 프로세서가 컴퓨터 시스템에 포함되어 있는 관계와 GroupComponent 및 PartComponent 섹션을 설정합니다.

EPR과 EPR을 개별 인스턴스에 액세스하는 데 사용할 수 있는 방법을 파악하는 데 시간을 할애해야 했으며 다른 사람들에게 유용할 것이라고 생각했습니다. 아래에 의견/제안을 남겨주세요.

면책 조항:

위 기사는 정보 제공의 목적으로만 사용됩니다. 내용은 언급 된 기술 / 용어에 대한 나의 해석에서 나온 것입니다. 이 정보는 있는 그대로 제공되며 일부 입력 오류 및/또는 기술적인 정확성 문제를 포함할 수 있습니다.

Article Properties


Affected Product

Ubuntu Server LTS

Last Published Date

11 Jun 2024

Version

4

Article Type

Solution