Instana

 View Only

How to enable energy monitoring for IBM Power systems

By Bipin Chandra posted Wed November 30, 2022 06:34 AM

  

Energy monitoring provides information about the power consumption data of a Managed System, along with generated heat from inlet, CPU, and baseboards. These details are helpful in finding out whether a system is overloaded, generating more heat, or using more power than expected. The metrics also indicate where the load can be distributed. Energy monitoring is supported by Managed Systems that have FSP level 860.1 and above.

To enable energy monitoring for IBM Power® HMC Instana Sensor to collect energy-related metrics, complete the following steps.

STEP 1: Login (Request method: PUT)

Create a file login.xml with the following content:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<LogonRequest xmlns="http://www.ibm.com/xmlns/systems/power/firmware/web/mc/2012_10/"
 schemaVersion="V1_1_0">
    <Metadata>
        <Atom/>
    </Metadata>
    <UserID kb="CUR" kxe="false">userid</UserID>
    <Password kb="CUR" kxe="false">password</Password>
</LogonRequest>

Note: Replace userid and password with actual credentials.

Run the following curl command:

$ curl -k -i -X PUT -H "Content-Type: application/vnd.ibm.powervm.web+xml; type=LogonRequest" -H "Accept: application/vnd.ibm.powervm.web+xml; type=LogonResponse" -H "X-Audit-Memento: hmc_test" -d @login.xml https://hmcHost:hmcApiPort/rest/api/web/Logon

 

Note: Replace hmcHost and hmcApiPort with actual HMC host and API port.

The response is as follows:

HTTP/2 200
date: Tue, 10 May 2022 05:26:37 GMT
server: Server Hardware Management Console
x-content-type-options: nosniff
strict-transport-security: max-age=31536000; includeSubDomains
referrer-policy: no-referrer
x-frame-options: SAMEORIGIN
x-transaction-id: XT10066672
content-type: application/vnd.ibm.powervm.web+xml; type=LogonResponse
set-cookie: JSESSIONID=684CEB2C0244BE4274025F0A237A295B; Path=/rest; Secure; HttpOnly
set-cookie: CCFWSESSION=DCB4CCFBE1C68327D4950873FAD985F3; Path=/; Secure; HttpOnly
content-security-policy: default-src https:; script-src https: 'unsafe-inline' 'unsafe-eval'; style-src https: 'unsafe-inline' 'unsafe-eval'; connect-src 'self'
x-xss-protection: 1; mode=block
vary: User-Agent

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<LogonResponse xmlns="http://www.ibm.com/xmlns/systems/power/firmware/web/mc/2012_10/" xmlns:ns2="http://www.w3.org/XML/1998/namespace/k2" schemaVersion="V1_0">
    <Metadata>
        <Atom/>
    </Metadata>
    <X-API-Session kb="ROR" kxe="false">Ivq2wxwdH42qfYLSurUMgkaZZuRrYW4Rr8dN4WWufIT1UIKqZqh1DaR_DsVBnWCQGw6ffgTbEv17UwrUQHsr_XNbBs3WMvSfRK58D4tiYFcPPk-ekP5QCfc7dnMSJ3sJT8fcPCLO_QwxmjhGY-E7YjiW9q764nlg-wtFsVMrjRBBqLvvHfQyh8W1hxSFDSxDxCXFzcGjF-PRt4M6VHXW5_8V6Kmb68gJwnSDbI367C4=</X-API-Session>
</LogonResponse>

 

Copy the X-API-Session ID from the response, and move to Step 2.

 

STEP 2: GET list of Managed Systems

Get the list of managed system ID by running the following curl command with the copied  X-API-Session ID:

