Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

omdb support for showing devices visible to MGS #4162

Merged
merged 8 commits into from
Oct 6, 2023
Merged

Conversation

davepacheco
Copy link
Collaborator

This change adds:

  • omicron-dev support for running MGS with a simulated SP
  • omdb support for querying MGS to see what devices are visible to it

I'm honestly not sure how generally useful this is but it's been helpful for me learning the MGS API and it may be useful if we ever find MGS to be reporting surprising data.

(There is also gateway-cli, which is capable of a lot more than this tool is. I found it's output a little too hard to read for helping me grok what was in these APIs.)

For reference, here's the output on "london" (a more realistic system than what's in the test suite output, which is simulated):

BRM42220034 # zlogin oxz_switch
[Connected to zone 'oxz_switch' pts/6]
Last login: Mon Jan 26 07:57:19 on pts/6
The illumos Project     stlouis-0-gf51bb1db50   Aug. 30, 2023
illumos development build: nils 2023-Aug-30 [illumos]
root@oxz_switch:~# OMDB_MGS_URL=http://[::1]:12225 /var/tmp/dap-omdb mgs inventory
note: using MGS URL http://[::1]:12225
ALL CONFIGURED SPs

    TYPE   SLOT 
    Power  0    
    Sled   0    
    Sled   1    
    Sled   2    
    Sled   3    
    Sled   4    
    Sled   5    
    Sled   6    
    Sled   7    
    Sled   8    
    Sled   9    
    Sled   10   
    Sled   11   
    Sled   12   
    Sled   13   
    Sled   14   
    Sled   15   
    Sled   16   
    Sled   17   
    Sled   18   
    Sled   19   
    Sled   20   
    Sled   21   
    Sled   22   
    Sled   23   
    Sled   24   
    Sled   25   
    Sled   26   
    Sled   27   
    Sled   28   
    Sled   29   
    Sled   30   
    Sled   31   
    Switch 0    
    Switch 1    

SPs FOUND THROUGH IGNITION

    TYPE   SLOT SYSTEM_TYPE 
    Power  0    -           
    Sled   0    -           
    Sled   1    -           
    Sled   2    -           
    Sled   3    -           
    Sled   4    -           
    Sled   5    -           
    Sled   6    -           
    Sled   7    -           
    Sled   8    -           
    Sled   9    -           
    Sled   10   -           
    Sled   11   Gimlet      
    Sled   12   Gimlet      
    Sled   13   Gimlet      
    Sled   14   Gimlet      
    Sled   15   -           
    Sled   16   -           
    Sled   17   -           
    Sled   18   -           
    Sled   19   -           
    Sled   20   -           
    Sled   21   -           
    Sled   22   -           
    Sled   23   -           
    Sled   24   -           
    Sled   25   -           
    Sled   26   -           
    Sled   27   -           
    Sled   28   -           
    Sled   29   -           
    Sled   30   -           
    Sled   31   -           
    Switch 1    -           

SERVICE PROCESSOR STATES

    TYPE SLOT MODEL       SERIAL      REV HUBRIS           PWR ROT_ACTIVE 
    Sled 11   913-0000019 BRM42220049 6   4a6db7d8a103107e A0  slot A     
    Sled 12   913-0000019 BRM42220036 6   4a6db7d8a103107e A0  slot A     
    Sled 13   913-0000019 BRM42220058 6   4a6db7d8a103107e A0  slot A     
    Sled 14   913-0000019 BRM42220034 6   4a6db7d8a103107e A0  slot B     

SP DETAILS: type "Sled" slot 11

    ROOT OF TRUST

        NAME                               VALUE                                                            
        active slot                        slot A                                                           
        persistent boot preference         slot B                                                           
        pending persistent boot preference -                                                                
        transient boot preference          -                                                                
        slot A SHA3 256 digest             4599e4d7bc9b2164e8c0f0f7ce4bcae2bd35d635c8450854ea9a94ce49a2ca0f 
        slot B SHA3 256 digest             f7ffa279fe019f480d95c58c4a01764809bb952b1a07e00a81196007494cf0aa 

    COMPONENTS

        NAME            DESCRIPTION                         DEVICE          PRESENCE    SERIAL 
        sp              Service Processor                   sp              Present     None   
        sp3-host-cpu    Gimlet SP3 host cpu                 sp3-host-cpu    Present     None   
        host-boot-flash Gimlet host boot flash              host-boot-flash Present     None   
        system-led      System attention LED                system-led      Present     None   
        dev-0           Southwest temperature sensor        tmp117          Present     None   
        dev-1           South temperature sensor            tmp117          Present     None   
        dev-2           Southeast temperature sensor        tmp117          Present     None   
        dev-3           U.2 ABCD mux                        pca9545         Present     None   
        dev-4           U.2 EFGH mux                        pca9545         Present     None   
        dev-5           U.2 IJ/FRUID mux                    pca9545         Present     None   
        dev-6           U.2 Sharkfin A VPD                  at24csw080      Present     None   
        dev-7           U.2 Sharkfin A hot swap controller  max5970         Present     None   
        dev-8           U.2 A NVMe Basic Management Command nvme_bmc        Present     None   
        dev-9           U.2 Sharkfin B VPD                  at24csw080      Present     None   
        dev-10          U.2 Sharkfin B hot swap controller  max5970         Present     None   
        dev-11          U.2 B NVMe Basic Management Control nvme_bmc        Present     None   
        dev-12          U.2 Sharkfin C VPD                  at24csw080      Present     None   
        dev-13          U.2 Sharkfin C hot swap controller  max5970         Present     None   
        dev-14          U.2 C NVMe Basic Management Control nvme_bmc        Present     None   
        dev-15          U.2 Sharkfin D VPD                  at24csw080      Present     None   
        dev-16          U.2 Sharkfin D hot swap controller  max5970         Present     None   
        dev-17          U.2 D NVMe Basic Management Control nvme_bmc        Present     None   
        dev-18          U.2 Sharkfin E VPD                  at24csw080      Present     None   
        dev-19          U.2 Sharkfin E hot swap controller  max5970         Present     None   
        dev-20          U.2 E NVMe Basic Management Control nvme_bmc        Present     None   
        dev-21          U.2 Sharkfin F VPD                  at24csw080      Present     None   
        dev-22          U.2 Sharkfin F hot swap controller  max5970         Present     None   
        dev-23          U.2 F NVMe Basic Management Control nvme_bmc        Present     None   
        dev-24          U.2 Sharkfin G VPD                  at24csw080      Present     None   
        dev-25          U.2 Sharkfin G hot swap controller  max5970         Present     None   
        dev-26          U.2 G NVMe Basic Management Control nvme_bmc        Present     None   
        dev-27          U.2 Sharkfin H VPD                  at24csw080      Present     None   
        dev-28          U.2 Sharkfin H hot swap controller  max5970         Present     None   
        dev-29          U.2 H NVMe Basic Management Control nvme_bmc        Present     None   
        dev-30          U.2 Sharkfin I VPD                  at24csw080      Present     None   
        dev-31          U.2 Sharkfin I hot swap controller  max5970         Present     None   
        dev-32          U.2 I NVMe Basic Management Control nvme_bmc        Present     None   
        dev-33          U.2 Sharkfin J VPD                  at24csw080      Present     None   
        dev-34          U.2 Sharkfin J hot swap controller  max5970         Present     None   
        dev-35          U.2 J NVMe Basic Management Control nvme_bmc        Present     None   
        dev-36          Gimlet VPD                          at24csw080      Present     None   
        dev-37          M.2 mux                             pca9545         Present     None   
        dev-38          M.2 A NVMe Basic Management Command m2_hp_only      Unavailable None   
        dev-39          M.2 B NVMe Basic Management Command m2_hp_only      Unavailable None   
        dev-40          Fan VPD                             at24csw080      Present     None   
        dev-41          T6 temperature sensor               tmp451          Present     None   
        dev-42          A2 3.3V rail                        tps546b24a      Present     None   
        dev-43          A0 3.3V rail                        tps546b24a      Present     None   
        dev-44          A2 5V rail                          tps546b24a      Present     None   
        dev-45          A2 1.8V rail                        tps546b24a      Present     None   
        dev-46          M.2 hot plug controller             max5970         Present     None   
        dev-47          CPU via SB-RMI                      sbrmi           Present     None   
        dev-48          CPU temperature sensor              sbtsi           Present     None   
        dev-49          Clock generator                     idt8a34003      Present     None   
        dev-50          CPU power controller                raa229618       Present     None   
        dev-51          SoC power controller                raa229618       Present     None   
        dev-52          DIMM/SP3 1.8V A0 power controller   isl68224        Present     None   
        dev-53          Fan hot swap controller             adm1272         Present     None   
        dev-54          Sled hot swap controller            adm1272         Present     None   
        dev-55          Fan controller                      max31790        Present     None   
        dev-56          T6 power controller                 tps546b24a      Present     None   
        dev-57          Northeast temperature sensor        tmp117          Present     None   
        dev-58          North temperature sensor            tmp117          Present     None   
        dev-59          Northwest temperature sensor        tmp117          Present     None   
        dev-60          Intermediate bus converter          bmr491          Present     None   
        dev-61          DIMM A0                             tse2004av       Present     None   
        dev-62          DIMM A1                             tse2004av       Present     None   
        dev-63          DIMM B0                             tse2004av       Present     None   
        dev-64          DIMM B1                             tse2004av       Present     None   
        dev-65          DIMM C0                             tse2004av       Present     None   
        dev-66          DIMM C1                             tse2004av       Present     None   
        dev-67          DIMM D0                             tse2004av       Present     None   
        dev-68          DIMM D1                             tse2004av       Present     None   
        dev-69          DIMM E0                             tse2004av       Present     None   
        dev-70          DIMM E1                             tse2004av       Present     None   
        dev-71          DIMM F0                             tse2004av       Present     None   
        dev-72          DIMM F1                             tse2004av       Present     None   
        dev-73          DIMM G0                             tse2004av       Present     None   
        dev-74          DIMM G1                             tse2004av       Present     None   
        dev-75          DIMM H0                             tse2004av       Present     None   
        dev-76          DIMM H1                             tse2004av       Present     None   

warn: get caboose for sp type Sled sp slot 11 component "host-boot-flash" slot 0: Error Response: status: 400 Bad Request; headers: {"content-type": "application/json", "x-request-id": "f2d9a2c7-0427-4191-890c-4120b050c06b", "content-length": "329", "date": "Mon, 26 Jan 1987 08:02:24 GMT"}; value: Error { error_code: Some("RequestUnsupportedForComponent"), message: "error communicating with SP: Error response from SP: unsupported request for this SP component: Error response from SP: unsupported request for this SP component: unsupported request for this SP component", request_id: "f2d9a2c7-0427-4191-890c-4120b050c06b" }
    COMPONENT CABOOSES

        COMPONENT BOARD    GIT_COMMIT                               NAME     VERSION   
        sp        gimlet-c a096c4c17b17772c72dbfb03e0b9c96e59d9a0fe gimlet-c 0.0.0-git 

SP DETAILS: type "Sled" slot 12

    ROOT OF TRUST

        NAME                               VALUE                                                            
        active slot                        slot A                                                           
        persistent boot preference         slot B                                                           
        pending persistent boot preference -                                                                
        transient boot preference          -                                                                
        slot A SHA3 256 digest             4599e4d7bc9b2164e8c0f0f7ce4bcae2bd35d635c8450854ea9a94ce49a2ca0f 
        slot B SHA3 256 digest             f7ffa279fe019f480d95c58c4a01764809bb952b1a07e00a81196007494cf0aa 

    COMPONENTS

        NAME            DESCRIPTION                         DEVICE          PRESENCE    SERIAL 
        sp              Service Processor                   sp              Present     None   
        sp3-host-cpu    Gimlet SP3 host cpu                 sp3-host-cpu    Present     None   
        host-boot-flash Gimlet host boot flash              host-boot-flash Present     None   
        system-led      System attention LED                system-led      Present     None   
        dev-0           Southwest temperature sensor        tmp117          Present     None   
        dev-1           South temperature sensor            tmp117          Present     None   
        dev-2           Southeast temperature sensor        tmp117          Present     None   
        dev-3           U.2 ABCD mux                        pca9545         Present     None   
        dev-4           U.2 EFGH mux                        pca9545         Present     None   
        dev-5           U.2 IJ/FRUID mux                    pca9545         Present     None   
        dev-6           U.2 Sharkfin A VPD                  at24csw080      Present     None   
        dev-7           U.2 Sharkfin A hot swap controller  max5970         Present     None   
        dev-8           U.2 A NVMe Basic Management Command nvme_bmc        Present     None   
        dev-9           U.2 Sharkfin B VPD                  at24csw080      Present     None   
        dev-10          U.2 Sharkfin B hot swap controller  max5970         Present     None   
        dev-11          U.2 B NVMe Basic Management Control nvme_bmc        Present     None   
        dev-12          U.2 Sharkfin C VPD                  at24csw080      Present     None   
        dev-13          U.2 Sharkfin C hot swap controller  max5970         Present     None   
        dev-14          U.2 C NVMe Basic Management Control nvme_bmc        Present     None   
        dev-15          U.2 Sharkfin D VPD                  at24csw080      Present     None   
        dev-16          U.2 Sharkfin D hot swap controller  max5970         Present     None   
        dev-17          U.2 D NVMe Basic Management Control nvme_bmc        Present     None   
        dev-18          U.2 Sharkfin E VPD                  at24csw080      Present     None   
        dev-19          U.2 Sharkfin E hot swap controller  max5970         Present     None   
        dev-20          U.2 E NVMe Basic Management Control nvme_bmc        Present     None   
        dev-21          U.2 Sharkfin F VPD                  at24csw080      Present     None   
        dev-22          U.2 Sharkfin F hot swap controller  max5970         Present     None   
        dev-23          U.2 F NVMe Basic Management Control nvme_bmc        Present     None   
        dev-24          U.2 Sharkfin G VPD                  at24csw080      Present     None   
        dev-25          U.2 Sharkfin G hot swap controller  max5970         Present     None   
        dev-26          U.2 G NVMe Basic Management Control nvme_bmc        Present     None   
        dev-27          U.2 Sharkfin H VPD                  at24csw080      Present     None   
        dev-28          U.2 Sharkfin H hot swap controller  max5970         Present     None   
        dev-29          U.2 H NVMe Basic Management Control nvme_bmc        Present     None   
        dev-30          U.2 Sharkfin I VPD                  at24csw080      Present     None   
        dev-31          U.2 Sharkfin I hot swap controller  max5970         Present     None   
        dev-32          U.2 I NVMe Basic Management Control nvme_bmc        Present     None   
        dev-33          U.2 Sharkfin J VPD                  at24csw080      Present     None   
        dev-34          U.2 Sharkfin J hot swap controller  max5970         Present     None   
        dev-35          U.2 J NVMe Basic Management Control nvme_bmc        Present     None   
        dev-36          Gimlet VPD                          at24csw080      Present     None   
        dev-37          M.2 mux                             pca9545         Present     None   
        dev-38          M.2 A NVMe Basic Management Command m2_hp_only      Unavailable None   
        dev-39          M.2 B NVMe Basic Management Command m2_hp_only      Unavailable None   
        dev-40          Fan VPD                             at24csw080      Present     None   
        dev-41          T6 temperature sensor               tmp451          Present     None   
        dev-42          A2 3.3V rail                        tps546b24a      Present     None   
        dev-43          A0 3.3V rail                        tps546b24a      Present     None   
        dev-44          A2 5V rail                          tps546b24a      Present     None   
        dev-45          A2 1.8V rail                        tps546b24a      Present     None   
        dev-46          M.2 hot plug controller             max5970         Present     None   
        dev-47          CPU via SB-RMI                      sbrmi           Present     None   
        dev-48          CPU temperature sensor              sbtsi           Present     None   
        dev-49          Clock generator                     idt8a34003      Present     None   
        dev-50          CPU power controller                raa229618       Present     None   
        dev-51          SoC power controller                raa229618       Present     None   
        dev-52          DIMM/SP3 1.8V A0 power controller   isl68224        Present     None   
        dev-53          Fan hot swap controller             adm1272         Present     None   
        dev-54          Sled hot swap controller            adm1272         Present     None   
        dev-55          Fan controller                      max31790        Present     None   
        dev-56          T6 power controller                 tps546b24a      Present     None   
        dev-57          Northeast temperature sensor        tmp117          Present     None   
        dev-58          North temperature sensor            tmp117          Present     None   
        dev-59          Northwest temperature sensor        tmp117          Present     None   
        dev-60          Intermediate bus converter          bmr491          Present     None   
        dev-61          DIMM A0                             tse2004av       Present     None   
        dev-62          DIMM A1                             tse2004av       Present     None   
        dev-63          DIMM B0                             tse2004av       Present     None   
        dev-64          DIMM B1                             tse2004av       Present     None   
        dev-65          DIMM C0                             tse2004av       Present     None   
        dev-66          DIMM C1                             tse2004av       Present     None   
        dev-67          DIMM D0                             tse2004av       Present     None   
        dev-68          DIMM D1                             tse2004av       Present     None   
        dev-69          DIMM E0                             tse2004av       Present     None   
        dev-70          DIMM E1                             tse2004av       Present     None   
        dev-71          DIMM F0                             tse2004av       Present     None   
        dev-72          DIMM F1                             tse2004av       Present     None   
        dev-73          DIMM G0                             tse2004av       Present     None   
        dev-74          DIMM G1                             tse2004av       Present     None   
        dev-75          DIMM H0                             tse2004av       Present     None   
        dev-76          DIMM H1                             tse2004av       Present     None   

