Closed rustydb closed 9 months ago
Will fix the failing tests, still debating how I want to reconcile them. The test failures are limited to the output for --json
when using the BIOS decoder.
Needs a fix to non-json output for bios set
, the "attributes" and "pending" keys are missing.
ncn-m001:~/doomslayer # grep -oP 'ncn-w\d{3}-mgmt' /etc/hosts | gru bios set -f ilo.yaml
Asynchronously updating [ 5] hosts ...
ncn-w001-mgmt:
AutoPowerOn : AlwaysPowerOff
BootMode : Uefi
ProcAmdIOMMU : Enabled
ProcAmdVirtualization : Enabled
ProcX2Apic : Auto
Sriov : Enabled
AutoPowerOn : AlwaysPowerOff
ProcAmdIOMMU : Enabled
ProcAmdVirtualization : Enabled
ncn-w002-mgmt:
AutoPowerOn : AlwaysPowerOff
BootMode : Uefi
ProcAmdIOMMU : Enabled
ProcAmdVirtualization : Enabled
ProcX2Apic : Auto
Sriov : Enabled
AutoPowerOn : AlwaysPowerOff
ProcAmdIOMMU : Enabled
ProcAmdVirtualization : Enabled
ncn-w003-mgmt:
AutoPowerOn : AlwaysPowerOff
BootMode : Uefi
ProcAmdIOMMU : Enabled
ProcAmdVirtualization : Enabled
ProcX2Apic : Auto
Sriov : Enabled
AutoPowerOn : AlwaysPowerOff
ProcAmdIOMMU : Enabled
ProcAmdVirtualization : Enabled
ncn-w004-mgmt:
AutoPowerOn : AlwaysPowerOff
BootMode : Uefi
ProcAmdIOMMU : Enabled
ProcAmdVirtualization : Enabled
ProcX2Apic : Auto
Sriov : Enabled
AutoPowerOn : AlwaysPowerOff
ProcAmdIOMMU : Enabled
ProcAmdVirtualization : Enabled
ncn-w005-mgmt:
AutoPowerOn : AlwaysPowerOff
BootMode : Uefi
ProcAmdIOMMU : Enabled
ProcAmdVirtualization : Enabled
ProcX2Apic : Auto
Sriov : Enabled
ProcAmdIOMMU : Enabled
ProcAmdVirtualization : Enabled
ncn-m001:~/doomslayer # grep -oP 'ncn-w\d{3}-mgmt' /etc/hosts | gru -j bios set -f ilo.yaml
{
"ncn-w001-mgmt": {
"attributes": {
"AutoPowerOn": "AlwaysPowerOff",
"BootMode": "Uefi",
"ProcAmdIOMMU": "Enabled",
"ProcAmdVirtualization": "Enabled",
"ProcX2Apic": "Auto",
"Sriov": "Enabled"
},
"pending": {
"AutoPowerOn": "AlwaysPowerOff",
"ProcAmdIOMMU": "Enabled",
"ProcAmdVirtualization": "Enabled"
}
},
"ncn-w002-mgmt": {
"attributes": {
"AutoPowerOn": "AlwaysPowerOff",
"BootMode": "Uefi",
"ProcAmdIOMMU": "Enabled",
"ProcAmdVirtualization": "Enabled",
"ProcX2Apic": "Auto",
"Sriov": "Enabled"
},
"pending": {
"AutoPowerOn": "AlwaysPowerOff",
"ProcAmdIOMMU": "Enabled",
"ProcAmdVirtualization": "Enabled"
}
},
"ncn-w003-mgmt": {
"attributes": {
"AutoPowerOn": "AlwaysPowerOff",
"BootMode": "Uefi",
"ProcAmdIOMMU": "Enabled",
"ProcAmdVirtualization": "Enabled",
"ProcX2Apic": "Auto",
"Sriov": "Enabled"
},
"pending": {
"AutoPowerOn": "AlwaysPowerOff",
"ProcAmdIOMMU": "Enabled",
"ProcAmdVirtualization": "Enabled"
}
},
"ncn-w004-mgmt": {
"attributes": {
"AutoPowerOn": "AlwaysPowerOff",
"BootMode": "Uefi",
"ProcAmdIOMMU": "Enabled",
"ProcAmdVirtualization": "Enabled",
"ProcX2Apic": "Auto",
"Sriov": "Enabled"
},
"pending": {
"AutoPowerOn": "AlwaysPowerOff",
"ProcAmdIOMMU": "Enabled",
"ProcAmdVirtualization": "Enabled"
}
},
"ncn-w005-mgmt": {
"attributes": {
"AutoPowerOn": "AlwaysPowerOff",
"BootMode": "Uefi",
"ProcAmdIOMMU": "Enabled",
"ProcAmdVirtualization": "Enabled",
"ProcX2Apic": "Auto",
"Sriov": "Enabled"
},
"pending": {
"ProcAmdIOMMU": "Enabled",
"ProcAmdVirtualization": "Enabled"
}
}
}
Also need to change ResetType
to something else, like "IssuedCommand"
ncn-m001:~/doomslayer # gru chassis power on ncn-w005-mgmt
Asynchronously updating [ 1] hosts ...
ncn-w005-mgmt:
PreviousPowerState : Off
ResetType : On
There seems to be an issue with the Gigabyte vendor when using bios get --V
redbull-management:~/doomslayer # gru bios get --virtualization ncn-h002-mgmt
Asynchronously querying [ 1] hosts ...
ncn-h002-mgmt:
ProcessorVmxEnable : 1
ProcessorX2apic : 1
SRIOVEnable : 1
VTdSupport : 1
redbull-management:~/doomslayer # gru bios get --virtualization surtur-ncn-m001-mgmt.hpc.amslabs.hpecorp.net drax-ncn-m001-mgmt.hpc.amslabs.hpecorp.net
Asynchronously querying [ 2] hosts ...
drax-ncn-m001-mgmt.hpc.amslabs.hpecorp.net:
Error : unable to determine manufaturer for virtualization shortcut
surtur-ncn-m001-mgmt.hpc.amslabs.hpecorp.net:
ProcAmdIOMMU : Enabled
ProcAmdVirtualization : Enabled
ProcX2Apic : Auto
Sriov : Enabled
I noticed a panic in the simulator, too, but won't give it a lot of attention since it doesn't panic on a real machine.
New panic occurs when --insecure
is false
and an SSL error occurs.
redbull-management:~/doomslayer # gru bios get ncn-h002-mgmt
Asynchronously querying [ 1] hosts ...
ncn-h002-mgmt:
panic: reflect: call of reflect.Value.NumField on ptr Value
goroutine 1 [running]:
reflect.flag.mustBe(...)
/Users/rusty/.goenv/versions/1.20.1/src/reflect/value.go:223
reflect.Value.NumField({0x8e3500?, 0xc0001c2d80?, 0x7ffc55073b6a?})
/Users/rusty/.goenv/versions/1.20.1/src/reflect/value.go:2041 +0x8d
github.com/Cray-HPE/gru/pkg/cmd/cli.MapPrint(0xc000241740)
/Users/rusty/gitstuffs/cray-shasta/gru/pkg/cmd/cli/cli.go:148 +0x4db
github.com/Cray-HPE/gru/pkg/cmd/cli/bios.NewBiosGetCommand.func1(0xc00025c600?, {0xc000242d90?, 0x1?, 0x1?})
/Users/rusty/gitstuffs/cray-shasta/gru/pkg/cmd/cli/bios/get.go:54 +0x45
github.com/spf13/cobra.(*Command).execute(0xc00025c600, {0xc000242d60, 0x1, 0x1})
/Users/rusty/gitstuffs/cray-shasta/gru/vendor/github.com/spf13/cobra/command.go:987 +0xa91
github.com/spf13/cobra.(*Command).ExecuteC(0xc00025c000)
/Users/rusty/gitstuffs/cray-shasta/gru/vendor/github.com/spf13/cobra/command.go:1115 +0x425
github.com/spf13/cobra.(*Command).Execute(0x7ffc55073b5d?)
/Users/rusty/gitstuffs/cray-shasta/gru/vendor/github.com/spf13/cobra/command.go:1039 +0x19
main.main()
/Users/rusty/gitstuffs/cray-shasta/gru/cmd/gru/main.go:38 +0x3b
New panic occurs when
--insecure
isfalse
and an SSL error occurs.redbull-management:~/doomslayer # gru bios get ncn-h002-mgmt Asynchronously querying [ 1] hosts ... ncn-h002-mgmt: panic: reflect: call of reflect.Value.NumField on ptr Value goroutine 1 [running]: reflect.flag.mustBe(...) /Users/rusty/.goenv/versions/1.20.1/src/reflect/value.go:223 reflect.Value.NumField({0x8e3500?, 0xc0001c2d80?, 0x7ffc55073b6a?}) /Users/rusty/.goenv/versions/1.20.1/src/reflect/value.go:2041 +0x8d github.com/Cray-HPE/gru/pkg/cmd/cli.MapPrint(0xc000241740) /Users/rusty/gitstuffs/cray-shasta/gru/pkg/cmd/cli/cli.go:148 +0x4db github.com/Cray-HPE/gru/pkg/cmd/cli/bios.NewBiosGetCommand.func1(0xc00025c600?, {0xc000242d90?, 0x1?, 0x1?}) /Users/rusty/gitstuffs/cray-shasta/gru/pkg/cmd/cli/bios/get.go:54 +0x45 github.com/spf13/cobra.(*Command).execute(0xc00025c600, {0xc000242d60, 0x1, 0x1}) /Users/rusty/gitstuffs/cray-shasta/gru/vendor/github.com/spf13/cobra/command.go:987 +0xa91 github.com/spf13/cobra.(*Command).ExecuteC(0xc00025c000) /Users/rusty/gitstuffs/cray-shasta/gru/vendor/github.com/spf13/cobra/command.go:1115 +0x425 github.com/spf13/cobra.(*Command).Execute(0x7ffc55073b5d?) /Users/rusty/gitstuffs/cray-shasta/gru/vendor/github.com/spf13/cobra/command.go:1039 +0x19 main.main() /Users/rusty/gitstuffs/cray-shasta/gru/cmd/gru/main.go:38 +0x3b
Fixed in 9612932
There seems to be an issue with the Gigabyte vendor when using
bios get --V
redbull-management:~/doomslayer # gru bios get --virtualization ncn-h002-mgmt Asynchronously querying [ 1] hosts ... ncn-h002-mgmt: ProcessorVmxEnable : 1 ProcessorX2apic : 1 SRIOVEnable : 1 VTdSupport : 1 redbull-management:~/doomslayer # gru bios get --virtualization surtur-ncn-m001-mgmt.hpc.amslabs.hpecorp.net drax-ncn-m001-mgmt.hpc.amslabs.hpecorp.net Asynchronously querying [ 2] hosts ... drax-ncn-m001-mgmt.hpc.amslabs.hpecorp.net: Error : unable to determine manufaturer for virtualization shortcut surtur-ncn-m001-mgmt.hpc.amslabs.hpecorp.net: ProcAmdIOMMU : Enabled ProcAmdVirtualization : Enabled ProcX2Apic : Auto Sriov : Enabled
Fixed.
Also need to change
ResetType
to something else, like "IssuedCommand"ncn-m001:~/doomslayer # gru chassis power on ncn-w005-mgmt Asynchronously updating [ 1] hosts ... ncn-w005-mgmt: PreviousPowerState : Off ResetType : On
Fixed.
Needs a fix to non-json output for
bios set
, the "attributes" and "pending" keys are missing.ncn-m001:~/doomslayer # grep -oP 'ncn-w\d{3}-mgmt' /etc/hosts | gru bios set -f ilo.yaml Asynchronously updating [ 5] hosts ... ncn-w001-mgmt: AutoPowerOn : AlwaysPowerOff BootMode : Uefi ProcAmdIOMMU : Enabled ProcAmdVirtualization : Enabled ProcX2Apic : Auto Sriov : Enabled AutoPowerOn : AlwaysPowerOff ProcAmdIOMMU : Enabled ProcAmdVirtualization : Enabled ncn-w002-mgmt: AutoPowerOn : AlwaysPowerOff BootMode : Uefi ProcAmdIOMMU : Enabled ProcAmdVirtualization : Enabled ProcX2Apic : Auto Sriov : Enabled AutoPowerOn : AlwaysPowerOff ProcAmdIOMMU : Enabled ProcAmdVirtualization : Enabled ncn-w003-mgmt: AutoPowerOn : AlwaysPowerOff BootMode : Uefi ProcAmdIOMMU : Enabled ProcAmdVirtualization : Enabled ProcX2Apic : Auto Sriov : Enabled AutoPowerOn : AlwaysPowerOff ProcAmdIOMMU : Enabled ProcAmdVirtualization : Enabled ncn-w004-mgmt: AutoPowerOn : AlwaysPowerOff BootMode : Uefi ProcAmdIOMMU : Enabled ProcAmdVirtualization : Enabled ProcX2Apic : Auto Sriov : Enabled AutoPowerOn : AlwaysPowerOff ProcAmdIOMMU : Enabled ProcAmdVirtualization : Enabled ncn-w005-mgmt: AutoPowerOn : AlwaysPowerOff BootMode : Uefi ProcAmdIOMMU : Enabled ProcAmdVirtualization : Enabled ProcX2Apic : Auto Sriov : Enabled ProcAmdIOMMU : Enabled ProcAmdVirtualization : Enabled ncn-m001:~/doomslayer # grep -oP 'ncn-w\d{3}-mgmt' /etc/hosts | gru -j bios set -f ilo.yaml { "ncn-w001-mgmt": { "attributes": { "AutoPowerOn": "AlwaysPowerOff", "BootMode": "Uefi", "ProcAmdIOMMU": "Enabled", "ProcAmdVirtualization": "Enabled", "ProcX2Apic": "Auto", "Sriov": "Enabled" }, "pending": { "AutoPowerOn": "AlwaysPowerOff", "ProcAmdIOMMU": "Enabled", "ProcAmdVirtualization": "Enabled" } }, "ncn-w002-mgmt": { "attributes": { "AutoPowerOn": "AlwaysPowerOff", "BootMode": "Uefi", "ProcAmdIOMMU": "Enabled", "ProcAmdVirtualization": "Enabled", "ProcX2Apic": "Auto", "Sriov": "Enabled" }, "pending": { "AutoPowerOn": "AlwaysPowerOff", "ProcAmdIOMMU": "Enabled", "ProcAmdVirtualization": "Enabled" } }, "ncn-w003-mgmt": { "attributes": { "AutoPowerOn": "AlwaysPowerOff", "BootMode": "Uefi", "ProcAmdIOMMU": "Enabled", "ProcAmdVirtualization": "Enabled", "ProcX2Apic": "Auto", "Sriov": "Enabled" }, "pending": { "AutoPowerOn": "AlwaysPowerOff", "ProcAmdIOMMU": "Enabled", "ProcAmdVirtualization": "Enabled" } }, "ncn-w004-mgmt": { "attributes": { "AutoPowerOn": "AlwaysPowerOff", "BootMode": "Uefi", "ProcAmdIOMMU": "Enabled", "ProcAmdVirtualization": "Enabled", "ProcX2Apic": "Auto", "Sriov": "Enabled" }, "pending": { "AutoPowerOn": "AlwaysPowerOff", "ProcAmdIOMMU": "Enabled", "ProcAmdVirtualization": "Enabled" } }, "ncn-w005-mgmt": { "attributes": { "AutoPowerOn": "AlwaysPowerOff", "BootMode": "Uefi", "ProcAmdIOMMU": "Enabled", "ProcAmdVirtualization": "Enabled", "ProcX2Apic": "Auto", "Sriov": "Enabled" }, "pending": { "ProcAmdIOMMU": "Enabled", "ProcAmdVirtualization": "Enabled" } } }
Fixed.
Summary and Scope
Issue Type
Until this is no longer a "work in progress," see the commits for information.
-p
for--pending
--reset
replaced with--clear-cmos
-f
for--from-file
-a
for--attributes
--virt
replaced with-V/--virtualization
types.go
, enhancedMapPrint
to be more generic and handle more cases by builtin typespkg/set
andpkg/query
intointernal/
query.Async()
pkg.cmd.cli.bios.rome_decoder
was moved topkg.cmd.cli.bios.amd.epyc.rome.decoder
and is invoked through the polymorphic functions defined inpkg.cmd.cli.bios.processors
. This switches the decoder implementation to a more modular approach, new decoders can be added in a similar structure. Ultimately, enabling/disabling a decoder is a matter of adding a reference to the new decoder's polymorphic function inpkg.cmd.cli.bios.processors.AttributeDecoderMaps
.rome.ProcessorToken
.pkg.cmd.cli.bios.virt
was moved into a newbios.collections
sub-package. This new sub-package serves as middleware for translating human-friendly, common attributes to the literal names used by the BIOS vendors.pkg.cmd.get
andpkg.cmd.set
were removed in the latest design review ofgru
and therefore were yanked from the code. (Relates to #29)AsyncCall
function topkg.set
, which allows developers to asynchronously run a function against a host without passing any extra arguments.Risks and Mitigations
Filed two new bugs discovered while tested that existed before these changes:
36
37
38