curl -k -i -H "Content-Type: application/xml" -H "X-API-Session: Ivq2wxwdH42qfYLSurUMgkaZZuRrYW4Rr8dN4WWufIT1UIKqZqh1DaR_DsVBnWCQGw6ffgTbEv17UwrUQHsr_XNbBs3WMvSfRK58D4tiYFcPPk-ekP5QCfc7dnMSJ3sJT8fcPCLO_QwxmjhGY-E7YjiW9q764nlg-wtFsVMrjRBBqLvvHfQyh8W1hxSFDSxDxCXFzcGjF-PRt4M6VHXW5_8V6Kmb68gJwnSDbI367C4=" -X GET https://hmcHost:hmcApiPort/rest/api/pcm/preferences

The response is as follows:


<feed xmlns="http://www.w3.org/2005/Atom" xmlns:ns2="http://a9.com/-/spec/opensearch/1.1/" xmlns:ns3="http://www.w3.org/1999/xhtml">
    <id>9c5145e8-ec84-409a-8066-c681104b734d</id>
    <title type="text">Performance and Capacity Monitoring Preferences</title>
    <subtitle type="text"/>
    <link rel="self" href="https://129.40.156.64:12443/rest/api/pcm/preferences"/>
    <generator uri="IBM Power Systems Management Console" version="1"/>
    <entry>
        <id>05d3dcb3-4c17-434e-8aba-1925df3db0fb</id>
        <updated>2022-11-23T10:47:12.458Z</updated>
        <title type="text">Performance and Capacity Monitoring Preferences</title>
        <published>2022-11-23T10:47:12.458Z</published>
        <author>
            <name>IBM Power Systems Management Console</name>
        </author>
        <content type="application/xml">
            <ManagementConsolePcmPreference:ManagementConsolePcmPreference xmlns:ManagementConsolePcmPreference="http://www.ibm.com/xmlns/systems/power/firmware/pcm/mc/2012_10/" xmlns="http://www.ibm.com/xmlns/systems/power/firmware/pcm/mc/2012_10/" xmlns:ns2="http://www.w3.org/XML/1998/namespace/k2" schemaVersion="V1_0">
                <Metadata>
                    <Atom>
                        <AtomID>e96fdc8f-022c-3393-ac28-41bbfc6cd1b5</AtomID>
                        <AtomCreated>1669200432457</AtomCreated>
                    </Atom>
                </Metadata>
                <MaximumManagedSystemsForLongTermMonitor kxe="false" kb="ROR">48</MaximumManagedSystemsForLongTermMonitor>
                <MaximumManagedSystemsForComputeLTM kxe="false" kb="ROR">60</MaximumManagedSystemsForComputeLTM>
                <MaximumManagedSystemsForAggregation kb="ROR" kxe="false">48</MaximumManagedSystemsForAggregation>
                <MaximumManagedSystemsForShortTermMonitor kxe="false" kb="ROR">5</MaximumManagedSystemsForShortTermMonitor>
                <MaximumManagedSystemsForEnergyMonitor kxe="false" kb="ROR">48</MaximumManagedSystemsForEnergyMonitor>
                <AggregatedMetricsStorageDuration kb="UOD" kxe="false">31622400</AggregatedMetricsStorageDuration>
                <ManagedSystemPcmPreference kxe="false" kb="UOD" schemaVersion="V1_0">
                    <Metadata>
                        <Atom>
                            <AtomID>5bf45541-01dd-3288-9879-1a6128c33a8c</AtomID>
                            <AtomCreated>1669200432354</AtomCreated>
                        </Atom>
                    </Metadata>
                    <SystemName kxe="false" kb="ROR">Server-8247-22L-SN101402A</SystemName>
                    <MachineTypeModelSerialNumber kxe="false" kb="ROR" schemaVersion="V1_0">
                        <Metadata>
                            <Atom/>
                        </Metadata>
                        <MachineType kxe="false" kb="ROR">8247</MachineType>
                        <Model kb="ROR" kxe="false">22L</Model>
                        <SerialNumber kxe="false" kb="ROR">101402A</SerialNumber>
                    </MachineTypeModelSerialNumber>
                    <EnergyMonitoringCapable kxe="false" kb="ROO">true</EnergyMonitoringCapable>
                    <LongTermMonitorEnabled kxe="false" kb="UOD">true</LongTermMonitorEnabled>
                    <AggregationEnabled kxe="false" kb="UOD">true</AggregationEnabled>
                    <ShortTermMonitorEnabled kb="UOD" kxe="false">false</ShortTermMonitorEnabled>
                    <ComputeLTMEnabled ksv="V1_1_0" kb="UOD" kxe="false">false</ComputeLTMEnabled>
                    <EnergyMonitorEnabled kxe="false" kb="UOD">true</EnergyMonitorEnabled>
                    <AssociatedManagedSystem kxe="false" kb="ROO" href="https://129.40.156.64:12443/rest/api/uom/ManagedSystem/5bf45541-01dd-3288-9879-1a6128c33a8c" rel="related"/>
                </ManagedSystemPcmPreference>
                <ManagedSystemPcmPreference kxe="false" kb="UOD" schemaVersion="V1_0">
                    <Metadata>
                        <Atom>
                            <AtomID>801c9574-90e3-3c35-9759-1e25ac9bc03b</AtomID>
                            <AtomCreated>1669200432354</AtomCreated>
                        </Atom>
                    </Metadata>
                    <SystemName kxe="false" kb="ROR">Server-8286-42A-SN21E09EV</SystemName>
                    <MachineTypeModelSerialNumber kxe="false" kb="ROR" schemaVersion="V1_0">
                        <Metadata>
                            <Atom/>
                        </Metadata>
                        <MachineType kxe="false" kb="ROR">8286</MachineType>
                        <Model kb="ROR" kxe="false">42A</Model>
                        <SerialNumber kxe="false" kb="ROR">21E09EV</SerialNumber>
                    </MachineTypeModelSerialNumber>
                    <EnergyMonitoringCapable kxe="false" kb="ROO">true</EnergyMonitoringCapable>
                    <LongTermMonitorEnabled kxe="false" kb="UOD">true</LongTermMonitorEnabled>
                    <AggregationEnabled kxe="false" kb="UOD">true</AggregationEnabled>
                    <ShortTermMonitorEnabled kb="UOD" kxe="false">false</ShortTermMonitorEnabled>
                    <ComputeLTMEnabled ksv="V1_1_0" kb="UOD" kxe="false">false</ComputeLTMEnabled>
                    <EnergyMonitorEnabled kxe="false" kb="UOD">true</EnergyMonitorEnabled>
                    <AssociatedManagedSystem kxe="false" kb="ROO" href="https://129.40.156.64:12443/rest/api/uom/ManagedSystem/801c9574-90e3-3c35-9759-1e25ac9bc03b" rel="related"/>
                </ManagedSystemPcmPreference>
                <ManagedSystemPcmPreference kxe="false" kb="UOD" schemaVersion="V1_0">
                    <Metadata>
                        <Atom>
                            <AtomID>730ca6ff-fced-359f-b96c-c6739be21d95</AtomID>
                            <AtomCreated>1669200432354</AtomCreated>
                        </Atom>
                    </Metadata>
                    <SystemName kxe="false" kb="ROR">Server-9119-MHE-SN21AE987</SystemName>
                    <MachineTypeModelSerialNumber kxe="false" kb="ROR" schemaVersion="V1_0">
                        <Metadata>
                            <Atom/>
                        </Metadata>
                        <MachineType kxe="false" kb="ROR">9119</MachineType>
                        <Model kb="ROR" kxe="false">MHE</Model>
                        <SerialNumber kxe="false" kb="ROR">21AE987</SerialNumber>
                    </MachineTypeModelSerialNumber>
                    <EnergyMonitoringCapable kxe="false" kb="ROO">false</EnergyMonitoringCapable>
                    <LongTermMonitorEnabled kxe="false" kb="UOD">true</LongTermMonitorEnabled>
                    <AggregationEnabled kxe="false" kb="UOD">true</AggregationEnabled>
                    <ShortTermMonitorEnabled kb="UOD" kxe="false">false</ShortTermMonitorEnabled>
                    <ComputeLTMEnabled ksv="V1_1_0" kb="UOD" kxe="false">false</ComputeLTMEnabled>
                    <EnergyMonitorEnabled kxe="false" kb="UOD">false</EnergyMonitorEnabled>
                    <AssociatedManagedSystem kxe="false" kb="ROO" href="https://129.40.156.64:12443/rest/api/uom/ManagedSystem/730ca6ff-fced-359f-b96c-c6739be21d95" rel="related"/>
                </ManagedSystemPcmPreference>
            </ManagementConsolePcmPreference:ManagementConsolePcmPreference>
        </content>
    </entry>
