How to import and export of root node keys? See this documentation page: To avoid duplicate CI creation in the CMDB [after tw_model_wipe and revert to standalone], BMC Discovery uses a root node key information export utility which enables you to extract information and the key of root nodes from a machine before reinitialization |
After a tw_model_wipe, restore the root node keys before scanning to avoid duplicates.
Recommendations:
Notes:
1- Preserve the keys: 1.1- ssh to the terminal of the appliance. In case of a cluster execute the following steps below on a single member (any of them, coordinator or not) 1.2- Start a screen session to be able to reconnect to the session in case of a disconnection with the ssh server during the procedure. Run the following command line: screen 1.3- Run the following command line to export the root node keys keys and enter the password for the Discovery "system" user: tw_root_node_key_export root_node_keys.xml
To verify that the procedure was successful, run the following commands: a) Confirm that the tw_root_node_key_export process is no longer running, this command should not output any result (but the one for this grep command only): ps -ef | grep root_node b) The number of keys from the file root_node_keys.xml that was just created should be similar to the number of OSIs in the appliance: grep " <root-node-key-info " root_node_keys.xml | wc -l tail root_node_keys.xml The last two lines in the XML file should look like this:
2- Restore the keys: 2.1- ssh to the terminal of the appliance. In case of a cluster execute the following steps below on a single member (any of them, coordinator or not) 2.2- Start a screen session to be able to reconnect to the session in case of a disconnection with the ssh server during the procedure. The screen command is extremely important for large imports of root node keys, as imports will take much longer than the export. Run the following command line: screen 2.3- Run the following command line and note the number of root node key nodes already existing in the datastore: tw_query --no-headings "search RootNodeKeyInfo" | wc -l 2.4- Go to the folder where the root_node_keys.xml from a previous export resides. Note the results from the following command line, it count the number of keys in the file: grep " <root-node-key-info " root_node_keys.xml | wc -l
2.5- Run the import: tw_root_node_key_import root_node_keys.xml
ps -ef | grep root_node
2.6- Run the following command line and confirm that the result corresponds to the output of the command at step 4 tw_query --no-headings "search RootNodeKeyInfo" | wc -l |