06-08-2020 12:01 PM
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.
06-25-2020 01:30 PM
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";
}
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide