Run example workflow using Cisco NSO adapter
This quick start uses a locally installed Cisco Crosswork Network Service Orchestrator application and the CWM with the Cisco NSO adapter to show you a basic use case scenario for creating and running a successful workflow. It will guide you through how to install an adapter, create a worker for the workflow execution and run the created workflow to quickly get tangible results in Cisco NSO.
Workflow overview
The purpose of the example workflow is to automatically create a VPN service for two NSO devices.
First, we point to the devices in the data input and then try to perform the NSO check-sync
operation on them. Then, depending on the result:
-
if not in sync, we push a device to perform a
sync-from
, and only then try to create a VPN for it; -
if in sync, we don't perform
sync-from
but directly create a VPN for the device.
If all the steps are executed successfully, the execution engine reports workflow execution completion and displays the final
data input. The results are visible in NSO too. If the engine encounters errors while performing a step, it uses the specified
retry
policy. In case errors persist beyond the retry limits, the engine ends the execution with a Failed status.
Go through the sections below to learn the details of how data input, functions, states, actions, and data filters are defined. If you want to know how the sausage is made, you can read the Create workflow chapter in the Workflow Creator guide.
Prerequisites
-
Cisco NSO 6.0 installed. If you don't have it, follow the installation instructions.
-
CWM installed using OVA. Go to CWM Administrator guide for instructions.
Step 1: Install NSO adapter
To interact with Cisco NSO, CWM needs a dedicated Cisco NSO adapter. Here's how you install it using the CWM API:
Upload NSO adapter file
Procedure
Step 1 |
Get the latest NSO adapter installation file from the CWM Software Package. |
Step 2 |
Go to the CWM User Interface in a browser, and log in using credentials generated upon the installation of CWM. If the application
is hosted locally, then the default address is |
Step 3 |
From the navigation menu on the left, click the swagger icon. |
Step 4 |
In the adapters section, click the |
Step 5 |
In the subsection that appears, click Choose File, select the NSO installation file and click Upload, then click Execute. If the server response code is |
Deploy Cisco NSO adapter
Before you can use the adapter, you need to deploy the uploaded adapter file using the CWM API:
Procedure
Step 1 |
In the CWM API adapters section, click the |
||
Step 2 |
From the server response body, copy the value of the |
||
Step 3 |
In the CWM API adapters section, click the |
||
Step 4 |
Inside the endpoint, click Try it out. Paste the adapter id into the Adapter ID field. |
||
Step 5 |
In the createWorker field, set the |
||
Step 6 |
Click Execute. If the server response code is
|
Step 2: Create secret and resource
To define the resources and secrets to be passed in securely to the Cisco NSO adapter, you need to create a secret and resource in the CWM API. Here's how to do it:
Create secret
Procedure
Step 1 |
In the CWM API secrets section, click the |
Step 2 |
Inside the endpoint, click Try it out, and paste the following data into the Secret to add field:
|
Step 3 |
Click Execute. If the server response code is |
Create resource
Procedure
Step 1 |
In the CWM API resources section, click the |
Step 2 |
Inside the endpoint, click Try it out, and paste the data into the Resource input field (modify if needed to fit your installation):
|
Step 3 |
Click Execute. If the server response code is |
Step 3: Set up NSO example service
The NSO example that we use for the purposes of our workflow is setting up a Layer3 VPN in a service provider MPLS network for two NSO-simulated devices. Here's how you set up the example:
Procedure
Step 1 |
In a terminal, open your main NSO directory and go to
|
Step 2 |
Execute the Makefile by running:
This command will start your local NSO instance and the sample netsim devices. |
Step 3 |
For the example workflow to execute successfully, execute a Sync from on all the netsim devices beforehand:
|
Step 4: Run the workflow
Now that we have the NSO adapter, the worker, and the NSO example all up and running, we can create a workflow in the CWM UI and run the job.
Add new workflow
Procedure
Step 1 |
In the CWM UI, select the Workflows tile from the navigation menu on the left. |
Step 2 |
In the Workflows panel, click Create new workflow. |
Step 3 |
In the Create new workflow modal, provide the required input:
|
Step 4 |
Click Create workflow. |
Run job
Procedure
Step 1 |
In the Workflows panel, enter the newly created workflow definition by clicking its name. |
Step 2 |
Click the Code tab and delete the sample content from the Code field. |
Step 3 |
Download the workflow file using the link below and unzip it. Open the JSON file and copy the contents. Open the file, copy the workflow definition and paste it inside the Code field, then click Save changes. |
Step 4 |
Click Run. |
Step 5 |
Download the data input file using the link below and unzip it. Open the JSON file and copy the contents. In the Run job modal, provide a name for the job and in the Job variables field, paste the copied data input. |
Step 6 |
Click Run Job. |
Step 5: Check results
Check the results of example workflow execution:
In CWM UI
Procedure
Step 1 |
In the CWM UI, select the Job Manager tile from the navigation menu on the left. |
Step 2 |
In the All jobs tab, find your job and check the status of the workflow execution in the Status table column.
|
Step 3 |
Click the job name to enter its details. |
Step 4 |
In the Job Event Log table, expand the bottommost WorkflowExecution entry by clicking its name. |
Step 5 |
In the JSON payload displayed, find the data key. It presents the final data output updated by the successful execution of the workflow actions for which |
In NSO
Procedure
Step 1 |
Log in to your NSO account and in the Application hub view, click the Service manager tile. |
Step 2 |
From the Select service points drop-down, select /l3vpn:vpn/l3vpn. |
Step 3 |
In the table, find |