Configuration File Description

ISV users can modify the configuration file device_config.json based on different mother boards so that the edge management system can identify external devices and display external device information. In addition, users can create, delete, mount, and unmount partitions for external storage devices.

Configuration File

The configuration file path is {project_dir}/src/app/add_extend_device. The code directory structure is as follows:

├── device_config.json                 // Configuration file for external device
└── validate_device_config.py          // Script for verifying external device configurations.
The device_config.json configuration template (for details, see Atlas 500 A2 edge station) is as follows. The structure of the configuration file cannot be modified. Otherwise, the edge management system may fail to start. You can add, delete, or modify the configuration of a single device and the primary partition number of the boot device. Redundant device configurations or configurations that do not match any device will be ignored. For details about the parameters, see the parameter description.
{
    "primary_partitions": [
        1,
        2,
        3,
        4,
        5
    ],
    "usb_hub_id": "0bda:5411",
    "extend_info": {
        "u-disk": [   # Type name of an external device
            {
            "platform": "a5080000.hiusbc1",
            "location": "usb2",
            "name": "u-disk2"
            }, # Configuration of a single device.
            {
            "platform": "a5100000.hiusbc2",
            "location": "usb1",
            "name": "u-disk1"
            },
            {
            "platform": "a5180000.hiusbc3",
            "location": "usb0",
            "name": "u-disk0"
            }
        ],
        "eMMC": [
            {
            "platform": "82000000.sdhci0",
            "location": "eMMC1",
            "name": "eMMC"
            },
            {
            "platform": "82010000.sdhci1",
            "location": "SDIO1",
            "name": "SD-card"
            }
        ],
        "DISK": [
            {
            "platform": "a6000000.sata",
            "device": "0:0:0:0",
            "location": "PCIE-0",
            "name": "disk m.2"
            },
            {
            "platform": "a6000000.sata",
            "device": "1:0:0:0",
            "location": "PCIE-1",
            "name": "disk0"
            },
            {
            "platform": "a6000000.sata",
            "device": "2:0:0:0",
            "location": "PCIE-2",
            "name": "disk1"
            }
        ],
        "ethnet": [
            {
            "platform": "a7100000.xge0",
            "location": "PORT1",
            "name": "eth0"
            },
            {
            "platform": "a7200000.xge1",
            "location": "PORT2",
            "name": "eth1"
            }
        ]
    }
}
Table 1 Parameter description

Parameter

Description

primary_partitions

Meaning: primary partition of the boot disk

Type: list

Value: Defaults from 1 to 5. A maximum of 16 partitions can be configured.

Note: After this parameter is configured, partitions in the configuration list cannot be queried by using APIs for querying partition set information or drive details, and deleting partitions. This prevents partitions from being deleted by mistake.

usb_hub_id

Meaning: vendor ID and product ID of a USB hub

Type: string

Value: For example, 0bda:5411, where 0bda is the vendor ID of the USB hub, and 5411 is the product ID of the USB hub. The value can be used to detect USB hub exceptions.

Note: You can run the lsusb command to obtain the value. If the configuration is incorrect, the USB hub exception alarm may be repeatedly triggered.

extend_info

Meaning: external device matching information

Type: dictionary

Value: u-disk, eMMC, DISK, or ethnet.

Note: The key of the dictionary indicates the device type, and the value of the dictionary is the configuration list of the external device.

platform

Meaning: subdirectory name of the device in /sys/devices/platform

Type: string

Note: The edge management system checks whether a device exists in the system based on the value of this parameter.

device

Meaning: directory to which the /sys/block/device _ame/device link points

Type: string

Note: For external devices of the DISK type, if the platform names are the same, different devices cannot be distinguished. In this case, you need to set the directory name to which the /sys/block/device _ame/device link points so that the edge management system can search for the corresponding device.

location

Meaning: location information displayed on the page.

Type: string

Value: You are advised to set location based on the physical location. For example, set location to usb1 for a USB device.

Note: The value of this parameter must be unique for different devices.

name

Meaning: device name displayed on the FusionDirector

Type: string

Value: uppercase letters, lowercase letters, digits, hyphens (-), underscores (_), dots (.), and spaces. You are advised to set the value based on the physical type and physical location number. For example, the value for a USB device can be usb1.

Note: If the configuration does not meet the requirements, the external device information may fail to be queried.

Configuration Description

In the Linux operating system, the /sys/devices/platform directory stores all platform information in the system. You can query the detailed information about a device through the subdirectories in this directory. Each subdirectory's name corresponds to a specific platform device. The following uses Atlas 500 A2 edge station as an example:

  • hiusb corresponds to USB devices.
  • sdhci corresponds to eMMC storage devices.
  • a6000000.sata corresponds to SATA drives.
  • xge corresponds to NICs.

Except for SATA storage drives, physical devices can be identified based on the subdirectory names under the platform directory. For example, a5080000.hiusbc1 is associated with the usb2 port, as shown in the following figure, 82010000.sdhci1 is associated with the SD card slot. The SATA drives can be identified through the drive path information, that is, the directory to which the /sys/block/Storage device drive letter/device directory (soft link) points. 0:0:0:0 indicates M.2, and 1:0:0:0 indicates disk0. 2:0:0:0 indicates disk1.

Figure 1 USB port position

Extended Storage Alarms

The OM SDK supports some alarms of extended storage devices, including alarms indicating that the drive temperature is too high, service life is about to end, the drive cannot be detected, the drive access is blocked, and the USB hub is abnormal. To use the alarm function, configure the device_config.json file. The storage device can be u-disk, eMMC, or DISK. The value range of the location and device fields related to the DISK is (location=PCIE-0, device=0:0:0:0), (location=PCIE-1, device=1:0:0:0), or (location=PCIE-2, device=2:0:0:0)., indicating M.2, DISK0, and DISK1, respectively. To use other alarms for the extended storage, perform operations by referring to Customized Alarms.