</feed>

Look for the following XML elements, which is the Managed System ID to be used in the following steps as managedSystemsId.

<AtomID>730ca6ff-fced-359f-b96c-c6739be21d95</AtomID>

STEP 3: GET current PCM attributes

Run the following curl command with the copied  X-API-Session ID for each managed systems:

curl -k -i -H "Content-Type: application/xml" -H "X-API-Session: Ivq2wxwdH42qfYLSurUMgkaZZuRrYW4Rr8dN4WWufIT1UIKqZqh1DaR_DsVBnWCQGw6ffgTbEv17UwrUQHsr_XNbBs3WMvSfRK58D4tiYFcPPk-ekP5QCfc7dnMSJ3sJT8fcPCLO_QwxmjhGY-E7YjiW9q764nlg-wtFsVMrjRBBqLvvHfQyh8W1hxSFDSxDxCXFzcGjF-PRt4M6VHXW5_8V6Kmb68gJwnSDbI367C4=" -X GET https://hmcHost:hmcApiPort/rest/api/pcm/ManagedSystem/managedSystemsId/preferences

 

Note: Replace hmcHost, hmcApiPort and managedSystemsId with actuals.

The response is as follows:

HTTP/2 200
date: Tue, 10 May 2022 05:31:35 GMT
server: Server Hardware Management Console PCM
x-content-type-options: nosniff
strict-transport-security: max-age=31536000; includeSubDomains
referrer-policy: no-referrer
x-frame-options: SAMEORIGIN
etag: 1433905062
last-modified: Tue, 10 May 2022 05:31:35 GMT
x-hmc-schema-version: V1_13_0
content-type: application/atom+xml
vary: Accept-Encoding,User-Agent
content-security-policy: default-src https:; script-src https: 'unsafe-inline' 'unsafe-eval'; style-src https: 'unsafe-inline' 'unsafe-eval'; connect-src 'self'
x-xss-protection: 1; mode=block
 
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:ns2="http://a9.com/-/spec/opensearch/1.1/" xmlns:ns3="http://www.w3.org/1999/xhtml">
    <id>2e587e15-e815-39ef-9ec6-22e365dd043f</id>
    <title type="text">Performance and Capacity Monitoring Preferences</title>
    <subtitle type="text"/>
    <link rel="self" href="https://9.3.147.20:12443/rest/api/pcm/ManagedSystem/2e587e15-e815-39ef-9ec6-22e365dd043f/preferences"/>
    <generator uri="IBM Power Systems Management Console" version="1"/>
    <entry>
        <id>302d596c-38d0-4bcf-8bef-de8a85034317</id>
        <updated>2022-05-10T05:31:35.578Z</updated>
        <title type="text">Performance and Capacity Monitoring Preferences</title>
        <published>2022-05-10T05:31:35.578Z</published>
        <author>
            <name>IBM Power Systems Management Console</name>
        </author>
        <content type="application/xml">
            <ManagedSystemPcmPreference:ManagedSystemPcmPreference xmlns:ManagedSystemPcmPreference="http://www.ibm.com/xmlns/systems/power/firmware/pcm/mc/2012_10/" xmlns="http://www.ibm.com/xmlns/systems/power/firmware/pcm/mc/2012_10/" xmlns:ns2="http://www.w3.org/XML/1998/namespace/k2" schemaVersion="V1_0">
    <Metadata>
        <Atom>
            <AtomID>2e587e15-e815-39ef-9ec6-22e365dd043f</AtomID>
            <AtomCreated>1652160695577</AtomCreated>
        </Atom>
    </Metadata>
    <SystemName kb="ROR" kxe="false">BMC-9105-22A_139EF60</SystemName>
    <MachineTypeModelSerialNumber kb="ROR" kxe="false" schemaVersion="V1_0">
        <Metadata>
            <Atom/>
        </Metadata>
        <MachineType kb="ROR" kxe="false">9105</MachineType>
        <Model kxe="false" kb="ROR">22A</Model>
        <SerialNumber kb="ROR" kxe="false">139EF60</SerialNumber>
    </MachineTypeModelSerialNumber>
    <EnergyMonitoringCapable kb="ROO" kxe="false">true</EnergyMonitoringCapable>
    <LongTermMonitorEnabled kxe="false" kb="UOD">false</LongTermMonitorEnabled>
    <AggregationEnabled kb="UOD" kxe="false">false</AggregationEnabled>
    <ShortTermMonitorEnabled kxe="false" kb="UOD">false</ShortTermMonitorEnabled>
    <ComputeLTMEnabled ksv="V1_1_0" kb="UOD" kxe="false">false</ComputeLTMEnabled>
    <EnergyMonitorEnabled kb="UOD" kxe="false">false</EnergyMonitorEnabled>
    <AssociatedManagedSystem kb="ROO" kxe="false" href="https://9.3.147.20:12443/rest/api/uom/ManagedSystem/2e587e15-e815-39ef-9ec6-22e365dd043f" rel="related"/>
