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

[FEATURE] Redfish support #2

Open
starbops opened this issue Feb 20, 2024 · 2 comments
Open

[FEATURE] Redfish support #2

starbops opened this issue Feb 20, 2024 · 2 comments
Labels
area/redfish Front-end protocol related and it's Redfish help wanted Extra attention is needed kind/feature New feature proposed/asked

Comments

@starbops
Copy link
Owner

starbops commented Feb 20, 2024

Is your feature request related to a problem? Please describe.

Currently, KubeBMC only supports limited IPMI functionalities for KubeVirt VMs. It would also be helpful to support Redfish as it is newer, feature-rich, and gradually becomes dominant in such areas.

Describe the solution you'd like

A set of Redfish APIs that supports users to communicate with to instruct KubeBMC to:

  • Retrieve power status,
  • Set power on/off/reset,
  • Set boot device, and
  • Mount/unmount virtual media

for KubeVirt VMs.

Describe alternatives you've considered

N/A

Additional context

We could implement the following resources to provide a minimum viable functionalities. Kudos to @rwleea!

{
    "@odata.type": "#ServiceRoot.v1_16_1.ServiceRoot",
    "@odata.id": "/redfish/v1/",
    "Id": "RootService",
    "Name": "Root Service",
    "Vendor": "Contoso",
    "Product": "WidgetDeluxe 8744",
    "RedfishVersion": "1.6.0",
    "UUID": "92384634-2938-2342-8820-489239905423",
    "Systems": {
        "@odata.id": "/redfish/v1/Systems"
    }
}
{
  "@odata.type": "#ComputerSystemCollection.ComputerSystemCollection",
  "Name": "Computer System Collection",
  "@odata.id": "/redfish/v1/Systems",
  "[email protected]": 1,
  "Members": [
    {
      "@odata.id": "/redfish/v1/Systems/1"
    }
  ]
}
{
  "@odata.id": "/redfish/v1/Systems/1",
  "@odata.type": "#ComputerSystem.v1_22_0.ComputerSystem",
  "Id": "1",
  "Name": "My Computer System",
  "UUID": "00000000-0000-0000-0000-000000000000",
  "HostName": "web-srv344",
  "Status": {
    "State": "Enabled",
    "Health": "Warning",
    "HealthRollup": "Warning",
    
  },
  "PowerState": "On",
  "Boot": {
    "BootSourceOverrideEnabled": "Once",
    "BootSourceOverrideMode": "UEFI",
    "BootSourceOverrideTarget": "Pxe",
    "[email protected]": [
      "None",
      "Pxe",
      "Cd",
      "Hdd"
    ]
  },
  "VirtualMedia": {
    "@odata.id": "/redfish/v1/Systems/1/VirtualMedia"
  },
  "Actions": {
    "#ComputerSystem.Reset": {
      "target": "/redfish/v1/Systems/1/Actions/ComputerSystem.Reset",
      "@Redfish.ActionInfo": "/redfish/v1/Systems"
    }
  }
}
{
    "@odata.type": "#ActionInfo.v1_4_1.ActionInfo",
    "Id": "ResetActionInfo",
    "Name": "Reset Action Info",
    "Parameters": [
        {
            "Name": "ResetType",
            "Required": true,
            "DataType": "String",
            "AllowableValues": [
                "On",
                "ForceOff",
                "GracefulShutdown",
                "GracefulRestart",
                "ForceRestart",
                "Nmi",
                "ForceOn",
                "PushPowerButton"
            ]
        }
    ],
    "@odata.id": "/redfish/v1/Systems/1/ResetActionInfo"
}
{
  "@odata.type": "#VirtualMediaCollection.VirtualMediaCollection",
  "@odata.id": "/redfish/v1/Systems/1/VirtualMedia",
  "Name": "Virtual Media Services",
  "Description": "Redfish Manager Virtual Media Services Settings",
  "[email protected]": 1,
  "Members": [
    {
      "@odata.id": "/redfish/v1/Systems/1/VirtualMedia/CD1"
    }
  ]
}
{
  "@odata.type": "#VirtualMedia.v1_6_3.VirtualMedia",
  "@odata.id": "/redfish/v1/Systems/1/VirtualMedia/CD1",
  "Id": "CD1",
  "Name": "Virtual CD",
  "MediaTypes": [
    "CD",
    "DVD"
  ],
  "Image": "http://myserver/mymedia-read-only.iso",
  "ImageName": "mymedia-read-only.iso",
  "ConnectedVia": "URI",
  "Inserted": true,
  "WriteProtected": true,
  "UserName": "admin",
  "Password": "admin",
  "TransferProtocolType": "HTTP",
  "[email protected]": [
    "HTTP",
    "HTTPS"
  ],
  "TransferMethod": "Stream",
  "Actions": {
    "#VirtualMedia.InsertMedia": {
      "target": "/redfish/v1/Systems/1/VirtualMedia/CD1/Actions/VirtualMedia.InsertMedia",
      "@Redfish.ActionInfo": "/redfish/v1/Systems/1/VirtualMedia/CD1/InsertMediaActionInfo"
    },
    "#VirtualMedia.EjectMedia": {
      "target": "/redfish/v1/Systems/1/VirtualMedia/CD1/Actions/VirtualMedia.EjectMedia"
    }
  }
}
{
  "@odata.type": "#ActionInfo.v1_4_1.ActionInfo",
  "@odata.id": "/redfish/v1/Systems/1/VirtualMedia/CD1/InsertMediaActionInfo",
  "Id": "InsertMediaActionInfo",
  "Name": "Insert Media Action Info",
  "Parameters": [
    {
      "Name": "Image",
      "Required": true,
      "DataType": "String"
    },
    {
      "Name": "Inserted",
      "Required": false,
      "DataType": "Boolean"
    },
    {
      "Name": "Writable",
      "Required": true,
      "DataType": "Boolean"
    },
    {
      "Name": "UserName",
      "Required": false,
      "DataType": "String"
    },
    {
      "Name": "Password",
      "Required": false,
      "DataType": "String"
    },
    {
      "Name": "TransferProtocolType",
      "Required": true,
      "DataType": "String",
      "AllowableValues": [
        "HTTP",
        "HTTPS"
      ]
    },
    {
      "Name": "TransferMethod",
      "Required": true,
      "DataType": "String",
      "AllowableValues": [
        "Stream"
      ]
    }
  ]
}
@starbops starbops added kind/feature New feature proposed/asked help wanted Extra attention is needed area/redfish Front-end protocol related and it's Redfish labels Jul 28, 2024
@e-minguez
Copy link

Just FYI https://github.com/openshift-metal3/fakefish have something for faking redfish for KubeVirt instances

@starbops
Copy link
Owner Author

Hey @e-minguez thanks for the pointer. The way FakeFish works looks interesting. I should've found it earlier. Nevertheless, this gave me some ideas...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/redfish Front-end protocol related and it's Redfish help wanted Extra attention is needed kind/feature New feature proposed/asked
Projects
None yet
Development

No branches or pull requests

2 participants