warn: get caboose for sp type Sled sp slot 12 component "host-boot-flash" slot 0: Error Response: status: 400 Bad Request; headers: {"content-type": "application/json", "x-request-id": "748775fd-cd61-4f84-af2f-50289d1a7208", "content-length": "329", "date": "Mon, 26 Jan 1987 08:02:24 GMT"}; value: Error { error_code: Some("RequestUnsupportedForComponent"), message: "error communicating with SP: Error response from SP: unsupported request for this SP component: Error response from SP: unsupported request for this SP component: unsupported request for this SP component", request_id: "748775fd-cd61-4f84-af2f-50289d1a7208" }
    COMPONENT CABOOSES

        COMPONENT BOARD    GIT_COMMIT                               NAME     VERSION   
        sp        gimlet-c a096c4c17b17772c72dbfb03e0b9c96e59d9a0fe gimlet-c 0.0.0-git 

SP DETAILS: type "Sled" slot 13

    ROOT OF TRUST

        NAME                               VALUE                                                            
        active slot                        slot A                                                           
        persistent boot preference         slot A                                                           
        pending persistent boot preference -                                                                
        transient boot preference          -                                                                
        slot A SHA3 256 digest             7fb7ed6df1012250a91354cc68757894dde9ac4af13321e1d517706590a675ca 
        slot B SHA3 256 digest             f7ffa279fe019f480d95c58c4a01764809bb952b1a07e00a81196007494cf0aa 

    COMPONENTS

        NAME            DESCRIPTION                         DEVICE          PRESENCE    SERIAL 
        sp              Service Processor                   sp              Present     None   
        sp3-host-cpu    Gimlet SP3 host cpu                 sp3-host-cpu    Present     None   
        host-boot-flash Gimlet host boot flash              host-boot-flash Present     None   
        system-led      System attention LED                system-led      Present     None   
        dev-0           Southwest temperature sensor        tmp117          Present     None   
        dev-1           South temperature sensor            tmp117          Present     None   
        dev-2           Southeast temperature sensor        tmp117          Present     None   
        dev-3           U.2 ABCD mux                        pca9545         Present     None   
        dev-4           U.2 EFGH mux                        pca9545         Present     None   
        dev-5           U.2 IJ/FRUID mux                    pca9545         Present     None   
        dev-6           U.2 Sharkfin A VPD                  at24csw080      Present     None   
        dev-7           U.2 Sharkfin A hot swap controller  max5970         Present     None   
        dev-8           U.2 A NVMe Basic Management Command nvme_bmc        Present     None   
        dev-9           U.2 Sharkfin B VPD                  at24csw080      Present     None   
        dev-10          U.2 Sharkfin B hot swap controller  max5970         Present     None   
        dev-11          U.2 B NVMe Basic Management Control nvme_bmc        Present     None   
        dev-12          U.2 Sharkfin C VPD                  at24csw080      Present     None   
        dev-13          U.2 Sharkfin C hot swap controller  max5970         Present     None   
        dev-14          U.2 C NVMe Basic Management Control nvme_bmc        Present     None   
        dev-15          U.2 Sharkfin D VPD                  at24csw080      Present     None   
        dev-16          U.2 Sharkfin D hot swap controller  max5970         Present     None   
        dev-17          U.2 D NVMe Basic Management Control nvme_bmc        NotPresent  None   
        dev-18          U.2 Sharkfin E VPD                  at24csw080      Present     None   
        dev-19          U.2 Sharkfin E hot swap controller  max5970         Present     None   
        dev-20          U.2 E NVMe Basic Management Control nvme_bmc        Present     None   
        dev-21          U.2 Sharkfin F VPD                  at24csw080      Present     None   
        dev-22          U.2 Sharkfin F hot swap controller  max5970         Present     None   
        dev-23          U.2 F NVMe Basic Management Control nvme_bmc        Present     None   
        dev-24          U.2 Sharkfin G VPD                  at24csw080      Present     None   
        dev-25          U.2 Sharkfin G hot swap controller  max5970         Present     None   
        dev-26          U.2 G NVMe Basic Management Control nvme_bmc        Present     None   
        dev-27          U.2 Sharkfin H VPD                  at24csw080      Present     None   
        dev-28          U.2 Sharkfin H hot swap controller  max5970         Present     None   
        dev-29          U.2 H NVMe Basic Management Control nvme_bmc        Present     None   
        dev-30          U.2 Sharkfin I VPD                  at24csw080      Present     None   
        dev-31          U.2 Sharkfin I hot swap controller  max5970         Present     None   
        dev-32          U.2 I NVMe Basic Management Control nvme_bmc        Present     None   
        dev-33          U.2 Sharkfin J VPD                  at24csw080      Present     None   
        dev-34          U.2 Sharkfin J hot swap controller  max5970         Present     None   
        dev-35          U.2 J NVMe Basic Management Control nvme_bmc        Present     None   
        dev-36          Gimlet VPD                          at24csw080      Present     None   
        dev-37          M.2 mux                             pca9545         Present     None   
        dev-38          M.2 A NVMe Basic Management Command m2_hp_only      Unavailable None   
        dev-39          M.2 B NVMe Basic Management Command m2_hp_only      Unavailable None   
        dev-40          Fan VPD                             at24csw080      Present     None   
        dev-41          T6 temperature sensor               tmp451          Present     None   
        dev-42          A2 3.3V rail                        tps546b24a      Present     None   
        dev-43          A0 3.3V rail                        tps546b24a      Present     None   
        dev-44          A2 5V rail                          tps546b24a      Present     None   
        dev-45          A2 1.8V rail                        tps546b24a      Present     None   
        dev-46          M.2 hot plug controller             max5970         Present     None   
        dev-47          CPU via SB-RMI                      sbrmi           Present     None   
        dev-48          CPU temperature sensor              sbtsi           Present     None   
        dev-49          Clock generator                     idt8a34003      Present     None   
        dev-50          CPU power controller                raa229618       Present     None   
        dev-51          SoC power controller                raa229618       Present     None   
        dev-52          DIMM/SP3 1.8V A0 power controller   isl68224        Present     None   
        dev-53          Fan hot swap controller             adm1272         Present     None   
        dev-54          Sled hot swap controller            adm1272         Present     None   
        dev-55          Fan controller                      max31790        Present     None   
        dev-56          T6 power controller                 tps546b24a      Present     None   
        dev-57          Northeast temperature sensor        tmp117          Present     None   
        dev-58          North temperature sensor            tmp117          Present     None   
        dev-59          Northwest temperature sensor        tmp117          Present     None   
        dev-60          Intermediate bus converter          bmr491          Present     None   
        dev-61          DIMM A0                             tse2004av       Present     None   
        dev-62          DIMM A1                             tse2004av       Present     None   
        dev-63          DIMM B0                             tse2004av       Present     None   
        dev-64          DIMM B1                             tse2004av       Present     None   
        dev-65          DIMM C0                             tse2004av       Present     None   
        dev-66          DIMM C1                             tse2004av       Present     None   
        dev-67          DIMM D0                             tse2004av       Present     None   
        dev-68          DIMM D1                             tse2004av       Present     None   
        dev-69          DIMM E0                             tse2004av       Present     None   
        dev-70          DIMM E1                             tse2004av       Present     None   
        dev-71          DIMM F0                             tse2004av       Present     None   
        dev-72          DIMM F1                             tse2004av       Present     None   
        dev-73          DIMM G0                             tse2004av       Present     None   
        dev-74          DIMM G1                             tse2004av       Present     None   
        dev-75          DIMM H0                             tse2004av       Present     None   
        dev-76          DIMM H1                             tse2004av       Present     None   