</ManagedSystemPcmPreference:ManagedSystemPcmPreference>
        </content>
    </entry>
</feed>

The response shows that the EnergyMonitorEnabled field is set as false. To monitor energy, the field needs to be set to true’. Copy the text similar to the following in a file pcm-enable.xml. See the following example:

<ManagedSystemPcmPreference:ManagedSystemPcmPreference xmlns:ManagedSystemPcmPreference="http://www.ibm.com/xmlns/systems/power/firmware/pcm/mc/2012_10/" xmlns="http://www.ibm.com/xmlns/systems/power/firmware/pcm/mc/2012_10/" xmlns:ns2="http://www.w3.org/XML/1998/namespace/k2" schemaVersion="V1_0">
    <Metadata>
        <Atom>
            <AtomID>2e587e15-e815-39ef-9ec6-22e365dd043f</AtomID>
            <AtomCreated>1652160695577</AtomCreated>
        </Atom>
    </Metadata>
    <SystemName kb="ROR" kxe="false">BMC-9105-22A_139EF60</SystemName>
    <MachineTypeModelSerialNumber kb="ROR" kxe="false" schemaVersion="V1_0">
        <Metadata>
            <Atom/>
        </Metadata>
        <MachineType kb="ROR" kxe="false">9105</MachineType>
        <Model kxe="false" kb="ROR">22A</Model>
        <SerialNumber kb="ROR" kxe="false">139EF60</SerialNumber>
    </MachineTypeModelSerialNumber>
    <EnergyMonitoringCapable kb="ROO" kxe="false">true</EnergyMonitoringCapable>
    <LongTermMonitorEnabled kxe="false" kb="UOD">false</LongTermMonitorEnabled>
    <AggregationEnabled kb="UOD" kxe="false">false</AggregationEnabled>
    <ShortTermMonitorEnabled kxe="false" kb="UOD">false</ShortTermMonitorEnabled>
    <ComputeLTMEnabled ksv="V1_1_0" kb="UOD" kxe="false">false</ComputeLTMEnabled>
    <EnergyMonitorEnabled kb="UOD" kxe="false">false</EnergyMonitorEnabled>
    <AssociatedManagedSystem kb="ROO" kxe="false" href="https://9.3.147.20:12443/rest/api/uom/ManagedSystem/2e587e15-e815-39ef-9ec6-22e365dd043f" rel="related"/>
