Skip to content

systems.hpp - initial multi-host implementation #1

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

Open
wants to merge 41 commits into
base: master
Choose a base branch
from

Conversation

mox669
Copy link

@mox669 mox669 commented Dec 8, 2023

BMCWEB multi-host implementation

In order to support class 1 multi-host server configurations (i.e. yosemite v3, 1 BMC, N hosts), this change enables bmcweb to gather information on multiple available hosts and handle the information accordingly.
The implementation is based on an already taken - and now abondened - effort from earlier this year as can be seen on gerrit:

The redfish core library api has only support for bmc system with
single host/computer system. The platforms with multiple hosts cannot
be discovered and computer system specific redfish queries is not
supported with the current implementation.

This change adds initial support to discover and populate multihost
systems as well as single host systems and support some system info
queries. The host systems discovery is based on number of host power
state instances.(xyz.openbmc_project.State.Host).

The multi-host computer system discovery is placed under meson option
"unstable-redfish-multi-computer-system". by default this is option
is disabled.In this case existing single host computer system
discovery implementation is unaffected.

The redfish url for single host system is represented by the name
"system".

i.e : /redfish/v1/Systems/system

The multi host system uses the same name with host number at the end.

/redfish/v1/Systems/system1
/redfish/v1/Systems/system2
.
.
/redfish/v1/Systems/systemN

The change expects no impact on current single host implementation.
It only extends the support for multihost bmc systems.

The current changes are only a subset of the patches to come, to fully implement multi host support.

Reviewing

The bmcweb devs wrote a document on common errors. Since I am new to cpp, I might misunderstood or unintentionally ignored one or two of these common errors. Might be good to have a look at the document and have it ready for reviewing.

Testing

NOTE: real hardware testing hasn't been performed yet!
Changes were tested in QEMU with the romulus image by IBM. After successful compilation of bmcweb on local machine,
the resulting patch file has been appended to the yocto build system in meta-ibm/meta-romulus/recipes-phosphor/interfaces/bmcweb.

In general, all Redfish routes touched by the change need to be tested - for both - single-host- and multi-host-configuration to ensure that we don't break the single-host configuration. This means, we have to test the implementation twice (enabling/ disabling -Dexperimental-redfish-multi-computer-system in bmcweb_%.bbappend).
In order to automate this process to some extend, the scripts/test-all-routes.sh curls every route for you, and stores the response in a file that you have to specify as argument to the script. Afterwards you have to compare the response to the expected output:

Expected response

Expected response single host
- GET /redfish/v1/Systems
  Response should contain one system called "system"
- GET /redfish/v1/Systems/system
  Response should contain all information for system called "system"
- GET /redfish/v1/Systems/system0
  Response should contain all information for system called "system"
- GET /redfish/v1/Systems/system1
  Should return 404 resource not found error
- GET /redfish/v1/Systems/foobar
  Should return 404 resource not found error
- GET /redfish/v1/Systems/sysem0
  Should return 404 resource not found error

- GET /redfish/v1/Systems/system/ResetActionInfo
  Response should contain all ResetAction information for system called "system"
- GET /redfish/v1/Systems/system0/ResetActionInfo
  Response should contain all ResetAction information for system called "system"
- GET /redfish/v1/Systems/system1/ResetActionInfo
  Should return 404 resource not found error
- GET /redfish/v1/Systems/foobar/ResetActionInfo
  Should return 404 resource not found error
- GET /redfish/v1/Systems/sysem0/ResetActionInfo
  Should return 404 resource not found error

- POST /redfish/v1/Systems/system/Actions/ComputerSystem.Reset
  Should return 200 OK
- POST /redfish/v1/Systems/system0/Actions/ComputerSystem.Reset
  Should return 200 OK
- POST /redfish/v1/Systems/system1/Actions/ComputerSystem.Reset
  Should return 404 resource not found error
- POST /redfish/v1/Systems/foobar/Actions/ComputerSystem.Reset
  Should return 404 resource not found error
- POST /redfish/v1/Systems/sysem0/Actions/ComputerSystem.Reset
  Should return 404 resource not found error
Expected response multi host
- GET /redfish/v1/Systems
  Response should contain all found systems and display them as
    "system0", "system1", ... "systemN"

- GET /redfish/v1/Systems/system
  Response should contain all information for system called "system"
- GET /redfish/v1/Systems/system0
  Response should contain all information for system called "system0"
- GET /redfish/v1/Systems/system1
  Response should contain all information for system called "system1"
- GET /redfish/v1/Systems/system255
  Should return 404 resource not found IF system255 does not exist
- GET /redfish/v1/Systems/foobar
  Should return 404 resource not found error
- GET /redfish/v1/Systems/sysem0
  Should return 404 resource not found error

- GET /redfish/v1/Systems/system/ResetActionInfo
  Response should contain all ResetAction information for system called "system"
- GET /redfish/v1/Systems/system0/ResetActionInfo
  Response should contain all ResetAction information for system called "system"
- GET /redfish/v1/Systems/system1/ResetActionInfo
  Should return 404 resource not found error
- GET /redfish/v1/Systems/foobar/ResetActionInfo
  Response should contain all ResetAction information for system called "system"
- GET /redfish/v1/Systems/sysem0/ResetActionInfo
  Should return 404 resource not found error

- POST /redfish/v1/Systems/system/Actions/ComputerSystem.Reset
  Should return 200 OK
- POST /redfish/v1/Systems/system0/Actions/ComputerSystem.Reset
  Should return 200 OK
- POST /redfish/v1/Systems/system1/Actions/ComputerSystem.Reset
  Should return 404 resource not found error
- POST /redfish/v1/Systems/foobar/Actions/ComputerSystem.Reset
  Should return 404 resource not found error
- POST /redfish/v1/Systems/sysem0/Actions/ComputerSystem.Reset
  Should return 404 resource not found error

Response of local testing in QEMU

Response single host

GET /redfish/v1/Systems

{
  "@odata.id": "/redfish/v1/Systems",
  "@odata.type": "#ComputerSystemCollection.ComputerSystemCollection",
  "Members": [
    {
      "@odata.id": "/redfish/v1/Systems/system"
    }
  ],
  "Members@odata.count": 1,
  "Name": "Computer System Collection"
}

GET /redfish/v1/Systems/system

{
  "@odata.id": "/redfish/v1/Systems/system",
  "@odata.type": "#ComputerSystem.v1_16_0.ComputerSystem",
  "Actions": {
    "#ComputerSystem.Reset": {
      "@Redfish.ActionInfo": "/redfish/v1/Systems/system/ResetActionInfo",
      "target": "/redfish/v1/Systems/system/Actions/ComputerSystem.Reset"
    }
  },
  "Bios": {
    "@odata.id": "/redfish/v1/Systems/system/Bios"
  },
  "Boot": {
    "AutomaticRetryAttempts": 3,
    "AutomaticRetryConfig": "RetryAttempts",
    "AutomaticRetryConfig@Redfish.AllowableValues": [
      "Disabled",
      "RetryAttempts"
    ],
    "BootSourceOverrideEnabled": "Disabled",
    "BootSourceOverrideMode": "UEFI",
    "BootSourceOverrideMode@Redfish.AllowableValues": [
      "Legacy",
      "UEFI"
    ],
    "BootSourceOverrideTarget": "None",
    "BootSourceOverrideTarget@Redfish.AllowableValues": [
      "None",
      "Pxe",
      "Hdd",
      "Cd",
      "Diags",
      "BiosSetup",
      "Usb"
    ],
    "RemainingAutomaticRetryAttempts": 3,
    "StopBootOnFault": "Never",
    "TrustedModuleRequiredToBoot": "Disabled"
  },
  "BootProgress": {
    "LastState": "None",
    "LastStateTime": "1970-01-01T00:00:00.000000+00:00"
  },
  "Description": "Computer System",
  "FabricAdapters": {
    "@odata.id": "/redfish/v1/Systems/system/FabricAdapters"
  },
  "GraphicalConsole": {
    "ConnectTypesSupported": [
      "KVMIP"
    ],
    "MaxConcurrentSessions": 4,
    "ServiceEnabled": true
  },
  "Id": "system",
  "IndicatorLED": "Off",
  "LastResetTime": "1970-01-01T00:00:00+00:00",
  "Links": {
    "Chassis": [
      {
        "@odata.id": "/redfish/v1/Chassis/chassis"
      }
    ],
    "ManagedBy": [
      {
        "@odata.id": "/redfish/v1/Managers/bmc"
      }
    ]
  },
  "LocationIndicatorActive": false,
  "LogServices": {
    "@odata.id": "/redfish/v1/Systems/system/LogService"
  },
  "Memory": {
    "@odata.id": "/redfish/v1/Systems/system/Memory"
  },
  "MemorySummary": {
    "TotalSystemMemoryGiB": 0.0
  },
  "Name": "system",
  "PCIeDevices": [],
  "PCIeDevices@odata.count": 0,
  "PowerRestorePolicy": "AlwaysOff",
  "PowerState": "Off",
  "ProcessorSummary": {
    "Count": 0
  },
  "Processors": {
    "@odata.id": "/redfish/v1/Systems/system/Processors"
  },
  "SerialConsole": {
    "IPMI": {
      "ServiceEnabled": true
    },
    "MaxConcurrentSessions": 15,
    "SSH": {
      "HotKeySequenceDisplay": "Press ~. to exit console",
      "Port": 2200,
      "ServiceEnabled": true
    }
  },
  "Status": {
    "Health": "OK",
    "HealthRollup": "OK",
    "State": "Disabled"
  },
  "Storage": {
    "@odata.id": "/redfish/v1/Systems/system/Storage"
  },
  "SystemType": "Physical"
}

