|
1 | 1 | # Dump SLS Information
|
2 | 2 |
|
3 |
| -Perform a dump of the System Layout Service \(SLS\) database and an encrypted dump of the credentials stored in Vault. |
| 3 | +Perform a dump of the System Layout Service \(SLS\) database. |
4 | 4 |
|
5 |
| -This procedure will create three files in the current directory \(private\_key.pem, public\_key.pem, sls\_dump.json\). These files should be kept in a safe and secure place as the private key can decrypt the encrypted passwords stored in the SLS dump file. |
| 5 | +This procedure will create the file `sls_dump.json` in the current directory. |
6 | 6 |
|
7 | 7 | This procedure preserves the information stored in SLS when backing up or reinstalling the system.
|
8 | 8 |
|
9 |
| -### Prerequisites |
| 9 | +## Prerequisites |
10 | 10 |
|
11 |
| -This procedure requires administrative privileges. |
| 11 | +- The Cray Command Line Interface is configured. See [Configure the Cray CLI](../configure_cray_cli.md). |
| 12 | +- This procedure requires administrative privileges. |
12 | 13 |
|
13 |
| -### Procedure |
| 14 | +## Procedure |
14 | 15 |
|
15 |
| -1. Use the get\_token function to retrieve a token to validate requests to the API gateway. |
16 |
| - |
17 |
| - ```bash |
18 |
| - function get_token () { |
19 |
| - curl -s -S -d grant_type=client_credentials \ |
20 |
| - -d client_id=admin-client \ |
21 |
| - -d client_secret=`kubectl get secrets admin-client-auth -o jsonpath='{.data.client-secret}' | base64 -d` \ |
22 |
| - https://api-gw-service-nmn.local/keycloak/realms/shasta/protocol/openid-connect/token | jq -r '.access_token' |
23 |
| - } |
24 |
| - ``` |
25 |
| - |
26 |
| -2. Generate a private and public key pair. |
27 |
| - |
28 |
| - Execute the following commands to generate a private and public key to use for the dump. |
29 |
| - |
30 |
| - ```bash |
31 |
| - openssl genpkey -out private_key.pem -algorithm RSA -pkeyopt rsa_keygen_bits:2048 |
32 |
| - openssl rsa -in private_key.pem -outform PEM -pubout -out public_key.pem |
33 |
| - ``` |
34 |
| - |
35 |
| - The above commands will create two files the private key private\_key.pem file and the public key public\_key.pem file. |
36 |
| - |
37 |
| - Make sure to use a new private and public key pair for each dump operation, and do not reuse an existing private and public key pair. The private key should be treated securely because it will be required to decrypt the SLS dump file when the dump is loaded back into SLS. Once the private key is used to load state back into SLS, it should be considered insecure. |
38 |
| - |
39 |
| -3. Perform the SLS dump. |
40 |
| - |
41 |
| - The SLS dump will be stored in the sls\_dump.json file. The sls\_dump.json and private\_key.pem files are required to perform the SLS load state operation. |
42 |
| - |
43 |
| - ```bash |
44 |
| - curl -X POST \ |
45 |
| - https://api-gw-service-nmn.local/apis/sls/v1/dumpstate \ |
46 |
| - -H "Authorization: Bearer $(get_token)" \ |
47 |
| - -F public_key=@public_key.pem > sls_dump.json |
48 |
| - ``` |
| 16 | +(`ncn-mw#`) Perform the SLS dump. |
| 17 | +The SLS dump will be stored in the `sls_dump.json` file. The `sls_dump.json` file is required to perform the SLS load state operation. |
49 | 18 |
|
| 19 | +```bash |
| 20 | +cray sls dumpstate list --format json > sls_dump.json |
| 21 | +``` |
0 commit comments