</ManagedSystemPcmPreference:ManagedSystemPcmPreference>

Then, change following fields to true’ in the pcm-enable.xml file.

<EnergyMonitoringCapable kb="ROO" kxe="false">true</EnergyMonitoringCapable>
<LongTermMonitorEnabled kxe="false" kb="UOD">true</LongTermMonitorEnabled>
<AggregationEnabled kb="UOD" kxe="false">true</AggregationEnabled>
<ShortTermMonitorEnabled kxe="false" kb="UOD">false</ShortTermMonitorEnabled>
<ComputeLTMEnabled ksv="V1_1_0" kb="UOD" kxe="false">false</ComputeLTMEnabled>
<EnergyMonitorEnabled kb="UOD" kxe="false">true</EnergyMonitorEnabled>

The pcm-enable.xml file is the input for the next step.

 

STEP 4: Change PCM attributes

Run the following curl command with the copied  X-API-Session ID and the pcm-enable.xml file for each managed systems:

$ curl -k -i -H "Content-Type: application/xml" -H "X-API-Session: Ivq2wxwdH42qfYLSurUMgkaZZuRrYW4Rr8dN4WWufIT1UIKqZqh1DaR_DsVBnWCQGw6ffgTbEv17UwrUQHsr_XNbBs3WMvSfRK58D4tiYFcPPk-ekP5QCfc7dnMSJ3sJT8fcPCLO_QwxmjhGY-E7YjiW9q764nlg-wtFsVMrjRBBqLvvHfQyh8W1hxSFDSxDxCXFzcGjF-PRt4M6VHXW5_8V6Kmb68gJwnSDbI367C4=" -X POST -d @pcm-enable.xml https://hmcHost:hmcApiPort/rest/api/pcm/ManagedSystem/managedSystemsId/preferences

