-
Notifications
You must be signed in to change notification settings - Fork 2
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
MTL-2230 add get bios and set bios options via redfish #18
Conversation
9fee43e
to
7339d64
Compare
bec5dfe
to
37d5e71
Compare
63a907d
to
f072e68
Compare
41301d8
to
eb77326
Compare
eb77326
to
12c2408
Compare
Looking at the JSON files, I have one comment. "Rome" is a codename for a product line in the AMD EPYC CPUs, I think we should sequester them into a lower subdirectory. ├── pkg
│ ├── auth
│ │ └── auth.go
│ ├── cmd
│ │ ├── cli
│ │ │ ├── bios
│ │ │ │ ├── bios.go
│ │ │ │ ├── get.go
│ │ │ │ ├── init.go
│ │ │ │ ├── models
│ │ │ │ | └── amd
│ │ │ │ | └── epyc
| │ │ │ │ └── rome My thoughts are:
|
That is easy enough to implement. I will address that shorty |
Maybe I missed it, but can we add the scripts for generating the Gigabyte codename files to the repo somewhere? |
Noticed this too after the rebase. redbull-management:~ # gru --version
gru version 0.0.4~17~g245c360
redbull-management:~ # conman -q | gru chassis boot http --persist
Asynchronously updating [ 9] hosts ...
ncn-h002-mgmt:
UNKNOWN TYPE: boot.Override
ncn-h003-mgmt:
UNKNOWN TYPE: boot.Override
ncn-h004-mgmt:
UNKNOWN TYPE: boot.Override
ncn-h005-mgmt:
UNKNOWN TYPE: boot.Override
ncn-h006-mgmt:
UNKNOWN TYPE: boot.Override
ncn-s001-mgmt:
UNKNOWN TYPE: boot.Override
ncn-s002-mgmt:
UNKNOWN TYPE: boot.Override
ncn-s003-mgmt:
UNKNOWN TYPE: boot.Override
ncn-s004-mgmt:
UNKNOWN TYPE: boot.Override It works fine for the current HEAD (gofish0.14.0). redbull-management:~ # gru --version
gru version 0.0.4~9~gf830d91
redbull-management:~ # conman -q | gru chassis boot http --persist
Asynchronously updating [ 9] hosts ...
ncn-h002-mgmt:
Target : UefiHttp
ncn-h003-mgmt:
Target : UefiHttp
ncn-h004-mgmt:
Target : UefiHttp
ncn-h005-mgmt:
Target : UefiHttp
ncn-h006-mgmt:
Target : UefiHttp
ncn-s001-mgmt:
Target : UefiHttp
ncn-s002-mgmt:
Target : UefiHttp
ncn-s003-mgmt:
Target : UefiHttp
ncn-s004-mgmt:
Target : UefiHttp |
d581592
to
4754884
Compare
9355080
to
e8302b7
Compare
Piping still doesn't seem to work for redbull-management:~ # /tmp/gru --version
gru version 0.0.4~18~ge8302b7
redbull-management:~ # conman -q | /tmp/gru --json set bios --attributes "OnboardNICEnable_0=0,OnboardNICEnable_1=0,ProcessorHyperThreadingDisable=0,ProcessorVmxEnable=1,ProcessorX2apic=1,VTdSupport=1,ProcessorPowerPolicy=0"
Error: requires at least 1 arg(s), only received 0
Usage:
gru set bios [flags]
Flags:
--attributes strings Comma delimited list of attributes and values to set them to: attribute=value[,keyN=valueN].
--defaults Reset all BIOS attributes to vendor defaults
--from-file string Path to a key/value YML file with bios attributes and their desired value(s)
-h, --help help for bios
--virt Enable virtualization using pre-determined, per-vendor settings
Global Flags:
-c, --config string Configuration file containing BMC credentials, necessary if USERNAME and PASSWORD are not defined in the environment gru
(default "./gru.yml")
--insecure Ignore untrusted or insecure certificates
-j, --json Output results in JSON
An error occurred: requires at least 1 arg(s), only received 0
redbull-management:~ # conman -q | /tmp/gru chassis power status
Asynchronously querying [ 9] hosts ...
ncn-h002-mgmt:
PowerState : Off
ncn-h003-mgmt:
PowerState : On
ncn-h004-mgmt:
PowerState : On
ncn-h005-mgmt:
PowerState : On
ncn-h006-mgmt:
PowerState : On
ncn-s001-mgmt:
PowerState : Off
ncn-s002-mgmt:
PowerState : Off
ncn-s003-mgmt:
PowerState : Off
ncn-s004-mgmt:
PowerState : Off The Pending results do report the correct, pending attribute. However they report the current value instead of the pending value.
Jacob, I have some changes queued for this PR. To avoid conflicts I can take a stab at fixing these two issues. I made some UX changes to the GRU confluence page that flip |
The piping is broken due to the |
Oh forgot to check the piping thing... if you got it, go ahead. Otherwise I can look |
e8302b7
to
c1fee3f
Compare
Updated to fix piping in from STDIN. Also added a test for it. |
Thank you. I'll rebase my changes. |
Signed-off-by: Jacob Salmela <jacob.salmela@hpe.com>
Signed-off-by: Jacob Salmela <jacob.salmela@hpe.com>
Signed-off-by: Jacob Salmela <jacob.salmela@hpe.com>
Signed-off-by: Jacob Salmela <jacob.salmela@hpe.com>
Signed-off-by: Jacob Salmela <jacob.salmela@hpe.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving and merging. Addressing some of my own concerns in a follow-up PR, since the majority/heavy-lifting work is accomplished with what's here already.
I did make some compromises to conform to the existing skeleton code. There are some other approaches to some of the things you mentioned but at the very least, the functionality is there and can be refined. |
Summary and Scope
get bios
andset bios
commands with several flagsIssue Type
RFE Pull Request
get
/set
functionality for thebios
subcommandasync/MapPrint
MapPrint
to use a type-assertion switch case instead of using reflect. this keeps compatibility with everything being able to use the function but may still need adjustments or modifications going forwardcli/types.go
to prevent import cycles (forMapPrint
)*redfish.Bios
object into its own functionmakeAttributes
to convert strings to ints to work properly with IntelunmarshalBiosKeyValFile()
to get k/v pairs from a yaml filevirtSettings()
and exported variables, which pre-define the attributes needed to enable virtualization on a per-vendor basis, which is tied to the--virt
shortcut flaggetPendingAttributes()
, which returns a map of pending keys (these are "staged" in a different key than the current settings)requires 1 minimum arg for these commands (a host)Rome0565
entries to their friendly namesbe_json
matcher for shellspec that checks for valid json viajq
Risks and Mitigations
Low to medium. This changes the print function to work with more output/data types, thus requiring modifications to everything currently using it. It also cannot be fully tested in the pipeline yet due to the simulator limitation mentioned above