warn: get caboose for sp type Sled sp slot 13 component "host-boot-flash" slot 0: Error Response: status: 400 Bad Request; headers: {"content-type": "application/json", "x-request-id": "39089f32-bf3f-41ec-8250-9417f8d3c5d4", "content-length": "329", "date": "Mon, 26 Jan 1987 08:02:24 GMT"}; value: Error { error_code: Some("RequestUnsupportedForComponent"), message: "error communicating with SP: Error response from SP: unsupported request for this SP component: Error response from SP: unsupported request for this SP component: unsupported request for this SP component", request_id: "39089f32-bf3f-41ec-8250-9417f8d3c5d4" }
    COMPONENT CABOOSES

        COMPONENT BOARD    GIT_COMMIT                               NAME     VERSION   
        sp        gimlet-c a096c4c17b17772c72dbfb03e0b9c96e59d9a0fe gimlet-c 0.0.0-git 

SP DETAILS: type "Sled" slot 14

    ROOT OF TRUST

        NAME                               VALUE                                                            
        active slot                        slot B                                                           
        persistent boot preference         slot B                                                           
        pending persistent boot preference -                                                                
        transient boot preference          -                                                                
        slot A SHA3 256 digest             f8985174046920ee94309629cb82b8fb70c64a470da849af3d49c62493f1347e 
        slot B SHA3 256 digest             f7ffa279fe019f480d95c58c4a01764809bb952b1a07e00a81196007494cf0aa 

    COMPONENTS

        NAME            DESCRIPTION                         DEVICE          PRESENCE    SERIAL 
        sp              Service Processor                   sp              Present     None   
        sp3-host-cpu    Gimlet SP3 host cpu                 sp3-host-cpu    Present     None   
        host-boot-flash Gimlet host boot flash              host-boot-flash Present     None   
        system-led      System attention LED                system-led      Present     None   
        dev-0           Southwest temperature sensor        tmp117          Present     None   
        dev-1           South temperature sensor            tmp117          Present     None   
        dev-2           Southeast temperature sensor        tmp117          Present     None   
        dev-3           U.2 ABCD mux                        pca9545         Present     None   
        dev-4           U.2 EFGH mux                        pca9545         Present     None   
        dev-5           U.2 IJ/FRUID mux                    pca9545         Present     None   
        dev-6           U.2 Sharkfin A VPD                  at24csw080      Present     None   
        dev-7           U.2 Sharkfin A hot swap controller  max5970         Present     None   
        dev-8           U.2 A NVMe Basic Management Command nvme_bmc        Present     None   
        dev-9           U.2 Sharkfin B VPD                  at24csw080      Present     None   
        dev-10          U.2 Sharkfin B hot swap controller  max5970         Present     None   
        dev-11          U.2 B NVMe Basic Management Control nvme_bmc        Present     None   
        dev-12          U.2 Sharkfin C VPD                  at24csw080      Present     None   
        dev-13          U.2 Sharkfin C hot swap controller  max5970         Present     None   
        dev-14          U.2 C NVMe Basic Management Control nvme_bmc        Present     None   
        dev-15          U.2 Sharkfin D VPD                  at24csw080      Present     None   
        dev-16          U.2 Sharkfin D hot swap controller  max5970         Present     None   
        dev-17          U.2 D NVMe Basic Management Control nvme_bmc        Present     None   
        dev-18          U.2 Sharkfin E VPD                  at24csw080      Present     None   
        dev-19          U.2 Sharkfin E hot swap controller  max5970         Present     None   
        dev-20          U.2 E NVMe Basic Management Control nvme_bmc        Present     None   
        dev-21          U.2 Sharkfin F VPD                  at24csw080      Present     None   
        dev-22          U.2 Sharkfin F hot swap controller  max5970         Present     None   
        dev-23          U.2 F NVMe Basic Management Control nvme_bmc        Present     None   
        dev-24          U.2 Sharkfin G VPD                  at24csw080      Present     None   
        dev-25          U.2 Sharkfin G hot swap controller  max5970         Present     None   
        dev-26          U.2 G NVMe Basic Management Control nvme_bmc        Present     None   
        dev-27          U.2 Sharkfin H VPD                  at24csw080      Present     None   
        dev-28          U.2 Sharkfin H hot swap controller  max5970         Present     None   
        dev-29          U.2 H NVMe Basic Management Control nvme_bmc        Present     None   
        dev-30          U.2 Sharkfin I VPD                  at24csw080      Present     None   
        dev-31          U.2 Sharkfin I hot swap controller  max5970         Present     None   
        dev-32          U.2 I NVMe Basic Management Control nvme_bmc        Present     None   
        dev-33          U.2 Sharkfin J VPD                  at24csw080      Present     None   
        dev-34          U.2 Sharkfin J hot swap controller  max5970         Present     None   
        dev-35          U.2 J NVMe Basic Management Control nvme_bmc        NotPresent  None   
        dev-36          Gimlet VPD                          at24csw080      Present     None   
        dev-37          M.2 mux                             pca9545         Present     None   
        dev-38          M.2 A NVMe Basic Management Command m2_hp_only      Unavailable None   
        dev-39          M.2 B NVMe Basic Management Command m2_hp_only      Unavailable None   
        dev-40          Fan VPD                             at24csw080      Present     None   
        dev-41          T6 temperature sensor               tmp451          Present     None   
        dev-42          A2 3.3V rail                        tps546b24a      Present     None   
        dev-43          A0 3.3V rail                        tps546b24a      Present     None   
        dev-44          A2 5V rail                          tps546b24a      Present     None   
        dev-45          A2 1.8V rail                        tps546b24a      Present     None   
        dev-46          M.2 hot plug controller             max5970         Present     None   
        dev-47          CPU via SB-RMI                      sbrmi           Present     None   
        dev-48          CPU temperature sensor              sbtsi           Present     None   
        dev-49          Clock generator                     idt8a34003      Present     None   
        dev-50          CPU power controller                raa229618       Present     None   
        dev-51          SoC power controller                raa229618       Present     None   
        dev-52          DIMM/SP3 1.8V A0 power controller   isl68224        Present     None   
        dev-53          Fan hot swap controller             adm1272         Present     None   
        dev-54          Sled hot swap controller            adm1272         Present     None   
        dev-55          Fan controller                      max31790        Present     None   
        dev-56          T6 power controller                 tps546b24a      Present     None   
        dev-57          Northeast temperature sensor        tmp117          Present     None   
        dev-58          North temperature sensor            tmp117          Present     None   
        dev-59          Northwest temperature sensor        tmp117          Present     None   
        dev-60          Intermediate bus converter          bmr491          Present     None   
        dev-61          DIMM A0                             tse2004av       Present     None   
        dev-62          DIMM A1                             tse2004av       Present     None   
        dev-63          DIMM B0                             tse2004av       Present     None   
        dev-64          DIMM B1                             tse2004av       Present     None   
        dev-65          DIMM C0                             tse2004av       Present     None   
        dev-66          DIMM C1                             tse2004av       Present     None   
        dev-67          DIMM D0                             tse2004av       Present     None   
        dev-68          DIMM D1                             tse2004av       Present     None   
        dev-69          DIMM E0                             tse2004av       Present     None   
        dev-70          DIMM E1                             tse2004av       Present     None   
        dev-71          DIMM F0                             tse2004av       Present     None   
        dev-72          DIMM F1                             tse2004av       Present     None   
        dev-73          DIMM G0                             tse2004av       Present     None   
        dev-74          DIMM G1                             tse2004av       Present     None   
        dev-75          DIMM H0                             tse2004av       Present     None   
        dev-76          DIMM H1                             tse2004av       Present     None   