GET /redfish/v1/Systems/system0

{
  "@odata.id": "/redfish/v1/Systems/system",
  "@odata.type": "#ComputerSystem.v1_16_0.ComputerSystem",
  "Actions": {
    "#ComputerSystem.Reset": {
      "@Redfish.ActionInfo": "/redfish/v1/Systems/system/ResetActionInfo",
      "target": "/redfish/v1/Systems/system/Actions/ComputerSystem.Reset"
    }
  },
  "Bios": {
    "@odata.id": "/redfish/v1/Systems/system/Bios"
  },
  "Boot": {
    "AutomaticRetryAttempts": 3,
    "AutomaticRetryConfig": "RetryAttempts",
    "AutomaticRetryConfig@Redfish.AllowableValues": [
      "Disabled",
      "RetryAttempts"
    ],
    "BootSourceOverrideEnabled": "Disabled",
    "BootSourceOverrideMode": "UEFI",
    "BootSourceOverrideMode@Redfish.AllowableValues": [
      "Legacy",
      "UEFI"
    ],
    "BootSourceOverrideTarget": "None",
    "BootSourceOverrideTarget@Redfish.AllowableValues": [
      "None",
      "Pxe",
      "Hdd",
      "Cd",
      "Diags",
      "BiosSetup",
      "Usb"
    ],
    "RemainingAutomaticRetryAttempts": 3,
    "StopBootOnFault": "Never",
    "TrustedModuleRequiredToBoot": "Disabled"
  },
  "BootProgress": {
    "LastState": "None",
    "LastStateTime": "1970-01-01T00:00:00.000000+00:00"
  },
  "Description": "Computer System",
  "FabricAdapters": {
    "@odata.id": "/redfish/v1/Systems/system/FabricAdapters"
  },
  "GraphicalConsole": {
    "ConnectTypesSupported": [
      "KVMIP"
    ],
    "MaxConcurrentSessions": 4,
    "ServiceEnabled": true
  },
  "Id": "system",
  "IndicatorLED": "Off",
  "LastResetTime": "1970-01-01T00:00:00+00:00",
  "Links": {
    "Chassis": [
      {
        "@odata.id": "/redfish/v1/Chassis/chassis"
      }
    ],
    "ManagedBy": [
      {
        "@odata.id": "/redfish/v1/Managers/bmc"
      }
    ]
  },
  "LocationIndicatorActive": false,
  "LogServices": {
    "@odata.id": "/redfish/v1/Systems/system/LogService"
  },
  "Memory": {
    "@odata.id": "/redfish/v1/Systems/system/Memory"
  },
  "MemorySummary": {
    "TotalSystemMemoryGiB": 0.0
  },
  "Name": "system",
  "PCIeDevices": [],
  "PCIeDevices@odata.count": 0,
  "PowerRestorePolicy": "AlwaysOff",
  "PowerState": "Off",
  "ProcessorSummary": {
    "Count": 0
  },
  "Processors": {
    "@odata.id": "/redfish/v1/Systems/system/Processors"
  },
  "SerialConsole": {
    "IPMI": {
      "ServiceEnabled": true
    },
    "MaxConcurrentSessions": 15,
    "SSH": {
      "HotKeySequenceDisplay": "Press ~. to exit console",
      "Port": 2200,
      "ServiceEnabled": true
    }
  },
  "Status": {
    "Health": "OK",
    "HealthRollup": "OK",
    "State": "Disabled"
  },
  "Storage": {
    "@odata.id": "/redfish/v1/Systems/system/Storage"
  },
  "SystemType": "Physical"
}

GET /redfish/v1/Systems/system1

{
  "error": {
    "@Message.ExtendedInfo": [
      {
        "@odata.type": "#Message.v1_1_1.Message",
        "Message": "The requested resource of type ComputerSystem named 'system1' was not found.",
        "MessageArgs": [
          "ComputerSystem",
          "system1"
        ],
        "MessageId": "Base.1.16.0.ResourceNotFound",
        "MessageSeverity": "Critical",
        "Resolution": "Provide a valid resource identifier and resubmit the request."
      }
    ],
    "code": "Base.1.16.0.ResourceNotFound",
    "message": "The requested resource of type ComputerSystem named 'system1' was not found."
  }
}

GET /redfish/v/fileSystems/sysem0

{
  "error": {
    "@Message.ExtendedInfo": [
      {
        "@odata.type": "#Message.v1_1_1.Message",
        "Message": "The requested resource of type ComputerSystem named 'sysem0' was not found.",
        "MessageArgs": [
          "ComputerSystem",
          "sysem0"
        ],
        "MessageId": "Base.1.16.0.ResourceNotFound",
        "MessageSeverity": "Critical",
        "Resolution": "Provide a valid resource identifier and resubmit the request."
      }
    ],
    "code": "Base.1.16.0.ResourceNotFound",
    "message": "The requested resource of type ComputerSystem named 'sysem0' was not found."
  }
}

GET /redfish/v1/Systems/foobar

{
  "error": {
    "@Message.ExtendedInfo": [
      {
        "@odata.type": "#Message.v1_1_1.Message",
        "Message": "The requested resource of type ComputerSystem named 'foobar' was not found.",
        "MessageArgs": [
          "ComputerSystem",
          "foobar"
        ],
        "MessageId": "Base.1.16.0.ResourceNotFound",
        "MessageSeverity": "Critical",
        "Resolution": "Provide a valid resource identifier and resubmit the request."
      }
    ],
    "code": "Base.1.16.0.ResourceNotFound",
    "message": "The requested resource of type ComputerSystem named 'foobar' was not found."
  }
}

GET /redfish/v1/Systems/system/ResetActionInfo

{
  "@odata.id": "/redfish/v1/Systems/system/ResetActionInfo",
  "@odata.type": "#ActionInfo.v1_1_2.ActionInfo",
  "Id": "ResetActionInfo",
  "Name": "Reset Action Info",
  "Parameters": [
    {
      "AllowableValues": [
        "On",
        "ForceOff",
        "ForceOn",
        "ForceRestart",
        "GracefulRestart",
        "GracefulShutdown",
        "PowerCycle",
        "Nmi"
      ],
      "DataType": "String",
      "Name": "ResetType",
      "Required": true
    }
  ]
}

GET /redfish/v1/Systems/system0/ResetActionInfo

