cray
command line interface (CLI) is authenticated and configured to talk to system management services.
BOS data can be backed up using an automated script. BOS session templates and BOS v2 options can be restored from the archive files produced by the automated export script.
(ncn-mw#
) Run the following script to perform the export of all BOS data (including session templates and BOS v2 options).
/usr/share/doc/csm/scripts/operations/configuration/export_bos_data.sh
Copy the archive file it outputs to a safe location.
Copy the file generated by the export script on the node where the import procedure is being performed.
(ncn-mw#
) Import all BOS session templates and BOS v2 options.
Modify the following example commands to specify the path to the output file from the automated BOS export script. The file may be a JSON file or a
tgz
file, depending on when the backup was made, because the BOS export tools have had multiple versions. Any file produced by any version of these tools will work as input for this restore procedure.
/usr/share/doc/csm/scripts/operations/configuration/import_bos_data.sh /root/bos-export-20230417181409-oK4WMw.tgz
BOS session templates or BOS v2 options can also be manually exported and imported onto a given system using the Cray CLI tool.
(ncn-mw#
) Create a directory to store the exported BOS data.
Modify the following command to specify the desired directory path.
BOS_EXPORT_DIR="/root/bos-data-manual-export-$(date +%Y%m%d%H%M%S)"
mkdir -pv "${BOS_EXPORT_DIR}"
(ncn-mw#
) Save the current BOS v2 options on the system.
cray bos v2 options list --format json | tee "${BOS_EXPORT_DIR}/options.json"
(ncn-mw#
) List all BOS session templates on the system.
cray bos v2 sessiontemplates list
(ncn-mw#
) Make a subdirectory for the session templates.
mkdir -pv "${BOS_EXPORT_DIR}/templates"
(ncn-mw#
) For each session template that you wish to export, perform the following steps.
Record the name of the template to be exported.
Modify the following command to specify the name of the BOS session template to be exported.
BOS_TEMPLATE_NAME="uan-sessiontemplate-2.0.27"
Write the contents of the session template to a file in the export directory created earlier.
cray bos v2 sessiontemplates describe "${BOS_TEMPLATE_NAME}" --format json |
tee "${BOS_EXPORT_DIR}/templates/${BOS_TEMPLATE_NAME}.json"
Example output:
{
"boot_sets": {
"uan": {
"kernel_parameters": "console=ttyS0,115200 bad_page=panic crashkernel=340M hugepagelist=2m-2g intel_iommu=off intel_pstate=disable iommu=pt ip=nmn0:dhcp numa_interleave_omit=headless numa_zonelist_order=node oops=panic pageblock_order=14 pcie_ports=native printk.synchronous=y quiet rd.neednet=1 rd.retry=10 rd.shell turbo_boost_limit=999 ifmap=net2:nmn0,lan0:hsn0,lan1:hsn1 spire_join_token=${SPIRE_JOIN_TOKEN}",
"node_list": [
"x3000c0s15b0n0"
],
"path": "s3://boot-images/c23f3d5e-223a-4fb9-b305-0c2be8e63615/manifest.json",
"rootfs_provider": "cpss3",
"rootfs_provider_passthrough": "dvs:api-gw-service-nmn.local:300:nmn0",
"type": "s3"
}
},
"cfs": {
"configuration": "uan-config-2.0.0"
},
"enable_cfs": true,
"name": "uan-sessiontemplate-2.0.27"
}
Copy the contents of the export directory to a safe location.
(ncn-mw#
) Copy the contents of the export directory (created from the manual export procedure) to the node where the import procedure is being performed.
Set the BOS_EXPORT_DIR
variable to the path to this directory.
Modify the following command to specify the actual path to the directory.
BOS_EXPORT_DIR=/root/bos-bos-datas-manual-export-20230309121244
(ncn-mw#
) For each BOS session template to be imported, perform the following steps:
Record the name of the template to be imported.
Modify the following command to specify the name of the BOS session template to be exported.
BOS_TEMPLATE_NAME="uan-sessiontemplate-2.0.27"
BOS_TEMPLATE_FILE="${BOS_EXPORT_DIR}/${BOS_TEMPLATE_NAME}.json"
Determine the BOS version of the session template.
/usr/share/doc/csm/scripts/operations/configuration/bos_session_template_version.py "${BOS_TEMPLATE_FILE}"
Example output:
Template 'uan-sessiontemplate-2.0.27' is BOS version 2
Import the session template into BOS.
The command to do this varies depending on the BOS version found in the previous step.
BOS version 1
cray bos v1 sessiontemplate create --file "${BOS_TEMPLATE_FILE}" \
--name "${BOS_TEMPLATE_NAME}"
If successful, the command will output the name of the created session template.
BOS version 2
cray bos v2 sessiontemplates create \
--file <(jq 'del(.name)' "${BOS_TEMPLATE_FILE}") \
"${BOS_TEMPLATE_NAME}" --format json
If successful, the command will output the entire session template in JSON.
(ncn-mw#
) The CLI can also be used to change BOS v2 options to match the values that were exported.
For usage details, run the following:
cray bos v2 options update --help
Since the release of BOS V2, it is recommended not to save or restore the BOS Redis database. Instead, let BOS automatically recreate the databases from scratch. Restoring the database can result in undesired activity, such as node boots or reboots.