{"id":18368713,"url":"https://github.com/openbmc/phosphor-nvme","last_synced_at":"2025-04-10T19:38:24.263Z","repository":{"id":64289036,"uuid":"188269099","full_name":"openbmc/phosphor-nvme","owner":"openbmc","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-03T22:09:16.000Z","size":320,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-03T22:30:09.210Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openbmc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-23T16:20:51.000Z","updated_at":"2025-03-03T21:55:42.000Z","dependencies_parsed_at":"2023-01-15T08:15:25.866Z","dependency_job_id":"a6bfa0fb-5997-43b6-b826-d73f9a333b69","html_url":"https://github.com/openbmc/phosphor-nvme","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openbmc%2Fphosphor-nvme","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openbmc%2Fphosphor-nvme/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openbmc%2Fphosphor-nvme/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openbmc%2Fphosphor-nvme/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openbmc","download_url":"https://codeload.github.com/openbmc/phosphor-nvme/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248281427,"owners_count":21077423,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T23:27:07.409Z","updated_at":"2025-04-10T19:38:24.243Z","avatar_url":"https://github.com/openbmc.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phosphor-nvme\n\n## Introduction\n\nphosphor-nvme is the nvme manager service maintains for NVMe drive information\nupdate and related notification processing service. The service update\ninformation to `xyz/openbmc_project/Nvme/Status.interface.yaml`,\n`xyz/openbmc_project/Sensor/Value.interface.yaml` and other interfaces in\n`xyz.openbmc_project.Inventory.Manager`.\n\n## General usage\n\nThe service `xyz.openbmc_project.nvme.manager` provides object on D-Bus:\n\n- /xyz/openbmc_project/sensors/temperature/nvme(index)\n\nwhere object implements interface `xyz.openbmc_project.Sensor.Value`.\n\nNVMe drive export as sensor and sensor value is temperature of drive. It can get\nthe sensor value of the drive through ipmitool command `sdr elist` if the\ncorresponding settings in the sensor map are configured correctly. For example:\n\n- To get sensor value:\n\n  ```sh\n  ### With ipmi command on BMC\n  ipmitool sdr elist\n  ```\n\nThe service also updates other NVMe drive information to D-bus\n`xyz.openbmc_project.Inventory.Manager`. The service\n`xyz.openbmc_project.Inventory.Manager` provides object on D-Bus:\n\n- /xyz/openbmc_project/inventory/system/chassis/motherboard/nvme(index)\n\nwhere object implements interfaces:\n\n- xyz.openbmc_project.Inventory.Item\n- xyz.openbmc_project.Inventory.Decorator.Asset\n- xyz.openbmc_project.Nvme.Status\n\nInterface `xyz.openbmc_project.Nvme.Status` with the following properties:\n\n| Property          | Type   | Description                                  |\n| ----------------- | ------ | -------------------------------------------- |\n| SmartWarnings     | string | Indicates smart warnings for the state       |\n| StatusFlags       | string | Indicates the status of the drives           |\n| DriveLifeUsed     | string | A vendor specific estimate of the percentage |\n| TemperatureFault  | bool   | If warning type about temperature happened   |\n| BackupdrivesFault | bool   | If warning type about backup drives happened |\n| CapacityFault     | bool   | If warning type about capacity happened      |\n| DegradesFault     | bool   | If warning type about degrades happened      |\n| MediaFault        | bool   | If warning type about media happened         |\n\nInterface `xyz.openbmc_project.Inventory.Item` with the following properties:\n\n| Property | Type | Description                        |\n| -------- | ---- | ---------------------------------- |\n| Present  | bool | Whether or not the item is present |\n\nInterface `xyz.openbmc_project.Inventory.Decorator.Asset` with the following\nproperties:\n\n| Property     | Type   | Description            |\n| ------------ | ------ | ---------------------- |\n| SerialNumber | string | The item serial number |\n| Manufacturer | string | The item manufacturer  |\n\nEach property in the inventory manager can be obtained via the busctl\nget-property command. For example:\n\n- To get property Present:\n\n  ```sh\n  ### With busctl on BMC\n  busctl get-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/nvme0 xyz.openbmc_project.Inventory.Item Present\n  ```\n\n## Configuration file\n\nThere is a JSON configuration file `nvme_config.json` for drive index, bus ID,\nand the LED object path and bus name for each drive. For example,\n\n```json\n{\n  \"config\": [\n    {\n      \"NVMeDriveIndex\": 0,\n      \"NVMeDriveBusID\": 16,\n      \"NVMeDriveFaultLEDGroupPath\": \"/xyz/openbmc_project/led/groups/led_u2_0_fault\",\n      \"NVMeDriveLocateLEDGroupPath\": \"/xyz/openbmc_project/led/groups/led_u2_0_locate\",\n      \"NVMeDriveLocateLEDControllerBusName\": \"xyz.openbmc_project.LED.Controller.led_u2_0_locate\",\n      \"NVMeDriveLocateLEDControllerPath\": \"/xyz/openbmc_project/led/physical/led_u2_0_locate\",\n      \"NVMeDrivePresentPin\": 148,\n      \"NVMeDrivePwrGoodPin\": 161\n    },\n    {\n      \"NVMeDriveIndex\": 1,\n      \"NVMeDriveBusID\": 17,\n      \"NVMeDriveFaultLEDGroupPath\": \"/xyz/openbmc_project/led/groups/led_u2_1_fault\",\n      \"NVMeDriveLocateLEDGroupPath\": \"/xyz/openbmc_project/led/groups/led_u2_1_locate\",\n      \"NVMeDriveLocateLEDControllerBusName\": \"xyz.openbmc_project.LED.Controller.led_u2_1_locate\",\n      \"NVMeDriveLocateLEDControllerPath\": \"/xyz/openbmc_project/led/physical/led_u2_1_locate\",\n      \"NVMeDrivePresentPin\": 149,\n      \"NVMeDrivePwrGoodPin\": 162\n    }\n  ],\n  \"threshold\": [\n    {\n      \"criticalHigh\": 70,\n      \"criticalLow\": 0,\n      \"maxValue\": 70,\n      \"minValue\": 0\n    }\n  ]\n}\n```\n\n- config\n  - NvmeDriveIndex: The index of the NVMe drive, which will be displayed in the\n    object path.\n  - NVMeDriveBusID: The bus id of the NVMe drive, since it communicates with\n    SMBus.\n  - NVMeDriveFaultLEDGroupPath: Object path of fault LED in LED Group Manager.\n  - NVMeDriveLocateLEDGroupPath: Object path of locate LED in LED Group Manager.\n  - NVMeDriveLocateLEDControllerBusName: D-Bus name of locate LED in LED\n    Controller.\n  - NVMeDriveLocateLEDControllerPath: Object path of locate LED in LED\n    Controller.\n  - NVMeDrivePresentPin: Gpio present pin of NVMe drive.\n  - NVMeDrivePwrGoodPin: Gpio Power good pin of NVMe drive.\n- threshold\n  - criticalHigh: Upper critical threshold.\n  - criticalLow: Lower critical threshold.\n  - maxValue: Sensor maximum value.\n  - minValue: Sensor value.\n\n## Process\n\n1. It will register a D-bus called `xyz.openbmc_project.nvme.manager`\n   description above.\n2. Obtain the drive index, bus ID, GPIO present pin, power good pin and fault\n   LED object path from the json file mentioned above.\n3. Each cycle will do following steps:\n   1. Check if the present pin of target drive is true, if true, means drive\n      exists and go to next step. If not, means drive does not exists and remove\n      object path from D-bus by drive index.\n   2. Check if the power good pin of target drive is true, if true means drive\n      is ready then create object path by drive index and go to next step. If\n      not, means drive power abnormal, turn on fault LED and log in journal.\n   3. Send a NVMe-MI command via SMBus Block Read protocol by bus ID of target\n      drive to get data. Data get from NVMe drives are \"Status Flags\", \"SMART\n      Warnings\", \"Temperature\", \"Percentage Drive Life Used\", \"Vendor ID\", and\n      \"Serial Number\".\n   4. The data will be set to the properties in D-bus.\n\nThis service will run automatically and look up NVMe drives every second.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenbmc%2Fphosphor-nvme","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenbmc%2Fphosphor-nvme","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenbmc%2Fphosphor-nvme/lists"}