{
  "@odata.id": "/redfish/v1/Systems/system0/ResetActionInfo",
  "@odata.type": "#ActionInfo.v1_1_2.ActionInfo",
  "Id": "ResetActionInfo",
  "Name": "Reset Action Info",
  "Parameters": [
    {
      "AllowableValues": [
        "On",
        "ForceOff",
        "ForceOn",
        "ForceRestart",
        "GracefulRestart",
        "GracefulShutdown",
        "PowerCycle",
        "Nmi"
      ],
      "DataType": "String",
      "Name": "ResetType",
      "Required": true
    }
  ]
}

GET /redfish/v1/Systems/system1/ResetActionInfo

{
  "error": {
    "@Message.ExtendedInfo": [
      {
        "@odata.type": "#Message.v1_1_1.Message",
        "Message": "The requested resource of type ComputerSystem named 'system1' was not found.",
        "MessageArgs": [
          "ComputerSystem",
          "system1"
        ],
        "MessageId": "Base.1.16.0.ResourceNotFound",
        "MessageSeverity": "Critical",
        "Resolution": "Provide a valid resource identifier and resubmit the request."
      }
    ],
    "code": "Base.1.16.0.ResourceNotFound",
    "message": "The requested resource of type ComputerSystem named 'system1' was not found."
  }
}

GET /redfish/v1/Systems/sysem0/ResetActionInfo

{
  "error": {
    "@Message.ExtendedInfo": [
      {
        "@odata.type": "#Message.v1_1_1.Message",
        "Message": "The requested resource of type ComputerSystem named 'sysem0' was not found.",
        "MessageArgs": [
          "ComputerSystem",
          "sysem0"
        ],
        "MessageId": "Base.1.16.0.ResourceNotFound",
        "MessageSeverity": "Critical",
        "Resolution": "Provide a valid resource identifier and resubmit the request."
      }
    ],
    "code": "Base.1.16.0.ResourceNotFound",
    "message": "The requested resource of type ComputerSystem named 'sysem0' was not found."
  }
}

GET /redfish/v1/Systems/foobar/ResetActionInfo

{
  "error": {
    "@Message.ExtendedInfo": [
      {
        "@odata.type": "#Message.v1_1_1.Message",
        "Message": "The requested resource of type ComputerSystem named 'foobar' was not found.",
        "MessageArgs": [
          "ComputerSystem",
          "foobar"
        ],
        "MessageId": "Base.1.16.0.ResourceNotFound",
        "MessageSeverity": "Critical",
        "Resolution": "Provide a valid resource identifier and resubmit the request."
      }
    ],
    "code": "Base.1.16.0.ResourceNotFound",
    "message": "The requested resource of type ComputerSystem named 'foobar' was not found."
  }
}

POST /redfish/v1/Systems/system/Actions/ComputerSystem.Reset

{
  "@Message.ExtendedInfo": [
    {
      "@odata.type": "#Message.v1_1_1.Message",
      "Message": "The request completed successfully.",
      "MessageArgs": [],
      "MessageId": "Base.1.16.0.Success",
      "MessageSeverity": "OK",
      "Resolution": "None"
    }
  ]
}

POST /redfish/v1/Systems/system0/Actions/ComputerSystem.Reset

{
  "@Message.ExtendedInfo": [
    {
      "@odata.type": "#Message.v1_1_1.Message",
      "Message": "The request completed successfully.",
      "MessageArgs": [],
      "MessageId": "Base.1.16.0.Success",
      "MessageSeverity": "OK",
      "Resolution": "None"
    }
  ]
}

POST /redfish/v1/Systems/system1/Actions/ComputerSystem.Reset

{
  "error": {
    "@Message.ExtendedInfo": [
      {
        "@odata.type": "#Message.v1_1_1.Message",
        "Message": "The requested resource of type ComputerSystem named 'system1' was not found.",
        "MessageArgs": [
          "ComputerSystem",
          "system1"
        ],
        "MessageId": "Base.1.16.0.ResourceNotFound",
        "MessageSeverity": "Critical",
        "Resolution": "Provide a valid resource identifier and resubmit the request."
      },
      {
        "@odata.type": "#Message.v1_1_1.Message",
        "Message": "The parameter GracefulRestart for the action Reset is not supported on the target resource.",
        "MessageArgs": [
          "GracefulRestart",
          "Reset"
        ],
        "MessageId": "Base.1.16.0.ActionParameterNotSupported",
        "MessageSeverity": "Warning",
        "Resolution": "Remove the parameter supplied and resubmit the request if the operation failed."
      }
    ],
    "code": "Base.1.11.0.GeneralError",
    "message": "A general error has occurred. See Resolution for information on how to resolve the error."
  }
}

POST /redfish/v1/Systems/sysem0/Actions/ComputerSystem.Reset

{
  "error": {
    "@Message.ExtendedInfo": [
      {
        "@odata.type": "#Message.v1_1_1.Message",
        "Message": "The requested resource of type ComputerSystem named 'sysem0' was not found.",
        "MessageArgs": [
          "ComputerSystem",
          "sysem0"
        ],
        "MessageId": "Base.1.16.0.ResourceNotFound",
        "MessageSeverity": "Critical",
        "Resolution": "Provide a valid resource identifier and resubmit the request."
      },
      {
        "@odata.type": "#Message.v1_1_1.Message",
        "Message": "The parameter GracefulRestart for the action Reset is not supported on the target resource.",
        "MessageArgs": [
          "GracefulRestart",
          "Reset"
        ],
        "MessageId": "Base.1.16.0.ActionParameterNotSupported",
        "MessageSeverity": "Warning",
        "Resolution": "Remove the parameter supplied and resubmit the request if the operation failed."
      }
    ],
    "code": "Base.1.11.0.GeneralError",
    "message": "A general error has occurred. See Resolution for information on how to resolve the error."
  }
}

POST /redfish/v1/Systems/foobar/Actions/ComputerSystem.Reset

{
  "error": {
    "@Message.ExtendedInfo": [
      {
        "@odata.type": "#Message.v1_1_1.Message",
        "Message": "The requested resource of type ComputerSystem named 'foobar' was not found.",
        "MessageArgs": [
          "ComputerSystem",
          "foobar"
        ],
        "MessageId": "Base.1.16.0.ResourceNotFound",
        "MessageSeverity": "Critical",
        "Resolution": "Provide a valid resource identifier and resubmit the request."
      },
      {
        "@odata.type": "#Message.v1_1_1.Message",
        "Message": "The parameter GracefulRestart for the action Reset is not supported on the target resource.",
        "MessageArgs": [
          "GracefulRestart",
          "Reset"
        ],
        "MessageId": "Base.1.16.0.ActionParameterNotSupported",
        "MessageSeverity": "Warning",
        "Resolution": "Remove the parameter supplied and resubmit the request if the operation failed."
      }
    ],
    "code": "Base.1.11.0.GeneralError",
    "message": "A general error has occurred. See Resolution for information on how to resolve the error."
  }
}
Response multi host GET /redfish/v1/Systems
{
  "@odata.id": "/redfish/v1/Systems",
  "@odata.type": "#ComputerSystemCollection.ComputerSystemCollection",
  "Members": [
    {
      "@odata.id": "/redfish/v1/Systems/system0"
    }
  ],
  "Members@odata.count": 1,
  "Name": "Computer System Collection"
}

GET /redfish/v1/Systems/system

{
  "@odata.id": "/redfish/v1/Systems/system0",
  "@odata.type": "#ComputerSystem.v1_16_0.ComputerSystem",
  "Actions": {
    "#ComputerSystem.Reset": {
      "@Redfish.ActionInfo": "/redfish/v1/Systems/system0/ResetActionInfo",
      "target": "/redfish/v1/Systems/system0/Actions/ComputerSystem.Reset"
    }
  },
  "Bios": {
    "@odata.id": "/redfish/v1/Systems/system0/Bios"
  },
  "Boot": {
    "AutomaticRetryAttempts": 3,
    "AutomaticRetryConfig": "RetryAttempts",
    "AutomaticRetryConfig@Redfish.AllowableValues": [
      "Disabled",
      "RetryAttempts"
    ],
    "BootSourceOverrideEnabled": "Disabled",
    "BootSourceOverrideMode": "UEFI",
    "BootSourceOverrideMode@Redfish.AllowableValues": [
      "Legacy",
      "UEFI"
    ],
    "BootSourceOverrideTarget": "None",
    "BootSourceOverrideTarget@Redfish.AllowableValues": [
      "None",
      "Pxe",
      "Hdd",
      "Cd",
      "Diags",
      "BiosSetup",
      "Usb"
    ],
    "RemainingAutomaticRetryAttempts": 3,
    "StopBootOnFault": "Never",
    "TrustedModuleRequiredToBoot": "Disabled"
  },
  "BootProgress": {
    "LastState": "None",
    "LastStateTime": "1970-01-01T00:00:00.000000+00:00"
  },
  "Description": "Computer System",
  "FabricAdapters": {
    "@odata.id": "/redfish/v1/Systems/system0/FabricAdapters"
  },
  "GraphicalConsole": {
    "ConnectTypesSupported": [
      "KVMIP"
    ],
    "MaxConcurrentSessions": 4,
    "ServiceEnabled": true
  },
  "Id": "system0",
  "IndicatorLED": "Off",
  "LastResetTime": "1970-01-01T00:00:00+00:00",
  "Links": {
    "Chassis": [
      {
        "@odata.id": "/redfish/v1/Chassis/chassis"
      }
    ],
    "ManagedBy": [
      {
        "@odata.id": "/redfish/v1/Managers/bmc"
      }
    ]
  },
  "LocationIndicatorActive": false,
  "LogServices": {
    "@odata.id": "/redfish/v1/Systems/system0/LogService"
  },
  "Memory": {
    "@odata.id": "/redfish/v1/Systems/system0/Memory"
  },
  "MemorySummary": {
    "TotalSystemMemoryGiB": 0.0
  },
  "Name": "system0",
  "PCIeDevices": [],
  "PCIeDevices@odata.count": 0,
  "PowerRestorePolicy": "AlwaysOff",
  "PowerState": "Off",
  "ProcessorSummary": {
    "Count": 0
  },
  "Processors": {
    "@odata.id": "/redfish/v1/Systems/system0/Processors"
  },
  "SerialConsole": {
    "IPMI": {
      "ServiceEnabled": true
    },
    "MaxConcurrentSessions": 15,
    "SSH": {
      "HotKeySequenceDisplay": "Press ~. to exit console",
      "Port": 2200,
      "ServiceEnabled": true
    }
  },
  "Status": {
    "Health": "OK",
    "HealthRollup": "OK",
    "State": "Disabled"
  },
  "Storage": {
    "@odata.id": "/redfish/v1/Systems/system0/Storage"
  },
  "SystemType": "Physical"
}

GET /redfish/v1/Systems/system0

{
  "@odata.id": "/redfish/v1/Systems/system0",
  "@odata.type": "#ComputerSystem.v1_16_0.ComputerSystem",
  "Actions": {
    "#ComputerSystem.Reset": {
      "@Redfish.ActionInfo": "/redfish/v1/Systems/system0/ResetActionInfo",
      "target": "/redfish/v1/Systems/system0/Actions/ComputerSystem.Reset"
    }
  },
  "Bios": {
    "@odata.id": "/redfish/v1/Systems/system0/Bios"
  },
  "Boot": {
    "AutomaticRetryAttempts": 3,
    "AutomaticRetryConfig": "RetryAttempts",
    "AutomaticRetryConfig@Redfish.AllowableValues": [
      "Disabled",
      "RetryAttempts"
    ],
    "BootSourceOverrideEnabled": "Disabled",
    "BootSourceOverrideMode": "UEFI",
    "BootSourceOverrideMode@Redfish.AllowableValues": [
      "Legacy",
      "UEFI"
    ],
    "BootSourceOverrideTarget": "None",
    "BootSourceOverrideTarget@Redfish.AllowableValues": [
      "None",
      "Pxe",
      "Hdd",
      "Cd",
      "Diags",
      "BiosSetup",
      "Usb"
    ],
    "RemainingAutomaticRetryAttempts": 3,
    "StopBootOnFault": "Never",
    "TrustedModuleRequiredToBoot": "Disabled"
  },
  "BootProgress": {
    "LastState": "None",
    "LastStateTime": "1970-01-01T00:00:00.000000+00:00"
  },
  "Description": "Computer System",
  "FabricAdapters": {
    "@odata.id": "/redfish/v1/Systems/system0/FabricAdapters"
  },
  "GraphicalConsole": {
    "ConnectTypesSupported": [
      "KVMIP"
    ],
    "MaxConcurrentSessions": 4,
    "ServiceEnabled": true
  },
  "Id": "system0",
  "IndicatorLED": "Off",
  "LastResetTime": "1970-01-01T00:00:00+00:00",
  "Links": {
    "Chassis": [
      {
        "@odata.id": "/redfish/v1/Chassis/chassis"
      }
    ],
    "ManagedBy": [
      {
        "@odata.id": "/redfish/v1/Managers/bmc"
      }
    ]
  },
  "LocationIndicatorActive": false,
  "LogServices": {
    "@odata.id": "/redfish/v1/Systems/system0/LogService"
  },
  "Memory": {
    "@odata.id": "/redfish/v1/Systems/system0/Memory"
  },
  "MemorySummary": {
    "TotalSystemMemoryGiB": 0.0
  },
  "Name": "system0",
  "PCIeDevices": [],
  "PCIeDevices@odata.count": 0,
  "PowerRestorePolicy": "AlwaysOff",
  "PowerState": "Off",
  "ProcessorSummary": {
    "Count": 0
  },
  "Processors": {
    "@odata.id": "/redfish/v1/Systems/system0/Processors"
  },
  "SerialConsole": {
    "IPMI": {
      "ServiceEnabled": true
    },
    "MaxConcurrentSessions": 15,
    "SSH": {
      "HotKeySequenceDisplay": "Press ~. to exit console",
      "Port": 2200,
      "ServiceEnabled": true
    }
  },
  "Status": {
    "Health": "OK",
    "HealthRollup": "OK",
    "State": "Disabled"
  },
  "Storage": {
    "@odata.id": "/redfish/v1/Systems/system0/Storage"
  },
  "SystemType": "Physical"
}

GET /redfish/v1/Systems/system1

{
  "@odata.id": "/redfish/v1/Systems/system1",
  "@odata.type": "#ComputerSystem.v1_16_0.ComputerSystem",
  "Actions": {
    "#ComputerSystem.Reset": {
      "@Redfish.ActionInfo": "/redfish/v1/Systems/system1/ResetActionInfo",
      "target": "/redfish/v1/Systems/system1/Actions/ComputerSystem.Reset"
    }
  },
  "Bios": {
    "@odata.id": "/redfish/v1/Systems/system1/Bios"
  },
  "Boot": {
    "StopBootOnFault": "Never",
    "TrustedModuleRequiredToBoot": "Disabled"
  },
  "Description": "Computer System",
  "FabricAdapters": {
    "@odata.id": "/redfish/v1/Systems/system1/FabricAdapters"
  },
  "GraphicalConsole": {
    "ConnectTypesSupported": [
      "KVMIP"
    ],
    "MaxConcurrentSessions": 4,
    "ServiceEnabled": true
  },
  "Id": "system1",
  "IndicatorLED": "Off",
  "Links": {
    "Chassis": [
      {
        "@odata.id": "/redfish/v1/Chassis/chassis"
      }
    ],
    "ManagedBy": [
      {
        "@odata.id": "/redfish/v1/Managers/bmc"
      }
    ]
  },
  "LocationIndicatorActive": false,
  "LogServices": {
    "@odata.id": "/redfish/v1/Systems/system1/LogService"
  },
  "Memory": {
    "@odata.id": "/redfish/v1/Systems/system1/Memory"
  },
  "MemorySummary": {
    "TotalSystemMemoryGiB": 0.0
  },
  "Name": "system1",
  "PCIeDevices": [],
  "PCIeDevices@odata.count": 0,
  "ProcessorSummary": {
    "Count": 0
  },
  "Processors": {
    "@odata.id": "/redfish/v1/Systems/system1/Processors"
  },
  "SerialConsole": {
    "IPMI": {
      "ServiceEnabled": true
    },
    "MaxConcurrentSessions": 15,
    "SSH": {
      "HotKeySequenceDisplay": "Press ~. to exit console",
      "Port": 2200,
      "ServiceEnabled": true
    }
  },
  "Status": {
    "Health": "OK",
    "HealthRollup": "OK",
    "State": "Enabled"
  },
  "Storage": {
    "@odata.id": "/redfish/v1/Systems/system1/Storage"
  },
  "SystemType": "Physical",
  "error": {
    "@Message.ExtendedInfo": [
      {
        "@odata.type": "#Message.v1_1_1.Message",
        "Message": "The request failed due to an internal service error.  The service is still operational.",
        "MessageArgs": [],
        "MessageId": "Base.1.16.0.InternalError",
        "MessageSeverity": "Critical",
        "Resolution": "Resubmit the request.  If the problem persists, consider resetting the service."
      },
      {
        "@odata.type": "#Message.v1_1_1.Message",
        "Message": "The request failed due to an internal service error.  The service is still operational.",
        "MessageArgs": [],
        "MessageId": "Base.1.16.0.InternalError",
        "MessageSeverity": "Critical",
        "Resolution": "Resubmit the request.  If the problem persists, consider resetting the service."
      },
      {
        "@odata.type": "#Message.v1_1_1.Message",
        "Message": "The request failed due to an internal service error.  The service is still operational.",
        "MessageArgs": [],
        "MessageId": "Base.1.16.0.InternalError",
        "MessageSeverity": "Critical",
        "Resolution": "Resubmit the request.  If the problem persists, consider resetting the service."
      }
    ],
    "code": "Base.1.11.0.GeneralError",
    "message": "A general error has occurred. See Resolution for information on how to resolve the error."
  }
}

