Service Template Automation Overview
You can use service template automation (STA) to provision services across devices running Junos OS that support this feature. You can provision services such as VPLS VLAN, Layer 2 and Layer 3 VPNs, and IPsec. Service template automation uses the service-builder.slax op script to transform a user-defined service template definition into a uniform API. You can then use the API to configure and provision services on similar devices. Thus you can create a service template on one device, generalize the parameters, and then quickly and uniformly provision that service on other devices. This process decreases the time required to configure the same service on multiple devices, and it reduces configuration errors associated with manually configuring each device.
The following process outlines how to use service template automation to provision services:
Create a service template definition.
Execute the service-builder.slax script and define service-specific instance parameters.
Generate the service interface, which automatically builds the required interface (API) from the template.
Enable the service interface on each device where the service is required.
Provision systems by invoking the service interface using NETCONF and supplying the service parameter values.
You create a service template by configuring the hierarchies for the actual service to be
provisioned on a device running Junos OS. You configure service template hierarchies at
the [edit groups] hierarchy level. When creating the service
template:
Only include statements that are also supported on the devices where you will provision the service (for example dual Routing Engine versus single Routing Engine).
-
Do not include the
apply-groupsorapply-macrostatements. Commit the configuration. The device reads the service template group configuration from the committed configuration.
After you create the basic service template definition, you invoke the service-builder.slax op script. The script reads the service template information from the committed configuration and uses an interactive interface to help you build and generate the service API. You have the option to parameterize every variable in the service template or only selected variables. For each selected variable, you create a generic service template parameter. The service-builder.slax script guides you through the creation and configuration of each parameter.
After you define the service template parameters, you generate the service interface. This
process creates a platform-specific service op script. If the
load-scripts-from-flash statement is configured, the device stores
the generated service script in the /config/scripts/op directory in
flash memory. Otherwise, the device stores the generated script in the
/var/db/scripts/op directory on the hard disk.
To enable the service interface on a device, you enable the generated service script in the configuration as you would any op script. You can enable the service interface on the local device using the service-builder.slax script or by manually updating the configuration. To enable the service interface on a similar platform, you must copy the generated service script to the corresponding directory on the new device and enable the service script in the configuration.
To provision the service on a device, invoke the service interface using NETCONF, and supply the necessary values for each parameter. Alternatively, you can invoke the service interface in the CLI by executing the service script and supplying the necessary values for each parameter as command-line arguments to the script. You can direct the service script to create a new service configuration, or update or delete an existing service configuration. The service script makes the changes to the candidate configuration and then commits the configuration. The service script does not support the context-sensitive help and auto-completion features available in the Junos OS CLI.