Uploading Input JSON file

Same NPS toolkit VM can be used for multiple deployments or single deployment of single VIM type by uploading respective input.json files. To achieve the same, perform the following steps to keep a clear segregation on the deployments to be performed.

Procedure
  1. Create a directory with any desired name.

    mkdir <deployment1-dir>

  2. Navigate to the newly created directory and copy the input.json file for the deployment to this directory.

    cd <deployment1-dir>

  3. For ease of use, create a file within the directory and update it with the environment variables to be exported as provided below. Ensure the topology name mentioned in the input.json file and the environment variables match.
    vi <deployment1_env_file>
    export API_IP=<NPS Toolkit VM OAM/Customer Network IP address>
    export NPSADMIN=<user name of admin mentioned in the nps_secret.yaml file>
    export NPSPASSWD=<password of admin user mentioned in the nps_secret.yaml file>
    export TOPOLOGY_NAME=<value of the field "topology_name" in the input.json file>
    export VIM_TYPE=<VIM platform type like RHOCP/RHOCP/VMWARE>
    NOTE:

    The user name and password stored in the nps_secret.yaml file under /root/nps2/install are encoded. When running the export command, enter the decoded user name and password to avoid authentication errors.

  4. Run the below command to export the environment variables from anywhere within the NPS Toolkit VM:

    source /root/<deployment1-dir>/<deployment1_env_file>

  5. Upload the Input JSON file using the following command:
    nps upload-json -f <complete directory path and name of your input json file>
    After the Input JSON file is uploaded successfully, the result is displayed as shown in following example:
    [root@npsvm ~]# nps upload-json -f input.json
    Input json uploaded successfully with topology name: cycle2
    +------------+--------------------------------+
    | operation  | status                         |
    +------------+--------------------------------+
    | jsonupload | Uploaded successfully : cycle2 |
    +------------+--------------------------------+
    
  6. Validate the VIM block of the uploaded Input JSON file using the following command:
    nps validate-vim-json
    The validation process is displayed as shown in following example:
    [root@npsvm ~]# nps validate-vim-json
    +---------------+-------------------------------+
    |    Process    |             Status            |
    +---------------+-------------------------------+
    | Json-validate | Process successfully started. |
    +---------------+-------------------------------+
    Check the status using 'nps show --service validate-vim-json'
    
  7. View the status of the VIM block of the Input JSON file validation process using the following command:
    nps show --service validate-vim-json
    The status of the Input JSON file validation process is displayed as shown in following example:
    [root@npsvm ~]# nps show --service validate-vim-json
    +-----------------+----------------------------------------------------------+
    |     Process     | Status                                                   |
    +-----------------+----------------------------------------------------------+
    | Json-validation | {                                                        |
    |                 |     "POD-Name": "cycle2-validate",                       |
    |                 |     "POD-UUID": "872e8912-bfdc-4d0a-821f-4f50fa6d6591",  |
    |                 |     "Status": "Succeeded"                                |
    |                 | }                                                        |
    +-----------------+----------------------------------------------------------+
  8. View the logs of the VIM block of the Input JSON file validation using the following command:
    kubectl logs <name of the pod> -n nps
    The status of the RHOCP configuration validation is displayed as shown in following example:
    [root@npsvm ~]# kubectl logs cycle2-validate -n nps
    rhocp config validation initiated
    IP validation is initiated
    IP validation is successful
    rhocp config validation is successful
    rhocp external storage validation initiated
    rhocp external storage validation is successful
    [root@npsvm ~]#
    NOTE:

    If the validation fails, delete the previous JSON file and upload the new Input JSON file. Go to Step 5 to delete the Input JSON file.

  9. To delete the Input JSON file, do the following:
    1. Run the following command:
      nps delete-json
      The following message is displayed:
      Do you really want to delete the Topology - Y/N
    2. Press Y to delete or N to cancel.
    3. Press Enter.