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

Import sls #52

Merged
merged 30 commits into from
Jun 16, 2023
Merged

Import sls #52

merged 30 commits into from
Jun 16, 2023

Conversation

rsjostrand-hpe
Copy link
Contributor

@rsjostrand-hpe rsjostrand-hpe commented Jun 6, 2023

This PR contains the initial SLS import logic to the CANI inventory format. Currently Cabinets (Chassis, ChassisBMCs, CEC) and Nodes (Node Blades, Node Cards, Node BMCs) are supported.

Currently missing properly logic to handle phantom nodes from CSI, but the logic currently is able to detect them.

  • Created a temporary import sub command, I think ideally this should be done with the session start, but might be useful to be able to run it ad-hoc.
  • Datastore
    • Added clone and merge methods to the datastore
    • Add support for an in-memory datastore that is not backed by a file
    • Found a bug in the DatastoreJSON update Update method that wasn't checking parent IDs right
    • GetLocation now builds up the location path slice more efficiently
    • Switched some log messages to the trace log level
  • Inventory Model
    • Added an empty hardware state
    • Added support for multiple aliases in the model. The CLI side only supports a single alias at the moment.
    • Fixed typo in HardwareStatusDecommissioned
    • Include the device slug when building out hardware
    • The hardware type library has a way to now to help identify hardware based on manufacturer and model. Still need to add this info for non-windom blades.
  • CSM
    • Added some SLS helper functions to filter hardware, and parallel update SLS.
    • CSM provider now gets a copy of the hardware type library
    • HSM Client
      • HSM Client is generated the same way as the SLS client
      • Fixed a bug the generated model with model_hw_inventory_1_0_0_hw_inventory_by_fru where the actual fru data fields were missing.
    • SLS Client
      • Custom model template to include mapstructure tags
      • Added extra cani metadata to the hardware extra properties.
        • CANI UUID
        • Last modified time
        • CANI SLS data Schema version.
        • Fixed an issue with cabinet network data in extra properties not getting properly represented in the model.
go run . alpha session start csm -S -k 
go run . alpha session import 
go run . alpha session import # Run again to show idempotencey

go run . alpha add cabinet --cabinet 1005 hpe-ex4000 --vlan-id 4000  
go run . alpha add blade hpe-crayex-ex235a-compute-blade --cabinet 1005 --chassis 1 --blade 1
go run . alpha update node --cabinet 1005 --chassis 1 --blade 1 --nodecard 0 --node 0 \
    --role Compute --nid 3000 --alias nid003000
go run . alpha update node --cabinet 1005 --chassis 1 --blade 1 --nodecard 1 --node 0 \
    --role Compute --nid 3001 --alias nid003001
go run . alpha session stop 
go run . alpha session stop # Run again to show idempotencey

goals.md Outdated Show resolved Hide resolved
go.mod Show resolved Hide resolved
@rsjostrand-hpe rsjostrand-hpe marked this pull request as ready for review June 15, 2023 17:43
cmd/session/init.go Show resolved Hide resolved

// stopSession stops a session if one exists
func importSession(cmd *cobra.Command, args []string) error {
// Setup profiling
Copy link
Collaborator

Choose a reason for hiding this comment

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

Might be nice to toggle with a flag

pkg/hsm-client/api_redfish_endpoint.go Show resolved Hide resolved
@rsjostrand-hpe rsjostrand-hpe merged commit 79be5f6 into develop Jun 16, 2023
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.

3 participants