Giter Site home page Giter Site logo

cray-hpe / gru Goto Github PK

View Code? Open in Web Editor NEW
5.0 15.0 2.0 4.77 MB

A utility for reading and modifying BMCs (e.g. iLO, RMMC) using RedFish (gofish).

License: MIT License

Makefile 5.08% Go 57.67% Shell 37.24%
bmc go golang redfish gofish hacktoberfest

gru's Introduction

Go Redfish Utility (gru)

Table of Contents

badge badge

An asynchronous RedFish utility for interrogating and managing blade management controllers.

Usage

gru help
Setting Credentials
  • Environment Variables

    export USERNAME=admin
    export PASSWORD=password
    gru show system myserver-bmc.local
  • Configuration File

    ---
    username: admin
    password: password
  • Configuration file with a general username/password and exceptions (for server10 use a different username and password)

    ---
    username: admin
    password: password
    hosts:
      server10:
          username: root
          password: password
Querying Servers
  • Pass any number of hosts, delimited by spaces.

    gru show system myserver-bmc.local myotherserver-bmc.local
  • Piping a list a space delimited list of hosts.

    grep -oP pattern /etc/hosts | tr -s '\n' ' ' | gru show system

Development

make gru
./gru

gru's People

Contributors

dependabot[bot] avatar jacobsalmela avatar rustydb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

bitfisher

gru's Issues

`gru bios set --clear-cmos` does not work on intel

SUMMARY

Potentially related to stmcginnis/gofish#268 (fixed in gofish 0.15.0)

ISSUE TYPE
  • Bug Report
STEPS TO REPRODUCE
  1. Run gru bios set --clear-cmos
  2. Cold boot the node
EXPECTED RESULTS

BIOS is cleared.

ACTUAL RESULTS

BIOS remains the same, error is observed:

unable to execute request, no target provided

Printing BIOS Attributes is unsorted

SUMMARY

get bios (a.k.a. bios get) is not sorted, making it difficult to read.

ISSUE TYPE
  • Bug Report
STEPS TO REPRODUCE
  1. gru bios get <node>
EXPECTED RESULTS

Output is sorted.

ACTUAL RESULTS

Output is only sorted for --json.

./gru --insecure bios get redbull-ncn-m001-mgmt.hpc.amslabs.hpecorp.net
Asynchronously querying [    1] hosts ... 
redbull-ncn-m001-mgmt.hpc.amslabs.hpecorp.net:
        CbRelaxedOrdering                       : 0                                                           
        PcieOpROMCtrl_4                         : 1                                                           
        PcieOpROMCtrl_9                         : 1                                                           
        NtbSBar01Prefetch_0                     : 0                                                           
        ProcessorSmxEnable                      : 0                                                           
        RdtCatOpportunisticTuning               : 0                                                           
        PciePortLinkSpeed_S_66                  : 3                                                           
        PciePortLinkSpeed_S_65                  : 3                                                           
        PciePortDisable_37                      : 2                                                           
        UFSDisable                              : 0                                                           
        VmdEnable_2                             : 0                 
// Truncated ...

`gru chassis boot <something> --now` does not work if the node is off

SUMMARY

If a node is off, the --now flag for boot does not work.
The flag does work if a node is already on, the flag triggers a reset as expected.

ISSUE TYPE
  • Bug Report
STEPS TO REPRODUCE
  1. Power off a node
  2. Run gru chassis boot bios --now <node>
  3. Node remains off
EXPECTED RESULTS

Node should power up.

ACTUAL RESULTS

Node remains off.

Invalid command order `bios get` vs `get bios` and duplicate code

SUMMARY

During the development of #18 , the app definition had an amendment to make development of the bios command easier.

Currently pkg.cli.bios.get and pkg.cli.bios.set have duplicate code, the original get bios and set bios structure of the CLi made implementing non-duplicate code difficult.

The new format, bios get and bios set allow the duplicate code to inherently get slurped/consolidated into bios.go.

Switching to the new command line syntax will clean up the duplicate code.

ISSUE TYPE
  • Bug Report
STEPS TO REPRODUCE
EXPECTED RESULTS
  • gru bios get
  • gru bios set
ACTUAL RESULTS
  • gru get bios
  • gru set bios

`gru --json chassis boot <something> --now` does not return a valid JSON object

SUMMARY
ISSUE TYPE
  • Bug Report
STEPS TO REPRODUCE
  1. Run gru --json chassis boot <something> --now
EXPECTED RESULTS

Printed value should be a parseable JSON object, instead of two separate JSON objects.

ACTUAL RESULTS

JSON objects should be merged, so jq or any other JSON interpreter may parse the output.

redbull-management:~/doomslayer # gru -j chassis boot bios --now ncn-s001-mgmt ncn-s002-mgmt ncn-s003-mgmt
{
  "ncn-s001-mgmt": {
    "target": "BiosSetup"
  },
  "ncn-s002-mgmt": {
    "target": "BiosSetup"
  },
  "ncn-s003-mgmt": {
    "target": "BiosSetup"
  }
}
{
  "ncn-s001-mgmt": {
    "previousPowerState": "On",
    "resetType": "ForceRestart"
  },
  "ncn-s002-mgmt": {
    "previousPowerState": "On",
    "resetType": "ForceRestart"
  },
  "ncn-s003-mgmt": {
    "previousPowerState": "On",
    "resetType": "ForceRestart"
  }
}

boot commands fail on HPE/iLO

SUMMARY

When invoking either of the following against an iLO machine, 404 errors are returned.

  • gru show boot
  • gru chassis boot

Found against the following node

{
  "ncn-m003-mgmt": {
    "biosVersion": "A43 v2.68 (02/06/2023)",
    "firmwareVersion": "iLO 5 v2.81",
    "processorModel": "AMD EPYC 7302P 16-Core Processor               ",
    "manufacturer": "HPE",
    "model": "ProLiant DL325 Gen10 Plus"
  }
}
ISSUE TYPE
  • Bug Report
STEPS TO REPRODUCE
  1. Find an iLO machine
  2. Run gru show boot
EXPECTED RESULTS

A list of boot options should print out

intel-mgmt-node:
	Order:
		CRAY UEFI OS 1
		CRAY UEFI OS 0
		UEFI Samsung Flash Drive 1100
		UEFI HTTPv6: Network 00 at Riser 03 Slot 01
		UEFI IPv4: Network 00 at Riser 03 Slot 01
		UEFI HTTPv4: Network 00 at Riser 03 Slot 01
		UEFI IPv6: Network 00 at Riser 03 Slot 01
		UEFI HTTPv6: Network 01 at Riser 03 Slot 01
		UEFI IPv4: Network 01 at Riser 03 Slot 01
		UEFI HTTPv4: Network 01 at Riser 03 Slot 01
		UEFI IPv6: Network 01 at Riser 03 Slot 01
		UEFI HTTPv6: Network 00 at Riser 03 Slot 02
		UEFI IPv4: Network 00 at Riser 03 Slot 02
		UEFI HTTPv4: Network 00 at Riser 03 Slot 02
		UEFI IPv6: Network 00 at Riser 03 Slot 02
		UEFI HTTPv6: Network 01 at Riser 03 Slot 02
		UEFI IPv4: Network 01 at Riser 03 Slot 02
		UEFI HTTPv4: Network 01 at Riser 03 Slot 02
		UEFI IPv6: Network 01 at Riser 03 Slot 02
		UEFI HTTPv6: Intel Network 00 at Baseboard
		UEFI IPv4: Intel Network 00 at Baseboard
		UEFI HTTPv4: Intel Network 00 at Baseboard
		UEFI IPv6: Intel Network 00 at Baseboard
		UEFI HTTPv6: Intel Network 01 at Baseboard
		UEFI IPv4: Intel Network 01 at Baseboard
		UEFI HTTPv4: Intel Network 01 at Baseboard
		UEFI IPv6: Intel Network 01 at Baseboard
		UEFI SAMSUNG MZ7LH480HAHQ-00005 S45PNA0M839302
		Launch EFI Shell
		Enter Setup
		Boot Device List
		Network Boot
		UEFI SAMSUNG MZ7LH480HAHQ-00005 S45PNA0M839290
ACTUAL RESULTS

A 404 error is returned.

Overloaded `types.go` and `MapPrint`

SUMMARY
ISSUE TYPE
  • Bug Report
STEPS TO REPRODUCE
  1. Types specific to subpackages are living in a common area
  2. cli.MapPrint is now coupled with various types from various subpackages
EXPECTED RESULTS

All subpackages should be modular.

  1. cli.MapPrint should not be coupled to a subpackage's types.
  2. pkg.cmd.clie.bios.amd.* should only be used when amd or epyc processors are detected.
ACTUAL RESULTS

Some subpackages are no longer modular, and context is lost.

  1. cli.MapPrint now has special handling for a handful of types, instead Polymorphesim or a more generic handling should be used.
  2. Some specific code, such as pkg.cmd.cli.bios.amd.epyc.rome is used in liberally in every single call.

Include CPU architecture in system print out (for every CPU)

SUMMARY

Include a list of every physical processor on the server when running show system:

  • Architecture
  • Model
  • The socket index
  • Core count

This would replace the ProcessorModel read from ProcessorSummary.Model.

ISSUE TYPE
  • RFE
ADDITIONAL INFORMATION

I briefly tried implementing this, and while it works for JSON it isn't working for pretty-print.
Regardless, here's the formatting I was thinking:

gru show system redbull-ncn-m001-mgmt.hpc.amslabs.hpecorp.net drax-ncn-m001-mgmt.hpc.amslabs.hpecorp.net surtur-ncn-m001-mgmt.hpc.amslabs.hpecorp.net -j
{
  "drax-ncn-m001-mgmt.hpc.amslabs.hpecorp.net": {
    "biosVersion": "C38",
    "firmwareVersion": "12.84.17",
    "processors": [
      {
        "architecture": "x86",
        "cores": 24,
        "model": "AMD EPYC 7402 24-Core Processor",
        "socket": "P0"
      }
    ],
    "manufacturer": "Cray Inc.",
    "model": "R272-Z30-00"
  },
  "redbull-ncn-m001-mgmt.hpc.amslabs.hpecorp.net": {
    "biosVersion": "SE5C620.86B.02.01.0016.C0001.032120230338",
    "firmwareVersion": "2.88.71773d70",
    "processors": [
      {
        "architecture": "x86",
        "cores": 28,
        "model": "Intel Xeon processor",
        "socket": "CPU 1"
      },
      {
        "architecture": "x86",
        "cores": 28,
        "model": "Intel Xeon processor",
        "socket": "CPU 2"
      }
    ],
    "manufacturer": "Intel Corporation",
    "model": "S2600WFT"
  },
  "surtur-ncn-m001-mgmt.hpc.amslabs.hpecorp.net": {
    "biosVersion": "A43 v1.38 (10/30/2020)",
    "firmwareVersion": "iLO 5 v2.44",
    "processors": [
      {
        "architecture": "x86",
        "cores": 16,
        "model": "AMD EPYC 7302P 16-Core Processor               ",
        "socket": "Proc 1"
      }
    ],
    "manufacturer": "HPE",
    "model": "ProLiant DL325 Gen10 Plus"
  }
}

Set user credentials

SUMMARY

In recent discussions, IPMI was used often for this, but a more vendor agnostic approach is needed during hardware inventory/discovery as well as ad-hoc usages.

ISSUE TYPE
  • RFE
ADDITIONAL INFORMATION

Perhaps this could also include creating and deleting users.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.