warn: get caboose for sp type Sled sp slot 14 component "host-boot-flash" slot 0: Error Response: status: 400 Bad Request; headers: {"content-type": "application/json", "x-request-id": "e58f7da3-aeb8-4a04-a17c-081908973034", "content-length": "329", "date": "Mon, 26 Jan 1987 08:02:24 GMT"}; value: Error { error_code: Some("RequestUnsupportedForComponent"), message: "error communicating with SP: Error response from SP: unsupported request for this SP component: Error response from SP: unsupported request for this SP component: unsupported request for this SP component", request_id: "e58f7da3-aeb8-4a04-a17c-081908973034" }
    COMPONENT CABOOSES

        COMPONENT BOARD    GIT_COMMIT                               NAME     VERSION   
        sp        gimlet-c a096c4c17b17772c72dbfb03e0b9c96e59d9a0fe gimlet-c 0.0.0-git 

root@oxz_switch:~#

Copy link
Contributor

@jgallagher jgallagher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Just some small nitpicks.

let c = &mgs_client;
let mut sp_infos =
futures::stream::iter(sp_list_ignition.iter().filter_map(|ignition| {
if matches!(ignition.details, SpIgnition::Yes { .. }) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little unsure about using ignition as a filter on which SPs to ask for state, because at least in theory, a problem with ignition could result in ignition claiming there's nothing there but we could still talk to an SP over the management network. Similarly, ignition is fetched from MGS's local sidecar SP; if something is wrong with it, we might get no data back (at which point we'd bail out above anyway, which might or might not be reasonable).

Maybe we could run sp_get on all configured SPs, and ignore any errors for SPs where ignition also claims the SP is not present? This is also not super critical if you want to punt on it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I did this was that when I didn't, it took like a minute or two for the command to complete. I think we wound up waiting for a lot of timeouts? I can see that being a useful option when things are broken but for the common case where everything's healthy and some slots are just unpopulated I thought it should finish faster. (I will double check this behavior in case that's unexpected and there was something else weird going on.)

Copy link
Contributor

@jgallagher jgallagher Oct 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, yeah, that does sound right. I don't think it should've taken a minute or two, but I would definitely believe a few 10s of seconds. A single request to a missing SP should result in roughly 10 seconds to timeout based on our current config:

# When sending UDP RPC packets to an SP, how many total attempts do we make
# before giving up?
rpc_max_attempts = 5
# sleep time between UDP RPC resends (up to `rpc_max_attempts`)
rpc_per_attempt_timeout_millis = 2000

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed on london just now that it took 7s for MGS to respond to a request for an SP's state when that SP is not present. I think that's not worth trying for the common case so I'd like to punt for now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me 👍

let msg = format!("fetching info about SP {:?}", sp_id);
c.sp_get(sp_id.type_, sp_id.slot)
.await
.context(msg)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiny nit - as written, we always allocate msg but then immediately free it if the request succeeds. Could we use

Suggested change
.context(msg)
.with_context(|| format!("..."))

instead, or do we run into problems copying/cloning sp_id? (That seems like it should be Copy, I think?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. (This was a remnant of an earlier version where the same message was used in multiple places.)

}

/// Comparator for service processor identifiers
fn sp_id_cmp(&s1: &SpIdentifier, s2: &SpIdentifier) -> Ordering {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we derive PartialCmp, Cmp for SpIdentifier instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do.

Ok(())
}

fn sp_type_to_str(s: &SpType) -> &'static str {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine, but stylistically I probably would've written this as an extension trait to make the call sites nicer:

trait SpTypeExt {
    fn as_str(&self) -> &'static str;
}

impl SpTypeExt for SpType { .. }

.with_context(|| {
format!(
"get caboose for sp type {:?} sp slot {} \
component {:?} slot {}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiny nit - some extra whitespace here, probably from cargo fmt not realigning \-broken strings

}

const COMPONENTS_WITH_CABOOSES: &'static [&'static str] =
&["sp", "rot", "host-boot-flash"];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

host-boot-flash does not have a caboose; that's a hubris image thing. Maybe we could shove a caboose (or something with similar information) into the host phase 1 images? Not sure what that would look like.

@davepacheco davepacheco enabled auto-merge (squash) October 5, 2023 17:46
@davepacheco davepacheco merged commit 230637a into main Oct 6, 2023
@davepacheco davepacheco deleted the dap/inventory-play branch October 6, 2023 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants