cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
946
Views
0
Helpful
1
Replies

Nano services trigger not working as expected in 20 - Nano Services example

G V R Chandra Reddy
Cisco Employee
Cisco Employee

I am trying the 20 - Nano services example given in default examples section. My understanding is that in the nano-plan each pre-condition is a kicker and it keeps monitoring for change in the path specified. Below is the plan outline given in example.

 

ncs:plan-outline link-plan {
description
"Make before brake vlan plan";

ncs:component-type "ncs:self" {
ncs:state "ncs:init";
ncs:state "ncs:ready";
}

ncs:component-type "link:vlan-link" {
ncs:state "ncs:init";
ncs:state "link:dev-setup" {
ncs:create {
ncs:nano-callback;
}
}
ncs:state "ncs:ready" {
ncs:create {
ncs:pre-condition {
ncs:monitor "$SERVICE/endpoints" {
ncs:trigger-expr "test-passed = 'true'";
}
}
}
ncs:delete {
ncs:pre-condition {
ncs:monitor "$SERVICE/plan" {
ncs:trigger-expr
"component[name != 'self'][./back-track = 'false']"
+ "/state[name='ncs:ready'][./status = 'reached']"
+ " or not(current()/component[back-track = 'false'])";
}
}
}
}
}
}

 

For the first as given in example I am doing "link test endpoints ex1 int1 ex2 int1" and after that test-passed true.

 

Second time, I am deleting existing one "no link test endpoints ex1 int1 ex2 int1" and adding a new link.

 

"link test endpoints ex1 int2 ex2 int2"

 

Here, when I give "link test endpoints ex1 int2 ex2 int2 test-passed true", the deleting component should back-track and get deleted automatically. But it is not happening like that. It is in back-tracking mode but not proceeding further unless you do reactive-re-deploy.

 

 

1 Reply 1

rogaglia
Cisco Employee
Cisco Employee

I believe you need to add your reactive-re-deploy as a post-action to your trigger or else NSO would not know what to do:

 

ncs:post-action-node "$SERVICE" {
ncs:action-name "reactive-re-deploy";
}