Skip to content

[FEATURE] Reflect real virtual machine information in Redfish resources #45

Open
@starbops

Description

@starbops

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

Currently, we only populate two fields in each virtual machine's ComputerSystem resource:

  • .Name: name of the virtual machine
  • .PowerState: current power state of the virtual machine

For example:

{
  "@odata.context": "/redfish/v1/$metadata#ComputerSystem.ComputerSystem",
  "@odata.id": "/redfish/v1/Systems/1",
  "@odata.type": "#ComputerSystem.v1_22_0.ComputerSystem",
  "Actions": {
    "#ComputerSystem.AddResourceBlock": {},
    "#ComputerSystem.Decommission": {},
    "#ComputerSystem.RemoveResourceBlock": {},
    "#ComputerSystem.Reset": {
      "target": "/redfish/v1/Systems/1/Actions/ComputerSystem.Reset",
      "title": "Reset"
    },
    "#ComputerSystem.SetDefaultBootOrder": {}
  },
  "AssetTag": "",
  "Bios": {},
  "Boot": {
    "BootOptions": {},
    "BootSourceOverrideEnabled": "Disabled",
    "BootSourceOverrideMode": "Legacy",
    "BootSourceOverrideTarget": "Hdd",
    "Certificates": {}
  },
  "BootProgress": {},
  "Certificates": {},
  "Composition": {},
  "Description": "Computer System",
  "EthernetInterfaces": {},
  "FabricAdapters": {},
  "GraphicalConsole": {},
  "GraphicsControllers": {},
  "HostWatchdogTimer": {
    "FunctionEnabled": false,
    "Status": {},
    "TimeoutAction": ""
  },
  "HostedServices": {
    "StorageServices": {}
  },
  "Id": "1",
  "IdlePowerSaver": {},
  "IndicatorLED": "Unknown",
  "KeyManagement": {
    "KMIPCertificates": {}
  },
  "LastResetTime": "0001-01-01T00:00:00Z",
  "Links": {
    "HostingComputerSystem": {}
  },
  "LogServices": {},
  "Manufacturer": "KubeVirt",
  "Memory": {},
  "MemoryDomains": {},
  "MemorySummary": {
    "Metrics": {},
    "Status": {},
    "TotalSystemMemoryGiB": 0
  },
  "Model": "KubeVirt",
  "Name": "default/machine-1",
  "NetworkInterfaces": {
    "@odata.id": "/redfish/v1/Systems/1/NetworkInterfaces"
  },
  "OperatingSystem": "/redfish/v1/Systems/1/OperatingSystem",
  "PartNumber": "",
  "PowerState": "On",
  "ProcessorSummary": {
    "Count": 0,
    "Metrics": {},
    "Status": {}
  },
  "Processors": {},
  "SKU": "",
  "SecureBoot": {},
  "SerialConsole": {
    "IPMI": {},
    "SSH": {},
    "Telnet": {}
  },
  "SerialNumber": "000000000000",
  "SimpleStorage": {
    "@odata.id": "/redfish/v1/Systems/1/SimpleStorage"
  },
  "Status": {},
  "Storage": {
    "@odata.id": "/redfish/v1/Systems/1/Storage"
  },
  "SystemType": "Virtual",
  "USBControllers": {},
  "UUID": "00000000-0000-0000-0000-000000000000",
  "VirtualMedia": {
    "@odata.id": "/redfish/v1/Systems/1/VirtualMedia"
  },
  "VirtualMediaConfig": {}
}

Some of the fields like ProcessorSummary, Memory, NetworkInterfaces, etc. could be filled with real data.

Describe the solution you'd like

With the aid of custom controllers, we should be able to reflect the virtual machine's actual state in the Redfish resources. That being said, some fields do not apply to virtual machines. We should do it in a best-effort manner.

Describe alternatives you've considered

A much simpler way is to return the actual state as a ComputerSystem resource upon queries. Thus we don't have to maintain the intermediate object ourselves and avoid implementing the control loops.

Additional context

This is yet another remaining item from #2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/redfishFront-end protocol related and it's Redfishcomponent/agentRelevant to the virtualized BMCskind/featureNew feature proposed/asked

    Projects

    Status

    Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions