

Guia d'usuari
Apèndix: Plantilles personalitzades
This section explains the following topics:
- Custom Templates Configuration, on page 1
Configuració de plantilles personalitzades
Objectiu
Custom templates are user-defined templates that allow for the customization and automation of network services not supported by the function pack. They define specific configurations and settings that can be applied to network devices and services, making deploying and managing network resources more efficient and consistent.
To use custom templates in Crosswork Network Controller, you must pre-configure them in Crosswork Network Services Orchestration (NSO). Once configured in NSO, the Crosswork Network Controller will display your custom template for selection when you provision a device or a service. NSO uses XML-based configuration (config) templates, which you can invoke from provisioning code or link directly to devices or services. XML templates are snippets of configuration, similar to the CDB init files, però més potent.
Flux de treball
To illustrate the capabilities of custom templates, we have provided an example that uses variable substitution to create an XML template. We then walk you through importing the template in NSO and referencing it in the L2VPN service in the Crosswork Network Controller.
To use custom templates:
- Crear comampla instància amb la configuració de dispositiu desitjada al router de la manera següent:
policy-map TEST-POLICY
class class-default
police rate 200 mbps
!
!
mapa-política final - Log in to NSO CLI and sync from that device.
admin@ncs# dispositius dispositiu PE99-55A1 sincronització des de - In NSO CLI, get the running config for the policy map. Display the configuration in an XML format.

- Copia el file sortida a un editor de text o codi. Especifiqueu les variables que es poden substituir o parametritzar segons les vostres necessitats mitjançant curlclaus i un símbol de dòlar, {$VARIABLE}. Podeu preferir mantenir el nom de la variable en majúscules per fer que destaqui més dels altres elements XML de la fileAquí hem creat dues variables, $POLICY_VAR i $RATE_MBS, per a la nostra plantilla.

- Create a skeleton template package in NSO. This will help you generate the XML structure with the correct headers. Copy the <devices> code in the below example a la vostra plantilla esquelet. La configuració del nom d'amfitrió és opcional i no és obligatòria com a part de l'XML.
Nota The custom-templates name must start with either ct- or CT- and should not include an underscore character.
- Copy the policy-map <config> code you created in step 4 from your text editor.

- Paste it in your skeleton template.


- Save and import your new XML template into NSO using NSO web IU o CLI. Aquest pas us permet carregar les plantilles personalitzades fusionades a NSO abans d'aplicar-les.
a. Si feu servir la CLI d'NSO, carregueu la plantilla de fusió a NSO de la manera següent:
admin@ncs% load merge user-device-template.xml
[ok] admin@ncs%
commit [ok] For details on applying custom templates, refer to Using Custom-Templates– CFP Services in the Cisco NSO Transport SDN Function Pack Bundle 7.0.0 User Guide.
b. Quan s'importa a través de Web A la interfície d'usuari, utilitzeu l'opció Carrega/Desa i feu clic a Enganxa per carregar les dades enganxant-les. Els nous canvis també s'han d'aplicar mitjançant Commit per aplicar la configuració. - Validate the new template in NSO.

- Let’s add this template to the L2VPN service in the Crosswork Network Controller.
a. Choose Services & Traffic Engineering> Provisioning (NSO)> L2VPN> L2VPN-Service
b. Feu clic a
to create a new service. The L2VPN-Service page is displayed.
c. Enter a name for the VPN Identifier and click Continue.
d. Under Custom-templates, click
to apply your custom template. The Crosswork Network Controller will display your custom template for selection.
e. Seleccioneu la plantilla personalitzada i apliqueu les variables necessàries. Feu clic a Confirma els canvis. Tingueu en compte que la validació de l'encaminador mostra el nom del mapa de polítiques i la velocitat de policia de 250 Mbps.
- Repeat the process for adding the policy to the interfaces. Ensure to add the policy at the device level, as the interface numbers may be different on each side of the L2VPN.
Per a més examples of configuring custom templates, refer to Using Custom-Templates– CFP Services in the Cisco NSO Transport SDN Function Pack Bundle 7.1.0 User Guide.

Documents/Recursos
![]() |
Plantilles personalitzades de CISCO [pdfGuia de l'usuari Plantilles personalitzades, Personalitzades, Plantilles |