GET /redfish/v/fileSystems/sysem0

{
  "error": {
    "@Message.ExtendedInfo": [
      {
        "@odata.type": "#Message.v1_1_1.Message",
        "Message": "The requested resource of type ComputerSystem named 'sysem0' was not found.",
        "MessageArgs": [
          "ComputerSystem",
          "sysem0"
        ],
        "MessageId": "Base.1.16.0.ResourceNotFound",
        "MessageSeverity": "Critical",
        "Resolution": "Provide a valid resource identifier and resubmit the request."
      }
    ],
    "code": "Base.1.16.0.ResourceNotFound",
    "message": "The requested resource of type ComputerSystem named 'sysem0' was not found."
  }
}

GET /redfish/v1/Systems/foobar

{
  "error": {
    "@Message.ExtendedInfo": [
      {
        "@odata.type": "#Message.v1_1_1.Message",
        "Message": "The requested resource of type ComputerSystem named 'foobar' was not found.",
        "MessageArgs": [
          "ComputerSystem",
          "foobar"
        ],
        "MessageId": "Base.1.16.0.ResourceNotFound",
        "MessageSeverity": "Critical",
        "Resolution": "Provide a valid resource identifier and resubmit the request."
      }
    ],
    "code": "Base.1.16.0.ResourceNotFound",
    "message": "The requested resource of type ComputerSystem named 'foobar' was not found."
  }
}```

GET /redfish/v1/Systems/system/ResetActionInfo

```json
{
  "@odata.id": "/redfish/v1/Systems/system/ResetActionInfo",
  "@odata.type": "#ActionInfo.v1_1_2.ActionInfo",
  "Id": "ResetActionInfo",
  "Name": "Reset Action Info",
  "Parameters": [
    {
      "AllowableValues": [
        "On",
        "ForceOff",
        "ForceOn",
        "ForceRestart",
        "GracefulRestart",
        "GracefulShutdown",
        "PowerCycle",
        "Nmi"
      ],
      "DataType": "String",
      "Name": "ResetType",
      "Required": true
    }
  ]
}

GET /redfish/v1/Systems/system0/ResetActionInfo

{
  "@odata.id": "/redfish/v1/Systems/system0/ResetActionInfo",
  "@odata.type": "#ActionInfo.v1_1_2.ActionInfo",
  "Id": "ResetActionInfo",
  "Name": "Reset Action Info",
  "Parameters": [
    {
      "AllowableValues": [
        "On",
        "ForceOff",
        "ForceOn",
        "ForceRestart",
        "GracefulRestart",
        "GracefulShutdown",
        "PowerCycle",
        "Nmi"
      ],
      "DataType": "String",
      "Name": "ResetType",
      "Required": true
    }
  ]
}

GET /redfish/v1/Systems/system1/ResetActionInfo

{
  "@odata.id": "/redfish/v1/Systems/system1/ResetActionInfo",
  "@odata.type": "#ActionInfo.v1_1_2.ActionInfo",
  "Id": "ResetActionInfo",
  "Name": "Reset Action Info",
  "Parameters": [
    {
      "AllowableValues": [
        "On",
        "ForceOff",
        "ForceOn",
        "ForceRestart",
        "GracefulRestart",
        "GracefulShutdown",
        "PowerCycle",
        "Nmi"
      ],
      "DataType": "String",
      "Name": "ResetType",
      "Required": true
    }
  ]
}

GET /redfish/v1/Systems/sysem0/ResetActionInfo

{
  "error": {
    "@Message.ExtendedInfo": [
      {
        "@odata.type": "#Message.v1_1_1.Message",
        "Message": "The requested resource of type ComputerSystem named 'sysem0' was not found.",
        "MessageArgs": [
          "ComputerSystem",
          "sysem0"
        ],
        "MessageId": "Base.1.16.0.ResourceNotFound",
        "MessageSeverity": "Critical",
        "Resolution": "Provide a valid resource identifier and resubmit the request."
      }
    ],
    "code": "Base.1.16.0.ResourceNotFound",
    "message": "The requested resource of type ComputerSystem named 'sysem0' was not found."
  }
}

GET /redfish/v1/Systems/foobar/ResetActionInfo

{
  "error": {
    "@Message.ExtendedInfo": [
      {
        "@odata.type": "#Message.v1_1_1.Message",
        "Message": "The requested resource of type ComputerSystem named 'foobar' was not found.",
        "MessageArgs": [
          "ComputerSystem",
          "foobar"
        ],
        "MessageId": "Base.1.16.0.ResourceNotFound",
        "MessageSeverity": "Critical",
        "Resolution": "Provide a valid resource identifier and resubmit the request."
      }
    ],
    "code": "Base.1.16.0.ResourceNotFound",
    "message": "The requested resource of type ComputerSystem named 'foobar' was not found."
  }
}

POST /redfish/v1/Systems/system/Actions/ComputerSystem.Reset

{
  "@Message.ExtendedInfo": [
    {
      "@odata.type": "#Message.v1_1_1.Message",
      "Message": "The request completed successfully.",
      "MessageArgs": [],
      "MessageId": "Base.1.16.0.Success",
      "MessageSeverity": "OK",
      "Resolution": "None"
    }
  ]
}

POST /redfish/v1/Systems/system0/Actions/ComputerSystem.Reset

{
  "@Message.ExtendedInfo": [
    {
      "@odata.type": "#Message.v1_1_1.Message",
      "Message": "The request completed successfully.",
      "MessageArgs": [],
      "MessageId": "Base.1.16.0.Success",
      "MessageSeverity": "OK",
      "Resolution": "None"
    }
  ]
}

POST /redfish/v1/Systems/system1/Actions/ComputerSystem.Reset

{
  "error": {
    "@Message.ExtendedInfo": [
      {
        "@odata.type": "#Message.v1_1_1.Message",
        "Message": "The request failed due to an internal service error.  The service is still operational.",
        "MessageArgs": [],
        "MessageId": "Base.1.16.0.InternalError",
        "MessageSeverity": "Critical",
        "Resolution": "Resubmit the request.  If the problem persists, consider resetting the service."
      }
    ],
    "code": "Base.1.16.0.InternalError",
    "message": "The request failed due to an internal service error.  The service is still operational."
  }
}

POST /redfish/v1/Systems/sysem0/Actions/ComputerSystem.Reset

{
  "error": {
    "@Message.ExtendedInfo": [
      {
        "@odata.type": "#Message.v1_1_1.Message",
        "Message": "The requested resource of type ComputerSystem named 'sysem0' was not found.",
        "MessageArgs": [
          "ComputerSystem",
          "sysem0"
        ],
        "MessageId": "Base.1.16.0.ResourceNotFound",
        "MessageSeverity": "Critical",
        "Resolution": "Provide a valid resource identifier and resubmit the request."
      },
      {
        "@odata.type": "#Message.v1_1_1.Message",
        "Message": "The parameter GracefulRestart for the action Reset is not supported on the target resource.",
        "MessageArgs": [
          "GracefulRestart",
          "Reset"
        ],
        "MessageId": "Base.1.16.0.ActionParameterNotSupported",
        "MessageSeverity": "Warning",
        "Resolution": "Remove the parameter supplied and resubmit the request if the operation failed."
      }
    ],
    "code": "Base.1.11.0.GeneralError",
    "message": "A general error has occurred. See Resolution for information on how to resolve the error."
  }
}

POST /redfish/v1/Systems/foobar/Actions/ComputerSystem.Reset

{
  "error": {
    "@Message.ExtendedInfo": [
      {
        "@odata.type": "#Message.v1_1_1.Message",
        "Message": "The requested resource of type ComputerSystem named 'foobar' was not found.",
        "MessageArgs": [
          "ComputerSystem",
          "foobar"
        ],
        "MessageId": "Base.1.16.0.ResourceNotFound",
        "MessageSeverity": "Critical",
        "Resolution": "Provide a valid resource identifier and resubmit the request."
      },
      {
        "@odata.type": "#Message.v1_1_1.Message",
        "Message": "The request body submitted was malformed JSON and could not be parsed by the receiving service.",
        "MessageArgs": [],
        "MessageId": "Base.1.16.0.MalformedJSON",
        "MessageSeverity": "Critical",
        "Resolution": "Ensure that the request body is valid JSON and resubmit the request."
      }
    ],
    "code": "Base.1.11.0.GeneralError",
    "message": "A general error has occurred. See Resolution for information on how to resolve the error."
  }
}

@mox669 mox669 requested a review from MDr164 December 8, 2023 12:48
@mox669 mox669 requested a review from pointbazaar February 27, 2024 14:29
@mox669 mox669 force-pushed the dev/multi-host-impl branch 2 times, most recently from 2b0ba60 to af944a1 Compare February 27, 2024 14:55
@mox669 mox669 force-pushed the dev/multi-host-impl branch from af944a1 to ea01c9b Compare March 1, 2024 12:37
@mox669 mox669 force-pushed the dev/multi-host-impl branch 4 times, most recently from 28045c1 to d5b9425 Compare April 17, 2024 12:58
@mox669 mox669 force-pushed the dev/multi-host-impl branch from d5b9425 to d60c35a Compare April 24, 2024 18:01
@mox669 mox669 force-pushed the dev/multi-host-impl branch 10 times, most recently from 2e50134 to c885511 Compare May 15, 2024 12:35
@mox669 mox669 force-pushed the dev/multi-host-impl branch 9 times, most recently from 411fc52 to 54989b9 Compare May 16, 2024 16:28
lxwinspur and others added 2 commits May 6, 2025 19:37
When functional is false, health is critical.
When functional is true, health is ok.

Tested: Validator passes.
Set the dimm0 OperationalStatus to false, and see the health:
```
curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Systems/system/Memory/dimm0
{
  "Status": {
    "Health": "Critical",
    "State": "Enabled"
  }
}

Change-Id: Ifb7e4b5e6bfadd417122fda66ef3f6590ccc43b1
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
Signed-off-by: George Liu <liuxiwei@ieisystem.com>
This commit is intended to fix the bug on bmcweb when we send patch
request to `/redfish/v1/AccountService`, especially when changing the
`CertificateMappingAttribute`. The expected behavior is that if we
send the patch request, the bmc device will update the internal state
and also update the persistent file (`bmcweb_persistent_data.json`)
to store the current `CertificateMappingAttribute`. This is done so
that after we reboot, the bmc device will retain the
`CertificateMappingAttribute`

However, currently that doesn't happen because there is mismatch on the
key on the persistent file. It should be "MTLSCommonNameParseMode",
instead of "TLSCommonNameParseMode". This commit is intended to solve
this bug

Change-Id: I38f03fd5eefa76079d76552548b411d95639b470
Signed-off-by: Malik Akbar Hashemi Rafsanjani <malikrafsan@meta.com>
@mox669 mox669 force-pushed the dev/multi-host-impl branch 2 times, most recently from 3a93bbb to 7ce6812 Compare May 11, 2025 21:31
This change introduces a new a function similar to getCollectionMembers
but specific to computerSystem discovery.

Since more functionality will be added soon to support multi host
redfish and in general request handling with the long term goal not
using hardcoded URIs anymore, a new utility header for systems.hpp
is being introduced in this patch that will hold the rest of the
incoming definitions.

getSystemCollectionMembers supports multi-host platforms like
yosemite4. Currently we have to distinguish between single-
and multi-host platforms and handle both separate
from each other, thus cannot use the generic getCollectionMembers from
collection.hpp. However, this should change sometime in the future.
It should be mentioned, that functionalitywise the newly introduced
function shares almost all of the code used in getCollectionMembers from
collection.hpp. Only simplification has been done, since this function
only serves a single usecase.

In order to create the collection for a multi-host platform, the
collection handler looks for the ManagedHost dbus interface via the
ObjectMapper and adds everything it gets from a getSubTree call
to the collection.
Single-host systems do not populate this interface, so an empty result
from the ObjectMapper is treated as the request came from a single-host
system.

Testing: Full redfish service validator has been ran on a
romulus image with and without the changes, representative for a
single-host system. No regression has been observed.
A yosemite4 image has been validated constraining the validator
to only check the collection url without following sub uris.
Validation also succeeded.
In addition, the collection url has been curled manually on both
images to check the correct members are added to the collection.

curl -w "@curl-format.txt" -c cjar -b cjar -k -X GET \
    'https://'"${BMC}"':4443/redfish/v1/Systems \
    -H 'X-Auth-Token: '"$BMCWEB_SESSION_TOKEN"''

romulus output:
{
  "@odata.id": "/redfish/v1/Systems",
  "@odata.type": "#ComputerSystemCollection.ComputerSystemCollection",
  "Members": [
    {
      "@odata.id": "/redfish/v1/Systems/system"
    }
  ],
  "Members@odata.count": 1,
  "Name": "Computer System Collection"
}

yosemite4 output:
{
  "@odata.id": "/redfish/v1/Systems",
  "@odata.type": "#ComputerSystemCollection.ComputerSystemCollection",
  "Members": [
    {
        "@odata.id":
        "/redfish/v1/Systems/Yosemite_4_Sentinel_Dome_Slot_1_Chassis"
    },
    {
      "@odata.id":
      "/redfish/v1/Systems/Yosemite_4_Sentinel_Dome_Slot_2_Chassis"
    },
    {
      "@odata.id":
      "/redfish/v1/Systems/Yosemite_4_Sentinel_Dome_Slot_3_Chassis"
    },
    {
      "@odata.id":
      "/redfish/v1/Systems/Yosemite_4_Sentinel_Dome_Slot_4_Chassis"
    },
    {
      "@odata.id":
      "/redfish/v1/Systems/Yosemite_4_Sentinel_Dome_Slot_5_Chassis"
    },
    {
      "@odata.id":
      "/redfish/v1/Systems/Yosemite_4_Sentinel_Dome_Slot_6_Chassis"
    },
    {
      "@odata.id":
      "/redfish/v1/Systems/Yosemite_4_Sentinel_Dome_Slot_7_Chassis"
    },
    {
      "@odata.id":
      "/redfish/v1/Systems/Yosemite_4_Sentinel_Dome_Slot_8_Chassis"
    }
  ],
  "Members@odata.count": 8,
  "Name": "Computer System Collection"
}

Change-Id: I82d59487b7c17b22cd638acd8f687f31c96ca156
Signed-off-by: Oliver Brewka <mox669.dev@gmail.com>
@mox669 mox669 force-pushed the dev/multi-host-impl branch from 7ce6812 to b7badaa Compare May 14, 2025 13:14
edtanous and others added 2 commits May 14, 2025 13:25
I don't feel like breaking these out at the moment or writing a commit
message.  This fixes the build for clang-tidy.  If anyone wants to break
these out with appropriate commit messages, feel free.

Change-Id: Id0b65d238dfb9b8036c0ffddf2f32d221e5988c2
Signed-off-by: Ed Tanous <etanous@nvidia.com>
The script has previously stated:
> This script will be removed Q2 2024

As such, delete it.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Idb35ee22e605bd0a8f456a2eca56904936d791d2
@mox669 mox669 force-pushed the dev/multi-host-impl branch from b7badaa to 994603c Compare May 14, 2025 15:03
gtmills and others added 10 commits May 14, 2025 15:41
ResetToDefaultsType states remove in 2Q24, it is now 2Q25 so let's do
that.

Don't see this used in any of our code.

More of the history can be found on the commit adding the correct
parameter type ResetType [1].

[1]: openbmc@9970e93

Tested: Builds. Removes code only, changes a comment. Just a
        crazy amount of formatting for some reason.

Change-Id: Ic8bc941ac98bec398972de979eef336b9faae21f
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
Change:
* Return 200 OK in a dump when doing ClearLog.

Reason:
* Status Code 204 No Content causes user confusion when using things
  like curl.
* ClearLog is an Action, so the relevant section of the spec is
  "Table - POST (action) status codes".

Tested:
* Ran the ast2600-evb on QEMU and verified that the ClearLog dump for
  Managers and Systems returned a 200 status code along with the
  expected response data.

[Manager Dump]
```
yahanc@amyc:~$ curl -k -u root:0penBmc -X POST https://127.0.0.1:2443/\
redfish/v1/Managers/bmc/LogServices/Dump/Actions/LogService.ClearLog \
-w "%{http_code}\n"
{
  "@Message.ExtendedInfo": [
    {
      "@odata.type": "#Message.v1_1_1.Message",
      "Message": "The request completed successfully.",
      "MessageArgs": [],
      "MessageId": "Base.1.19.Success",
      "MessageSeverity": "OK",
      "Resolution": "None."
    }
  ]
}200
yahanc@amyc:~$
```
[Manager FaultLog]
```
yahanc@amyc:~$ curl -k -u root:0penBmc -X POST https://127.0.0.1:2443/\
redfish/v1/Managers/bmc/LogServices/FaultLog/Actions/\
LogService.ClearLog -w "%{http_code}\n"
{
  "@Message.ExtendedInfo": [
    {
      "@odata.type": "#Message.v1_1_1.Message",
      "Message": "The request completed successfully.",
      "MessageArgs": [],
      "MessageId": "Base.1.19.Success",
      "MessageSeverity": "OK",
      "Resolution": "None."
    }
  ]
}200
yahanc@amyc:~$
```
[System EventLog]
```
yahanc@amyc:~$ curl -k -u root:0penBmc -X POST https://127.0.0.1:2443/\
redfish/v1/Systems/system/LogServices/EventLog/Actions/\
LogService.ClearLog -w "%{http_code}\n"
{
  "@Message.ExtendedInfo": [
    {
      "@odata.type": "#Message.v1_1_1.Message",
      "Message": "The request completed successfully.",
      "MessageArgs": [],
      "MessageId": "Base.1.19.Success",
      "MessageSeverity": "OK",
      "Resolution": "None."
    }
  ]
}200
yahanc@amyc:~$
```

Change-Id: I85cde45ce5063365866a4b2e76c3b55de7c10e11
Signed-off-by: Amy Chang <yahanc@nvidia.com>
Currently, the UpdateService uses the same endpoint
"/redfish/v1/UpdateService/update" for both "application/octet-stream"
and "multipart/form-data" HTTP push methods. This change introduces a
dedicated endpoint "/redfish/v1/UpdateService/update-multipart" to
handle multipart firmware updates separately, aligning with the Redfish
spec recommendations[1] and Section 3.1.2 Multipart HTTP push update in
Redfish FW Update White Paper [2].

Spec examples in [1], Section 7.12, shows '/update-multipart' endpoint
as a dedicated URI for MultipartHttpPushUri.

[1] https://www.dmtf.org/sites/default/files/standards/documents/DSP0266_1.22.0.pdf
[2] https://www.dmtf.org/sites/default/files/standards/documents/DSP2062_1.0.2.pdf

Tested:
- Verified GET on UpdateService
```
curl -k https://user:pass@<bmc-ip>/redfish/v1/UpdateService
...
"MultipartHttpPushUri": "/redfish/v1/UpdateService/update-multipart",
...
```
- Verified MultipartPushURI update using the new URI.
```
curl -X POST -k https://user:pass@<bmc-ip>/redfish/v1/UpdateService/update-multipart --form 'UpdateParameters={"Targets":["/redfish/v1/Managers/bmc"]};type=application/json' --form "UpdateFile=@<fwpkg>;type=application/octet-stream"
{
  "@odata.id": "/redfish/v1/TaskService/Tasks/1",
  "@odata.type": "#Task.v1_4_3.Task",
  "Id": "1",
  "TaskState": "Running",
  "TaskStatus": "OK"
}
```

Change-Id: I477d7d64571113079d51bff9f188cfa776e6dafa
Signed-off-by: Rajeev Ranjan <ranjan.rajeev1609@gmail.com>
When BMC reboots or bmcweb restarts, the persistent subscriptions may
not be loaded properly but they may still be in the file.

Later on if BMC reboots or bmcweb restarts, those unloaded subscriptions
may potentially and unexpectedly cause the reload into the active
subscriptions.

The key cause is due to the compiler evaluation order for the function
arguments where the last argument is evaluated and pushed into the stack
first.  As the result, the first argument `newSub->id` may already be
invalid after the last argument `std::make_shared<>(std::move(*newSub))`
is evaluated and pushed into the parameter stack [1].
This may cause the failure of `subscriptionsConfigMap.emplace()` and
results in the missing instantiation of the persistent subscriptions.

Tested:
- Create many subscriptions
- GET subscriptions
```
curl -k -X GET https://${bmc}/redfish/v1/EventService/Subscriptions
{
  "@odata.id": "/redfish/v1/EventService/Subscriptions",
  "@odata.type": "#EventDestinationCollection.EventDestinationCollection",
  "Members": [
    {
      "@odata.id": "/redfish/v1/EventService/Subscriptions/1187258741"
    },
    ...
    {
      "@odata.id": "/redfish/v1/EventService/Subscriptions/949306789"
    }
  ],
  "Members@odata.count": 6,
  "Name": "Event Destination Collections"
}
```
- Restart bmcweb
- GET subscriptions again and check whether they are the same.
- Sometimes, none or only a few may be instantiated like

```
 curl -k -X GET https://${bmc}/redfish/v1/EventService/Subscriptions
{
  "@odata.id": "/redfish/v1/EventService/Subscriptions",
  "@odata.type": "#EventDestinationCollection.EventDestinationCollection",
  "Members": [
    {
      "@odata.id": "/redfish/v1/EventService/Subscriptions/1187258741"
    }
  ],
  "Members@odata.count": 1,
  "Name": "Event Destination Collections"
}
```
- However, the file `/home/root/bmcweb_persistent_data.json` still has
  the old entries.

- Also verify Redfish Service Validator to pass

[1] https://github.com/openbmc/bmcweb/blob/0c814aa604b36cff01b495f9c335f981c7be83be/include/persistent_data.hpp#L184

Change-Id: Ia8a3c1bd3d4f4e479b599077ba8f26e47f8d22ef
Signed-off-by: Myung Bae <myungbae@us.ibm.com>
Addressed the below requirements for security GAP

1) PrivilegeRegistry is now enforced for all users and all expanded
   resources. If a user lacks access, the node will not be expanded.

2) If a user with Operator privilege calls '/redfish/v1?$expand',
   the response includes only resources the user has access to.

3) 'ReadOnly' and 'Operator' roles can expand, but not into nodes
   they lack privileges for.

4) Expand is completely disallowed without authentication. Requests
   without valid credentials receive 401 Unauthorized.

Testing:
Tested and verified that users can access only authorized resources.
Unauthorized access and unauthenticated expand requests are blocked.

Change-Id: Ic1c2761f30db73a2884cdecdb8eb08168446523b
Signed-off-by: Chandramohan Harkude <chandramohan.harkude@gmail.com>
Skip failing system URI with 500 Internal Error  if the service is
unreachable which could occur when the D-Bus service is not available.

Redfish Validator passed for gb200nvl-obmc

Change-Id: I1a746c666aba021532acea1c8f83a73c2279fa3e
Signed-off-by: Aishwary Joshi <aishwaryjoshi31@gmail.com>
The name property of EM satellite config will be used as prefix for
aggregation. This can help when we have multi satmc configuration and
RFA has to handle multiple prefixes

Tested
EM Configs
```
        {
            "Hostname": "10.0.2.2",
            "Port": "8000",
            "Name": "sat0",
            "Type": "SatelliteController",
            "AuthType": "None"
        }
