Introduction to Equipment Customization
Customization Purpose
Equipment customization aims to achieve the following objectives:
Customized configuration: After a customer places an order, the server is customized during the equipment testing phase based on specific configuration information provided by the customer. For example, set the server model name and BMC user name.
Clearance and restoration of faulty equipment configuration: When a customer's server is returned to the factory due to a failure, all customer-related configuration information must be thoroughly cleared. By running a customization script without configuration items, the BMC configuration is restored to factory defaults.
Customization Stage
The equipment customization process is deployed as the final stage of the production equipment testing workflow. Its position in the overall production process is shown below.
openUBMC Equipment Customization Workflow
Repository Introduction
The repository for configuring equipment customization items is the same as the one used for configuration import and export.
Repository location: profile_schema
Repository purpose: The schema files carry the data model (attribute definitions and value constraints) for component configuration import and export. Because these attributes are directly oriented to users, they are part of the external interface of the component. Once data definitions are implemented in the schema repository, the component can use the unified verification mechanism for configuration import and export to verify user data (this capability is implemented by the OMS component).
Repository structure:
├── CHANGELOG.md # Change information for this repository
├── CMakeLists.txt # Build configuration, defining the schema installation path
├── README.md # Repository description
├── build.py # Build script
├── conanfile.py
├── conaninfo.py
├── mds
│ └── service.json # Version number of this repository
├── dist
│ └── permissions.ini # Build permission management file
├── schema # Main directory containing component schema files
│ ├── account.json # Component schema file, named after the component. Each component defines its own schema.
│ ├── bios.json
│ └── ...
└── test # Test directoryOverall Customization Workflow
Relationship between equipment customization and configuration import and export:
Equipment customization reuses the existing configuration import and export channels. Customization items also need to be declared within the component schema to leverage the import and export capabilities for verification, distribution, and collection.
Customization data collection name:
CustomSettings: collection of component customization data instances
openUBMC Extended Keywords:
AttributeType: fixed as ImportAndExport during customization
CustomDefault: default value for configuration data
Based on the nature of configuration items, equipment customization in openUBMC is classified into two types of processing workflows:
- Non-sensitive information customization items: These items directly reuse the configuration import and export workflow. New configuration items required for equipment customization are added here to enable batch setting.
- Sensitive information customization items: Customization of sensitive information items is achieved by directly calling Intelligent Platform Management Interface (IPMI) commands within customization scripts (located at
build/manufacture/customize/function/in themanifestrepository).
Note: The distinction between sensitive and non-sensitive information is primarily to comply with company security requirements and prevent the leakage of sensitive user information, which could lead to critical violations.
The figure shows the interaction workflow for sensitive and non-sensitive information items.
The complete customization script execution workflow involves two core stages: the customization process and the verification process.
The customization process writes configuration data to the BMC and makes the data take effect.
Customization entry script: XXX_config.sh
The verification process resets the BMC after the customization is complete. After the BMC is restarted, the previously set customization items are exported again and compared with the expected values to ensure that the customization is accurate. Verification entry script: XXX_verify.sh
Using Equipment Customization
The following describes how to use the equipment customization function in actual application scenarios.
Using Equipment Customization in an OS
Prepare the environment.
Decompress the customization equipment package to any directory in the operating system (OS) and grant the execute permission on the script files.
bashchmod +x *.shCreate the configuration file.
Create the
customset.iniandserial.inifiles:customset.ini: stores all customization configuration parameters.serial.ini: reserved in the current version, which must be left empty.
Verify the configuration file.
Run the following command to check the format of the customization configuration file:
bashcat -A customset.iniImportant notes:
- Line endings must be Unix/Linux format, displayed as dollar signs (`---
Introduction to Equipment Customization
Customization Purpose
Equipment customization aims to achieve the following objectives:
Customized configuration: After a customer places an order, the server is customized during the equipment testing phase based on specific configuration information provided by the customer. For example, set the server model name and BMC user name.
Clearance and restoration of faulty equipment configuration: When a customer's server is returned to the factory due to a failure, all customer-related configuration information must be thoroughly cleared. By running a customization script without configuration items, the BMC configuration is restored to factory defaults.
Customization Stage
The equipment customization process is deployed as the final stage of the production equipment testing workflow. Its position in the overall production process is shown below.
openUBMC Equipment Customization Workflow
Repository Introduction
The repository for configuring equipment customization items is the same as the one used for configuration import and export.
Repository location: profile_schema
Repository purpose: The schema files carry the data model (attribute definitions and value constraints) for component configuration import and export. Because these attributes are directly oriented to users, they are part of the external interface of the component. Once data definitions are implemented in the schema repository, the component can use the unified verification mechanism for configuration import and export to verify user data (this capability is implemented by the OMS component).
Repository structure:
├── CHANGELOG.md # Change information for this repository
├── CMakeLists.txt # Build configuration, defining the schema installation path
├── README.md # Repository description
├── build.py # Build script
├── conanfile.py
├── conaninfo.py
├── mds
│ └── service.json # Version number of this repository
├── dist
│ └── permissions.ini # Build permission management file
├── schema # Main directory containing component schema files
│ ├── account.json # Component schema file, named after the component. Each component defines its own schema.
│ ├── bios.json
│ └── ...
└── test # Test directoryOverall Customization Workflow
Relationship between equipment customization and configuration import and export:
Equipment customization reuses the existing configuration import and export channels. Customization items also need to be declared within the component schema to leverage the import and export capabilities for verification, distribution, and collection.
Customization data collection name:
CustomSettings: collection of component customization data instances
openUBMC Extended Keywords:
AttributeType: fixed as ImportAndExport during customization
CustomDefault: default value for configuration data
Based on the nature of configuration items, equipment customization in openUBMC is classified into two types of processing workflows:
- Non-sensitive information customization items: These items directly reuse the configuration import and export workflow. New configuration items required for equipment customization are added here to enable batch setting.
- Sensitive information customization items: Customization of sensitive information items is achieved by directly calling Intelligent Platform Management Interface (IPMI) commands within customization scripts (located at
build/manufacture/customize/function/in themanifestrepository).
Note: The distinction between sensitive and non-sensitive information is primarily to comply with company security requirements and prevent the leakage of sensitive user information, which could lead to critical violations.
The figure shows the interaction workflow for sensitive and non-sensitive information items.
The complete customization script execution workflow involves two core stages: the customization process and the verification process.
The customization process writes configuration data to the BMC and makes the data take effect.
Customization entry script: XXX_config.sh
The verification process resets the BMC after the customization is complete. After the BMC is restarted, the previously set customization items are exported again and compared with the expected values to ensure that the customization is accurate. Verification entry script: XXX_verify.sh
Using Equipment Customization
The following describes how to use the equipment customization function in actual application scenarios.
Using Equipment Customization in an OS
Prepare the environment.
Decompress the customization equipment package to any directory in the operating system (OS) and grant the execute permission on the script files.
bashchmod +x *.shCreate the configuration file.
Create the
customset.iniandserial.inifiles:customset.ini: stores all customization configuration parameters.serial.ini: reserved in the current version, which must be left empty.
Verify the configuration file.
Run the following command to check the format of the customization configuration file:
bashcat -A customset.iniImportant notes:
- Line endings must be Unix/Linux format, displayed as dollar signs (). Convert non-Unix formats to Unix format.
- No space character is allowed before or after the equal sign (
=).
Any of the aforementioned formatting issues will result in a mismatch between the script customization results and the configuration file content.
Execute the customization workflow.
Perform the following operations in sequence:
Apply the configuration.
bash./XXX_config.sh customset.ini serial.iniVerify the results.
bash./XXX_verify.sh customset.ini serial.iniBoth operations in step 4 (applying the configuration and verifying the results) must be completed for a customization workflow to be considered finished.
Using Equipment Customization Without an OS
Because the equipment customization import script actually calls an IPMI command, the items can be imported without an OS. The procedure is as follows:
- Create a
customset.inifile. You can refer to Server Factory Customization configuration, select the configurations to be customized, and write them into thecustomset.inifile, for example:
BMCSet_MACHINEALIAS=XX- Upload the
customset.inifile to the/tmpdirectory. - Send the import IPMI command:
ipmitool raw 0x30 0x90 0x21 0xf0. - View the customization results:
ipmitool raw 0x30 0x90 0x22 0xef.
A return of00indicates customization in progress.
A return of01indicates customization complete.
Customization Development Example
If you need to develop new non-sensitive information customization items, refer to the following development process.
Defining Customization Requirements
Before development, clarify the list of customization items that the component needs to implement and analyze the corresponding functional points and implementation methods of each item in openUBMC.
Declaring Customization Items
Procedure:
(1) Add CustomSettings field declaration: Add the CustomSettings field in the schema file to declare customization items. This field should be at the same level as the configuration import and export items.
(2) Define the data type: The data type must correspond to the attribute type of the component in the resource tree to ensure that target attribute values are set correctly.
(3) Specify the attribute type: Set the attribute type of the equipment customization item. It is fixed as ImportAndExport.
(4) Configure value constraints: Set value constraints for the equipment customization items.
(5) Set default values: Configure a CustomDefault for each customization item. During the full system package build phase, build tools parse these declarations in the schema file of each component to generate a unified global default configuration file default_settings.json.
Schema example:
{
"type": "object",
"properties": {
"Description": {
"const": "Configurations of XXX"
},
"ConfigData": {
"type": "object",
"properties": {
"XXX": { // Configuration import and export item declaration
"type": "array",
"items": {
"type": "object",
"properties": {
"Attribute1": {
"type": "number",
"AttributeType": "ImportAndExport"
},
"Attribute2": {
"type": "string",
"AttributeType": "ImportAndExport",
"enum": ["NoAction", "Reset", "PowerOff"]
},
"Attribute3": {
"type": "string",
"AttributeType": "ImportAndExport",
"enum": ["NoAction", "Reset"]
}
}
}
},
"CustomSettings": { // Equipment customization item declaration. The name is fixed and must be at the same level as service import and export items.
"type": "object",
"properties": {
"Custom_XXXX1": { // Name of the equipment customization item
"type": "number", // Data type, corresponding to customization item type in .ini
"AttributeType": "ImportAndExport", // Attribute type, fixed as ImportAndExport
"enum": [0, 1, 2], // Value constraints
"CustomDefault": 1 // Default value used to generate default_settings.json during full package build
},
"Custom_XXXX2": {
"type": "string",
"AttributeType": "ImportAndExport",
"enum": ["on", "off"],
"CustomDefault": "on"
}
}
}
}
}
}
}Code Implementation
(1) Add equipment customization code file customize_config.lua (the file name can be changed) to the component repository.
(2) Implement import and export code for equipment customization items.
-- customize_config.lua
local m = {}
-- Equipment customization item import
function m.custom_import(ctx, config)
-- Implement configuration import combined with customization items.
...
end
-- Equipment customization item export. The "config" output parameter contains exported customization items for verification. (This is an example. Implementation can also be handled flexibly via return values.)
function m.custom_export(ctx, config)
-- Implement configuration export combined with customization items.
...
end
return m(3) Integrate the equipment customization workflow into the service import and export entry point.
-- Service configuration import entry function
function c_config_mgmt:import(ctx, config_data)
local cfg = cjson.decode(config_data)
-- Equipment customization import workflow access
local ok, customize_config = pcall(require, 'customize_config')
if ok and customize_config then
if cfg.ConfigData.CustomSettings then -- Checks if CustomSettings exists. If not, equipment import is not performed.
customize_config.custom_import(ctx, cfg)
end
end
-- Service configuration import
local ok, err = pcall(function ()
for k, v in pairs(cfg['ConfigData']) do
if self.config[k] then
self.config[k]:import(ctx, v)
end
end
end)
if not ok then
error(err)
end
end
-- Service configuration export entry function
function c_config_mgmt:export(ctx)
local cfg = {}
cfg.ConfigData = {}
-- Equipment customization export workflow access
local ok, customize_config = pcall(require, 'customize_config')
if ok and customize_config then
customize_config.custom_export(ctx, cfg)
end
-- Service configuration export
local ok, err = pcall(function ()
for k, v in pairs(self.config) do
cfg.ConfigData[k] = v:export()
end
end)
if not ok then
error(err)
end
return cjson.encode(cfg)
endModel-driven Differentiated Customization
Primary Scenarios
An attribute of product A has different default values. Product A needs to support different default configuration values.
Product B has unique customization items. Product B needs to support these items and their default values.
Differentiated Customization Solution
Common customization items (independent of model) are defined in the profile_schema repository, while differentiated customization items are defined in the vpd repository. The processing workflow is as follows:
- Configure differentiated customization attributes in the corresponding product directory within the
vpdrepository. - Obtain the corresponding schema files from both
profile_schemaandvpdrepositories during the build. - Integrate product-specific schema configurations into the corresponding schema files.
- Generate the default configuration
default_settings.jsonbased on the integrated schema files.
Add a schema directory under the corresponding product directory in the vpd repository to store product-specific customization items:
# Planned directory structure for the vpd repository
├── CHANGELOG.md
├── Makefile
├── build.py
├── conanfile.py
├── conaninfo.py
├── mds
├── permissions.ini
└── vendor # Vendor information, such as server vendor and component vendor
├── Aspeed
│ └── bmc_soc
│ ├── ast2500
│ └── ast2600
├── Huawei
│ ├── BMCSoC
│ │ └── hi1711
│ ├── Nic
│ ├── Raid
│ ├── Server
│ │ ├── Ascend
│ │ ├── Kunpeng
│ │ │ ├── BM320
│ │ │ │ ├── PSR
│ │ │ │ ├── platform
│ │ │ │ ├── profile.txt
│ │ │ │ ├── redfish
│ │ │ │ ├── schema # Product-specific customization (default values, attributes)
│ │ │ │ └── web_backend
│ │ │ └── Nic
│ │ │ └── Lom
│ │ ├── Pangea
│ │ ├── TCE
│ │ └── public
│ ├── Ssd
│ └── TianChi
├── Intel
│ ├── Nic
│ └── Raid
├── Mellanox
└── NvidiaSee vendor/Huawei/Server/Kunpeng/TaiShan200_DA123C/schema/bmc_network.json.
{
"type": "object",
"properties": {
"Description": {
"const": "Configurations of bmc_network"
},
"ConfigData": {
"type": "object",
"properties": {
"CustomSettings":{
"type": "object",
"properties": {
"BMCSet_RackInner_SubNet": {
"type": "string",
"Import": false,
"AttributeType": "ImportAndExport",
"CustomDefault": "172.31.0.0"
},
"BMCSet_RackInner_VLAN_ID": {
"type": "integer",
"Import": false,
"AttributeType": "ImportAndExport",
"CustomDefault": 702,
"minimum": 1,
"maximum": 4094
},
"BMCSet_Maint_IPv4": {
"type": "string",
"Import": false,
"AttributeType": "ImportAndExport",
"CustomDefault": "192.168.240.100"
},
"BMCSet_Maint_SubnetMask": {
"type": "string",
"Import": false,
"AttributeType": "ImportAndExport",
"CustomDefault": "255.255.255.0"
}
}
}
}
}
}
}FAQ
How do I use equipment customization?
For details, see Using Equipment Customization.
Can I use equipment customization without entering the OS? Yes. For details, see Using Equipment Customization Without an OS.
Where can I find the
default_settings.jsonfile?Take the S920X20 model as an example. You can find the file in the
manifest/temp/build_S920X20_debug_dev/buildimg/rtos_with_driver/rootfs/opt/bmc/profile_schema/customdirectory of the build environment. Within the BMC system, it can be found in the/opt/bmc/profile_schema/customdirectory.