06-14-2017 01:07 AM - edited 03-01-2019 03:52 AM
Hey
My understanding (based on observation) is that if I do not use any specific ESC device template and virtual service (say NS-INFO) is created then NSO will have some default template to request KPI and Rules in ESC for restoratation. Pretty much nice default behavior. So far so good?
Now let’s assume that for some network services, or rather even for some VNFD/VDU that form the network service, I would like to use different ESC device templates. For example change the cadency or method of monitoring, change the boot/recovery times. So not overly complex “customization”. I rather see it as the way of granular control of VDU parameters that I can do easily if I were to use ESC only.
How I should do this? Should I create multiple ESC device templates, maybe even having the templates that only change the boot/recovery times and then having templates that only change KPI/Rules… so when I boot the network service, then per device/vnfd I can apply multiple such templates from “library”…
Please guide me on how to do this and some real working examples are appreciated.
Thanks
Kali
Solved! Go to Solution.
06-14-2017 01:18 AM
Hi!
You're correct, you would create device templates (/device/template{X}) for the settings you need to add/override/delete. You then add the name(s) of these device templates, e.g.
# nfvo ns-info esc ns-info fw-router vnf-info CSR1kv vdu CSR esc-device-template scale-in
where "scale-in" is the name of the template.
Please see the attached example, please note that you should keep the $TENANT, $DEPLOYMENT_NAME etc. These will be substituted by NFVO.
06-14-2017 01:18 AM
Hi!
You're correct, you would create device templates (/device/template{X}) for the settings you need to add/override/delete. You then add the name(s) of these device templates, e.g.
# nfvo ns-info esc ns-info fw-router vnf-info CSR1kv vdu CSR esc-device-template scale-in
where "scale-in" is the name of the template.
Please see the attached example, please note that you should keep the $TENANT, $DEPLOYMENT_NAME etc. These will be substituted by NFVO.
06-16-2017 02:19 AM
Thank you Fredrik.
Is vdu level the only place where I can add esc-device-template? VDU location, as per example you gave, allows me to control VDU specifics. However for example if i wanted to control inter-VDU affinity then on the ESC Device configuration i need to do this on the deployment policy placement.
Can I have multiple ESC device templates applied sequentially? assuming that device templates are granular to set some small subset of ESC device settings.
Can I have mix of device templates alread defined (reusage) plus some additional very service specific templates defined in templates/ directory of the service?
Thanks!
Kali
06-16-2017 02:24 AM
additional question please; if/how can i make the esc device templates optional depending on the service model in yang.
is it down to if statements in python code?
Thanks
Kali
06-16-2017 02:50 AM
The easiest is probably to use when statements in the templates.
<foo when={/bar='true'}>
..
</foo>
06-16-2017 02:54 AM
You can add any ESC config you like, it doesn't necessarily need to be limited to the specific VDU.
06-16-2017 03:07 AM
Ok, maybe my confusions is caused by the fact where i can see the ESC device template being referred to in NS-INFO example.
I think it is fair to say that ESC device template has to be defined when deployment is created, it is not the same as day1 config for virtual router or firewall, so far so good?
Deployment is created using NS-INFO. for example like this:
template = ncs.template.Template(service)
template.apply('vrouter-ns-info')
template.apply('vrouter-kicker')
Are you saying that i can do the following:
template = ncs.template.Template(service)
template.apply('vrouter-ns-info')
template.apply('esc-template-1')
template.apply('esc-template-2')
template.apply('esc-template-3')
template.apply('vrouter-kicker')
and then what will be pushed eventuall to ESC will be combination of all templates?
Thanks!
Kali
06-16-2017 03:18 AM
No, not like that.
First, check out the "Device Templates" chapter in the NSO getting started guide. A device template is not the same as a service template.
Download the example I provided above:
load merge scale-in.xml
you will now have a device template in /devices/template:
admin@ncs(config)# show full-configuration devices template
devices template scale-in
config
esc:esc_datamodel tenants tenant {$TENANT}
deployments deployment {$DEPLOYMENT_NAME}
vm_group {$VM_GROUP_NAME}
kpi_data kpi VM_UNDERLOADED
metric_value 20
metric_cond LT
metric_type UINT32
metric_occurrences_true 2
metric_occurrences_false 4
metric_collector type CPU
metric_collector nicid 0
metric_collector poll_frequency 3
metric_collector polling_unit seconds
metric_collector continuous_alarm false
!
rules admin_rules rule VM_UNDERLOADED
action [ "ALWAYS log" "TRUE servicescaledown.sh" ]
!
!
!
!
!
!
Modify your vrouter-ns-info.xml to set this scale-in device template:
admin@ncs(config)# show full-configuration nfvo ns-info esc ns-info fw-router vnf-info CSR1kv vdu CSR | display xml
<config xmlns="http://tail-f.com/ns/config/1.0">
<nfvo xmlns="http://tail-f.com/pkg/tailf-etsi-rel2-nfvo">
<ns-info>
<esc xmlns="http://tail-f.com/pkg/tailf-etsi-rel2-nfvo-esc">
<ns-info>
<id>fw-router</id>
<vnf-info>
<vnf-profile>CSR1kv</vnf-profile>
<vdu>
<id>CSR</id>
....
<esc-device-template>
<name>scale-in</name>
</esc-device-template>
</vdu>
</vnf-info>
</ns-info>
</esc>
</ns-info>
</nfvo>
</config>
06-19-2017 05:29 AM
Hi Fredrik,
I confirm that your example works fine. Adding scale-in template to VDU level in NS-INFO did the trick.
Few questions still if I may.
(1) your example esc device template for scale-in uses the following variables: {$TENANT} {$DEPLOYMENT_NAME} {$VM_GROUP_NAME}. What are the well-known variables that I can use in the device template?
(2) can i also refer to YANG service model variables in ESC device template in the format of {/var} assuming that i create NS-INFO in service initialization?
(3) can i add additional variables in ESC device template as long as i push them into NS-INFO template?
(4) I have experimented with the following two ESC device templates:
<esc-device-template>
<name>scale-in</name>
</esc-device-template>
<esc-device-template>
<name>Monitoring_Gold</name>
</esc-device-template>
If and how I can make these device template being applied conditionally based on service yang model parameters? can i somehow do when clauses similarly to day1 config?
Then additional question is regarding defining anti-affinity policy for the service chain. This is the way I did that in ESC only way for inter-group affinity:
<esc_datamodel xmlns="http://www.cisco.com/esc/esc">
<tenants>
<tenant>
<name>ESC_TENANT_NAME</name>
<deployments>
<deployment>
<name>placement-affinity-dep</name>
<policies>
<placement>
<target_vm_group_ref>B-instance</target_vm_group_ref>
<type>affinity</type>
<enforcement>strict</enforcement>
<vm_group_ref>A-instance</vm_group_ref>
</placement>
</policies>
<vm_group>
<name>A-instance</name>
...
</vm_group>
<vm_group>
<name>B-instance</name>
...
how i can define this "NSO way" where i configure ESC device template reference under the VDU level? how can i make template re-usable since it contains references to two vm_groups?
Thanks!
Kali
06-19-2017 07:52 AM
(1) your example esc device template for scale-in uses the following variables: {$TENANT} {$DEPLOYMENT_NAME} {$VM_GROUP_NAME}. What are the well-known variables that I can use in the device template?
These are the only ones.
(2) can i also refer to YANG service model variables in ESC device template in the format of {/var} assuming that i create NS-INFO in service initialization?
Not sure, please try!
(3) can i add additional variables in ESC device template as long as i push them into NS-INFO template?
Yes!
(4) I have experimented with the following two ESC device templates:
<esc-device-template when="{/foo>10}">
<name>scale-in</name>
</esc-device-template>
<esc-device-template when="{/gold='true'}">
<name>Monitoring_Gold</name>
</esc-device-template>
If and how I can make these device template being applied conditionally based on service yang model parameters? can i somehow do when clauses similarly to day1 config?
See above in the XML for some bogus examples.
how i can define this "NSO way" where i configure ESC device template reference under the VDU level? how can i make template re-usable since it contains references to two vm_groups?
Create a device template (see scale-in) using the template variables from above and add your own variables that you pass in the NS info.
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