Skip to content

Commit

Permalink
engine: resources: Add a bmc resource
Browse files Browse the repository at this point in the history
This resource manages bmc devices in servers or elsewhere. This also
integrates with the provisioner code.
  • Loading branch information
purpleidea committed Jan 3, 2025
1 parent 3107dfb commit e6d614f
Show file tree
Hide file tree
Showing 13 changed files with 1,017 additions and 5 deletions.
466 changes: 466 additions & 0 deletions engine/resources/bmc_power.go

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions examples/lang/bmc-power.mcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# A standard bmc might connect with:
bmc:power "gofishs://[email protected]:8800" {
#username => "ADMIN",
password => "ADMIN",
#driver => "gofishs", # https gofish

state => "on",

Meta:poll => 10, # required until BMC's support real events!
}

# The testing rpc example can connect to: rpcs://127.0.0.1:8800 instead.
45 changes: 45 additions & 0 deletions examples/mockbmc/fixtures/service_root.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"@odata.context": "/redfish/v1/$metadata#ServiceRoot.ServiceRoot",
"@odata.type": "#ServiceRoot.v1_1_0.ServiceRoot",
"@odata.id": "/redfish/v1/",
"Id": "RootService",
"Name": "Root Service",
"RedfishVersion": "1.0.1",
"UUID": "00000000-0000-0000-0000-0CC47A8BDADA",
"Systems": {
"@odata.id": "/redfish/v1/Systems"
},
"Chassis": {
"@odata.id": "/redfish/v1/Chassis"
},
"Managers": {
"@odata.id": "/redfish/v1/Managers"
},
"Tasks": {
"@odata.id": "/redfish/v1/TaskService"
},
"SessionService": {
"@odata.id": "/redfish/v1/SessionService"
},
"AccountService": {
"@odata.id": "/redfish/v1/AccountService"
},
"EventService": {
"@odata.id": "/redfish/v1/EventService"
},
"UpdateService": {
"@odata.id": "/redfish/v1/UpdateService"
},
"Registries": {
"@odata.id": "/redfish/v1/Registries"
},
"JsonSchemas": {
"@odata.id": "/redfish/v1/JsonSchemas"
},
"Links": {
"Sessions": {
"@odata.id": "/redfish/v1/SessionService/Sessions"
}
},
"Oem": {}
}
6 changes: 6 additions & 0 deletions examples/mockbmc/fixtures/session_delete.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"Success": {
"code": "Base.v1_4_0.Success",
"Message": "Successfully Completed Request."
}
}
10 changes: 10 additions & 0 deletions examples/mockbmc/fixtures/session_service.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"@odata.context": "/redfish/v1/$metadata#Session.Session",
"@odata.type": "#Session.v1_0_0.Session",
"@odata.id": "/redfish/v1/SessionService/Sessions/1",
"Id": "1",
"Name": "User Session",
"Description": "Manager User Session",
"UserName": "ADMIN",
"Oem": {}
}
13 changes: 13 additions & 0 deletions examples/mockbmc/fixtures/systems.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"@odata.context": "/redfish/v1/$metadata#ComputerSystemCollection.ComputerSystemCollection",
"@odata.type": "#ComputerSystemCollection.ComputerSystemCollection",
"@odata.id": "/redfish/v1/Systems",
"Name": "Computer System Collection",
"Description": "Computer System Collection",
"[email protected]": 1,
"Members": [
{
"@odata.id": "/redfish/v1/Systems/1"
}
]
}
107 changes: 107 additions & 0 deletions examples/mockbmc/fixtures/systems_1.json.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"@odata.context": "/redfish/v1/$metadata#ComputerSystem.ComputerSystem",
"@odata.type": "#ComputerSystem.v1_3_0.ComputerSystem",
"@odata.id": "/redfish/v1/Systems/1",
"Id": "1",
"Name": "System",
"Description": "Description of server",
"Status": {
"State": "Enabled",
"Health": "Critical"
},
"SerialNumber": " ",
"PartNumber": "",
"SystemType": "Physical",
"BiosVersion": "3.3",
"Manufacturer": "Supermicro",
"Model": "Super Server",
"SKU": "To be filled by O.E.M.",
"UUID": "00000000-0000-0000-0000-0CC47A847624",
"ProcessorSummary": {
"Count": 1,
"Model": "Intel(R) Xeon(R) processor",
"Status": {
"State": "Enabled",
"Health": "OK"
}
},
"MemorySummary": {
"TotalSystemMemoryGiB": 16,
"Status": {
"State": "Enabled",
"Health": "OK"
}
},
"IndicatorLED": "Off",
"PowerState": "{{ .PowerState }}",
"Boot": {
"BootSourceOverrideEnabled": "Disabled",
"BootSourceOverrideTarget": "None",
"[email protected]": [
"None",
"Pxe",
"Hdd",
"Diags",
"CD/DVD",
"BiosSetup",
"FloppyRemovableMedia",
"UsbKey",
"UsbHdd",
"UsbFloppy",
"UsbCd",
"UefiUsbKey",
"UefiCd",
"UefiHdd",
"UefiUsbHdd",
"UefiUsbCd"
]
},
"Processors": {
"@odata.id": "/redfish/v1/Systems/1/Processors"
},
"Memory": {
"@odata.id": "/redfish/v1/Systems/1/Memory"
},
"EthernetInterfaces": {
"@odata.id": "/redfish/v1/Systems/1/EthernetInterfaces"
},
"SimpleStorage": {
"@odata.id": "/redfish/v1/Systems/1/SimpleStorage"
},
"Storage": {
"@odata.id": "/redfish/v1/Systems/1/Storage"
},
"LogServices": {
"@odata.id": "/redfish/v1/Systems/1/LogServices"
},
"Links": {
"Chassis": [
{
"@odata.id": "/redfish/v1/Chassis/1"
}
],
"ManagedBy": [
{
"@odata.id": "/redfish/v1/Managers/1"
}
],
"Oem": {}
},
"Actions": {
"#ComputerSystem.Reset": {
"target": "/redfish/v1/Systems/1/Actions/ComputerSystem.Reset",
"[email protected]": [
"On",
"ForceOff",
"GracefulShutdown",
"GracefulRestart",
"ForceRestart",
"Nmi",
"ForceOn"
]
}
},
"Oem": {
"Supermicro": {}
}
}
Loading

0 comments on commit e6d614f

Please sign in to comment.