cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
77
Views
0
Helpful
6
Replies
khgrant
Cisco Employee

Dynamically extending VNFR with additional parameters to ESC

 

Hey Team,

 

 

As per NFVO documentation section “setting additional parameters using device templates”, VNFR XML file can be extended with esc-device-template in case ESC’s behavior needs to be further controller e.g. placement, recovery, scripts.

 

 

So far I have basic vnfr template (vrouter-vnfr.xml) that includes nfvo/nfvr and kickers. The variables are applied on this template in python code with “self.template.apply('vrouter-vnfr', vars)”.

 

 

If I wanted to add esc-device-template, should I modify the vrouter-vnfr template? I was hoping that I can apply esc-device-templates incrementally, as per the service model input values. I tried with the following code:

 

 

self.template.apply('vrouter-vnfr', vars)

 

self.template.apply('esc-placement', vars)

 

 

However I don’t see in the final vnfr any changes defined in ‘esc-placement’ template file…

 

 

Could you help me to understand the right way to control this?
Thanks

   

6 REPLIES 6
khgrant
Cisco Employee

 

Kali,

 

 

It's very hard to see what's wrong w/o your templates...

 

 

Fredrik

 

khgrant
Cisco Employee

 

Hi Fredrik.

 

 

in general it is possible to dynamically add esc device settings that are part of vnfr correct? by dynamically i mean that i have  vnfr file and i have several other templates that are merged with vnfr before sending over to esc. so far so good?

 

 

would you have python example of how to achieve that?

 

 

otherwise i can send my vrouter package if you want me to.

 

 

thanks for help

 

kali

 

khgrant
Cisco Employee

 

Hi Kali,

 

 

To use device templates, you should apply device templates before applying vnfr configuration. For example, you can load xml as day 0 configuration.

 

And, you should add template name(i.e. scale-out) to /nfvo/vnfr/esc/vnf-deployment/vnfr/vdu/esc-device-template in your vnfr xml file.

 

 

Best Regards,

 

Yoshitaka

 

khgrant
Cisco Employee

 

Hi!

 

> On 28 nov. 2016, at 15:46, Arkadiusz Kaliwoda (akaliwod) <akaliwod@cisco.com> wrote:

 

>

 

> Hi Fredrik.

 

>

 

> in general it is possible to dynamically add esc device settings that are part of vnfr correct? by dynamically i mean that i have  vnfr file and i have several other templates that are merged with vnfr before sending over to esc. so far so good?

 

Yes, absolutely and you should be able to do what you did below, so I suspect something is amiss in the templates.

 

 

commit | debug template

 

- or -

 

commit | debug service

 

 

might help you.

 

 

Fredrik

 

khgrant
Cisco Employee

 

Hi,

 

 

We use a template that we load into the tree via load-merge.

 

 

  1. 1. load merge a template with values:

 

 

<devices xmlns="http://tail-f.com/ns/ncs">

 

<template tags="merge">

 

<name>Placement_template_SI</name>

 

<config>

 

<esc_datamodel xmlns="http://www.cisco.com/esc/esc">

 

<tenants>

 

<tenant tags="nocreate">

 

<name>mano</name>

 

<deployments>

 

<deployment tags="merge">

 

<name>VPC-SI-N42-MANO</name>

 

<vm_group>

 

<name>SI-19.2</name>

 

                                                <placement>

 

                                                                <type>zone_host</type>

 

                                                                <enforcement>strict</enforcement>

 

                                                                <zone>mano-1</zone>

 

                                                </placement>

 

</vm_group>

 

</deployment>

 

</deployments>

 

</tenant>

 

</tenants>

 

</esc_datamodel>

 

</config>

 

</template>

 

</devices>

 

 

  1. 2. load merge a template with variables that your java/python program provides the values:

 

 

<devices xmlns="http://tail-f.com/ns/ncs">

 

    <template tags="merge">

 

<name>Placement_template</name>

 

<config>

 

<esc_datamodel xmlns="http://www.cisco.com/esc/esc">

 

<tenants>

 

<tenant tags="nocreate">

 

              <name>{$TENANT}</name>

 

<deployments>

 

<deployment tags="merge">

 

<name>{$DEPLOYMENT_NAME}</name>

 

<vm_group>

 

<name>{$VDU}</name>

 