Note: Replace hmcHost, hmcApiPort and managedSystemsId with actuals.

The response is as follows:

The HTTP status code 200 in the response indicates successful 
execution of the request.

Response body
The response is XML document. The response returns the updated 
status of the performance monitoring for the managed system.
Upon successful execution of the request the HMC returns 
updated PCM preference setting for the managed system.

 STEP 5: Enable IPMI port (For Power v9 and Denali P10 - FSP systems)

If you want to monitor energy consumption for Power v9 and Denali P10 (FSP based) systems, you must enable IPMI port.

On ASMI interface, go to System Configuration > Security > External Services Management > IPMI, and enable IPMI as follows:

Figure 1.0

STEP 6

To connect to PowerHMC and retrieve required metrics, a few more required permissions other than energy consumption for Instana sensor are needed.

To enable data collection for systems that you want to monitor with Instana, follow these steps:

  1. Open the HMC console.

  2. Go to the Systems tab from the navigation bar.

  3. Click the host systems that you want to monitor by using Instana, go to the Performance tab, and click Turn on/off performance data collection.

  4. Enable performance collection by switching the green toggle to on, and click Ok.

  5. Set the sampling rate by clicking Performance > Change sampling rate of utilization data, and set to the desired rate. You are suggested to use 5 minutes as the sampling rate.

Ready to use Instana sensor to collect energy-related metrics? Follow this blog to start!

If you want to find more about the benefits of using PowerHMC Instana Sensor, refer to the Instana documentation. For troubleshooting, refer to this blog.


#IBMPower
0 comments
115 views

Permalink