```

Aggregation Responses
```
curl -k -u root:0penBmc https://localhost:2443/redfish/v1/AggregationService/AggregationSources/
{
  "@odata.id": "/redfish/v1/AggregationService/AggregationSources",
  "@odata.type": "#AggregationSourceCollection.AggregationSourceCollection",
  "Members": [
    {
      "@odata.id": "/redfish/v1/AggregationService/AggregationSources/sat0"
    }
  ],
  "Members@odata.count": 1,
  "Name": "Aggregation Source Collection"
}
```

Resource Aggregation
```
curl -k -u root:0penBmc https://localhost:2443/redfish/v1/Systems
{
  "@odata.id": "/redfish/v1/Systems",
  "@odata.type": "#ComputerSystemCollection.ComputerSystemCollection",
  "Members": [
    {
      "@odata.id": "/redfish/v1/Systems/system"
    },
    {
      "@odata.id": "/redfish/v1/Systems/sat0_system1"
    }
  ],
  "Members@odata.count": 2,
  "Name": "Computer System Collection"
}
```

Change-Id: I2e64436c9e1858825dc71fad66293144fa55f83e
Signed-off-by: Rohit PAI <ropai@nvidia.com>
1. Support multi SatMC configuration
2. Prefix generation from EM config

Change-Id: If03f45ea5d88b23bd7ba6e61577b1ab177eb7fa0
Signed-off-by: Rohit PAI <ropai@nvidia.com>
Currently, parse_registries.py assumes the description property exists
in every registry json it parses. However, according to the spec [1]
it is not a required property, so it may not exist, see [2].
Switch it to optional and use an empty string as a default value.

Testing:
Ran the script and made sure the generated files remain unchanged.

[1] https://redfish.dmtf.org/schemas/v1/MessageRegistry.v1_4_0.json
[2] Run: `curl https://redfish.dmtf.org/schemas/v1/MessageRegistry.v1_4_0.json | jq .definitions.MessageRegistry.required`

Change-Id: I3e9ba84bbdb9ba5e6ed8b00cde48c15a1b5abba6
Signed-off-by: Igor Kanyuka <ifelmail@gmail.com>
Rather than having to manually hook code for registries, add a small
registration function to the registry header and use this registration
results throughout the registry interactions.

Tested:

Confirmed registries have same behavior.

```
$ curl -s -k https://localhost:18080/redfish/v1/Registries/ | jq '.Members | map(."@odata.id")'
[
  "/redfish/v1/Registries/Base",
  "/redfish/v1/Registries/HeartbeatEvent",
  "/redfish/v1/Registries/OpenBMC",
  "/redfish/v1/Registries/ResourceEvent",
  "/redfish/v1/Registries/TaskEvent",
  "/redfish/v1/Registries/Telemetry"
]
```

```
$ curl -s -k https://localhost:18080/redfish/v1/Registries/TaskEvent/TaskEvent | jq ".Messages | keys"
[
  "TaskAborted",
  "TaskCancelled",
  "TaskCompletedOK",
  "TaskCompletedWarning",
  "TaskPaused",
  "TaskProgressChanged",
  "TaskRemoved",
  "TaskResumed",
  "TaskStarted"
]
```

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Iaa355420736a2587d9da4e995208d579443ca9b8
@mox669 mox669 force-pushed the dev/multi-host-impl branch 3 times, most recently from 5fb619f to d63b2a8 Compare May 21, 2025 20:26
mox669 added 7 commits May 22, 2025 21:35
Add support for multi-host GET, POST and PATCH
request handling under the
/redfish/v1/Systems/{computerSystemId}/ redfish resource.

The change implements the getComputerSystemIndex function which
leverages the xyz.openbmc_project.ManagedHost interface to retrieve the
index corresponding to the host the request was made for, when
on a multi-host machine. On single-host the index always defaults
to 0. It is not the perfect solution, but it is a starting point
to introduce multi-host support to bmcweb, allowing for power control,
via redfish and in general something we can build from.
More efficient ways of doing things are already discussed,
but will need more time to design properly.

The implementation relies on the
experimental-redfish-multi-computer-system meson flag to give bmcweb an
indication, whether it is running on single- or multi-host and to drop
unsupported redfish resources for the time being.

All multi-host supported redfish URIs can be found in this listing:
https://gerrit.openbmc.org/c/openbmc/bmcweb/+/76118

Tested:
GET route has been tested with redfish service validator in qemu for
the romulus and yosemite4 machine. Validator passed, no regression
observed.

POST route has been manually tested in web-ui on single-host hardware.
All possible power controls worked as expected. For multi-host this
was tested manually with curl in qemu. After requesting the expected
changes have been observed on dbus.

PATCH route has been requested via curl
manually both on multi- and single-host for every property, that this
patch implements. After each request the
expected change has been observed on dbus.

Change-Id: I67c17c3dd7a354fa9a2ebbc56d4def7a7e788909
Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
Add support for multi-host to get a valid collection upon requesting

/redfish/v1/Systems/{computerSystemId}/LogServices/

redfish resource.

All multi-host supported redfish URIs can be found in this listing:
https://gerrit.openbmc.org/c/openbmc/bmcweb/+/76118

Tested:
Redfish service validation succeeded on romulus and yosemite4. In
addition the route has been curled to see if the correct collection is
returned.

Change-Id: Ic01cdfb18e1c219bf1fc2e0343a45d8ca5d4fa0a
Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
Add support for multi-host for all GET and POST method requests under

/redfish/v1/Systems/{computerSystemId}/LogServices/PostCodes/

redfish resource.

Tested:
Redfish-service-validation passes on single-host machine as well as on
yv4 in qemu.

Every postcode entry is displayed in web-ui on single-host and shown
in the curl output when requested on yv4 qemu.

POST has been tested on single-host hardware inside web-ui and yv4 qemu
machine with curl. (Postcodes have been copied over to the qemu machine
manually from a single-host machine). No regressions observed.
The postcode dir for the specific host is cleared successfully
on both single- and multi-host machine after the POST.

Change-Id: Ie04cb160a1f2756a04be68e6675a6cecc5f09117
Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
Add support for multi-host for all GET and POST method requests under

/redfish/v1/Systems/{computerSystemId}/LogServices/HostLogger/

redfish resource.

Testing: TBD

Change-Id: I026be8106f2accbb77d8d40749f502f3162ad04b
Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
This change adds multi-host support in manager.hpp.
Mainly returning all valid redfish links for the ManagerForServers
array. In addition we opt out of calling getMainChassisId when
on multi-host. Needs more clarification what exactly should be
returned for that, if anything.

Testing: TBD

Change-Id: Ia73cabc23cd87128a59df5c7b16af0bf87462925
Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
This is a simple refactor in handleComputerSystemCollection
to use boost::urls::format instead of the crow util function
appendUrlPieces.

Tested: Query the route with curl and check if it still responds
with a valid collection.

Change-Id: If9c5f6dc8672c00b94db296d5968f756598a05e7
Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
Added the missing copyright comment at top of the file.

Tested: Code compiles.

Change-Id: I7dfd32c9bb26223e7dafe5ab4da7aad6eabc116c
Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
@mox669 mox669 force-pushed the dev/multi-host-impl branch from d63b2a8 to b1c1668 Compare May 22, 2025 19:36
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.