Update the location-based component name (xname) for a standard rack node within the system.
An authentication token has been retrieved.
ncn# function get_token () {
curl -s -S -d grant_type=client_credentials \
-d client_id=admin-client \
-d client_secret=`kubectl get secrets admin-client-auth -o jsonpath='{.data.client-secret}' | base64 -d` \
https://api-gw-service-nmn.local/keycloak/realms/shasta/protocol/openid-connect/token | jq -r '.access_token'
}
The Cray command line interface (CLI) tool is initialized and configured on the system. See Configure the Cray CLI.
Set variables for the new and old component name (xname) locations.
The NEWPORT
variable is the component name (xname) of the port that the node BMC will be connected to after it is moved.
The xname is typically something similar to x3003c0w41j42
. The OLDENDPOINT
variable is the xname of the BMC at its old
location (for example, x3006c0r41b0
).
ncn# NEWPORT=x3003c0w41j42
ncn# OLDENDPOINT=x3006c0r41b0
Generate and upload new management switch port information to the System Layout Service (SLS) and save it to a file.
This step may be skipped if this is a direct swap of nodes, where both the source and destination are already populated.
Query SLS to generate content for the new file.
Query the old port in SLS and replace the old component name (xname) (x3000c0w31j31
in this example) with the name of the current location of the hardware in the system.
ncn# cray sls hardware describe x3000c0w31j31 --format json
Example output:
{
"TypeString": "MgmtSwitchConnector",
"Parent": "x3000c0w31",
"Type": "comptype_mgmt_switch_connector",
"Xname": "x3000c0w31j31",
"Class": "River",
"ExtraProperties": {
"NodeNics": [
"x3000c0s24b0"
],
"VendorName": "ethernet1/1/31"
}
}
Create the new file with the updated location of the node.
The following is an example file. The Parent
, Xname
, NodeNics
, and VendorName
properties must be
adjusted to match the new location of the node. The VendorName
property may be obtained by logging into
the switch that the node will be connected to.
{
"Parent": "x3003c0w41",
"Xname": "x3003c0w41j42",
"TypeString": "MgmtSwitchConnector",
"Type": "comptype_mgmt_switch_connector",
"Class": "River",
"ExtraProperties": {
"NodeNics": [
"x3004c0r42b0"
],
"VendorName": "ethernet1/1/42"
}
}
Upload the updated node settings captured in the new JSON file.
Replace the CUSTOM_FILE
value in the following command with the name of the file created in the previous step.
ncn# curl -i -X PUT -H "Authorization: Bearer $(get_token)" https://api-gw-service-nmn.local/apis/sls/v1/hardware/$NEWPORT -d @CUSTOM_FILE
Delete the existing redfishEndpoint
and ethernetInterfaces
from the Hardware State Manager (HSM).
Delete the redfishEndpoint
.
ncn# cray hsm inventory redfishEndpoints delete $OLDENDPOINT -- format toml
Expected output resembles the following:
message = "deleted 1 entry"
code = 0
Delete the ethernetInterfaces
.
ncn# for ID in $(cray hsm inventory ethernetInterfaces list --format json | jq -r ".[] | select(.ComponentID==\"$OLDENDPOINT\").ID"); do
cray hsm inventory ethernetInterfaces delete $ID --format toml; done
Expected output resembles the following (once for each associated interface that is deleted).
message = "deleted 1 entry"
code = 0