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 Create Workflows guide.
Prerequisites
-
Cisco NSO 6.0 local install. 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. |
||
Step 3 |
Navigate to the Admin -> Adapters tab. |
||
Step 4 |
Click Add Adapter. |
||
Step 5 |
In the Install a new adapter modal, click on the file uploader to select an |
||
Step 6 |
After the adapter file is uploaded to the CWM database, tick Automatically create worker for this adapter checkbox if you want to create one, then click Install Adapter to finish the installation process.
|
||
Step 7 |
In the adapter list, click on the name of your adapter to enter its details. Tick the Use as default version for associated activities checkbox. |
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 CWM. Here's how to do it:
Create secret
Procedure
Step 1 |
In CWM, navigate to the Admin -> Secrets tab. |
Step 2 |
Click Add Secret. |
Step 3 |
In the New secret view, specify the following:
|
Step 4 |
After selecting the secret type, a set of additional fields is displayed under the Secret type details section. Fill in the fields with the following:
|
Step 5 |
Click Create Secret. |
Create resource
Procedure
Step 1 |
In CWM, navigate to the Admin -> Resources tab. |
Step 2 |
Click Add Resource. |
Step 3 |
In the New resource window, specify the following: |
Step 4 |
Click Create resource. |
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 definition from the link below, copy it, and paste inside the Code field, then click Save changes. |
Step 4 |
Click Run. |
Step 5 |
In the Run job modal, provide a name for the job and in the Input variables field, paste the data input from the section below inside the brackets:
|
Step 6 |
Click Run job. |
Step 5: Check results
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 |