<placement>

 

                       <type>{$PLACEMENT_TYPE}</type>

 

<enforcement>{$PLACEMENT_ENFORCEMENT}</enforcement>

 

<zone>{$PLACEMENT_ZONE}</zone>

 

</placement>

 

</vm_group>

 

</deployment>

 

</deployments>

 

</tenant>

 

</tenants>

 

</esc_datamodel>

 

</config>

 

</template>

 

</devices>

 

khgrant
Cisco Employee

 

Hi Kali,

 

 

I have used two kind of ESC template in my lab tests. There are classic NSO ESC device templates:

 

 

gabszabo@ncs# show running-config devices template

 

devices template esc-security-group

 

config

 

  esc:esc_datamodel tenants tenant {$TENANT}

 

   deployments deployment {$DEPLOYMENT_NAME}

 

    vm_group {$VDU}

 

     interfaces interface {$NIC}

 

      security_groups security_group [ "{$SEC_GROUP}" ]

 

     !

 

    !

 

   !

 

  !

 

!

 

!

 

devices template esc-vPTA-scaling

 

config

 

  esc:esc_datamodel tenants tenant {$TENANT}

 

   deployments deployment {$DEPLOYMENT_NAME}

 

    vm_group {$VDU}

 

     kpi_data kpi VM_OVERLOADED

 

      metric_value 10

 

      metric_cond GT

 

      metric_type UINT32

 

      metric_occurrences_true 1

 

      metric_occurrences_false 1

 

      metric_collector type SUBSCRIBER_SESSION

 

      metric_collector nicid 0

 

      metric_collector poll_frequency 15

 

      metric_collector polling_unit seconds

 

      metric_collector continuous_alarm false

 

     !

 

     kpi_data kpi VM_UNDERLOADED

 

      metric_value 1

 

      metric_cond LT

 

      metric_type UINT32

 

      metric_occurrences_true 1

 

      metric_occurrences_false 1

 

      metric_collector type SUBSCRIBER_SESSION

 

      metric_collector nicid 0

 

      metric_collector poll_frequency 15

 

     metric_collector polling_unit seconds

 

      metric_collector continuous_alarm false

 

     !

 

     rules admin_rules rule VM_OVERLOADED

 

      action [ "ALWAYS log" "TRUE servicescaleup.sh" ]

 

     !

 

     rules admin_rules rule VM_UNDERLOADED

 

      action [ "ALWAYS log" "TRUE servicescaledown.sh" ]

 

     !

 

    !

 

   !

 

  !

 

!

 

!

 

 

I have referenced to the templates and filled the variables in the vnfr block:

 

 

nfvo vnfr esc vnf-deployment vBNG-tenant vBNG-demonstration budlab-esc

 

...

 

vnfr vPTA

 

  vnfd-flavor basic

 

  instantiation-level basic

 

  vdu vPTA

 

   managed

 

   image-name CSR-3.16.3S

 

   flavor-name csr.small

 

   bootup-time 300

 

   recovery-wait-time 120

 

   day0 iosxe_config.txt

 

    url http://10.62.44.58/nfvo/csr_vPTA_config_template.txt

 

    variable HOSTNAME

 

     value [ vPTA0 vPTA1 vPTA2 vPTA3 ]

 

    !

 

   !

 

   authgroup          vBNG-authgroup

 

   internal-connection-point vPTA-mgmt-int

 

    connection-point-address start 10.1.2.31

 

    connection-point-address end 10.1.2.34

 

   !

 

   ! first

 

   esc-device-template esc-security-group

 

variable DEPLOYMENT_NAME

 

value vBNG-demonstration

 

!

 

variable NIC

 

value 0

 

!

 

variable SEC_GROUP

 

value all-in

 

!

 

variable TENANT

 

value vBNG-tenant

 

!

 

variable VDU

 

value vPTA

 

    !

 

   !

 

esc-device-template esc-vPTA-scaling

 

variable DEPLOYMENT_NAME

 

value vBNG-demonstration

 

!

 

variable TENANT

 

value vBNG-tenant

 

!

 

variable VDU

 

value vPTA

 

   !

 

   !

 

  !

 

 

I haven’t developed services for NFVO yet so I used this templates via CLI.

 

Hope it helps.

 

 

Regards,

 

Gabor

 

 

Content for Community-Ad

This widget could not be displayed.