Device Templates Overview
The Device Templates workspace in Junos Space Network Management Platform provides the tools to create custom device templates and deploy common configuration to multiple devices from the Junos Space user interface. Device templates are schema-driven, so you can access and configure all the configuration parameters for any device supported on Junos Space Platform. For example, with device templates, you can create the build of a new device. You can configure routing protocols, such as BGP, OSPF, IS-IS, and static routes.
You can create two types of device templates in Junos Space Platform:
Configuration template – A configuration template is a template created by using a template definition. You first create a template definition and specify the common configuration that can be deployed to a device. You then create a device template by using the template definition, assign values to the common configuration parameters, and deploy the template to the device.
Quick template – A Quick template is a template created without using a template definition. For more information about Quick templates, see Quick Templates Overview.
The Templates page in the Device Templates workspace lists the device templates created in tabular view. Table 1 lists and describes the columns of the table.
Table 1: Templates Page
Name of the device template
Domain to which the device template is assigned
Type of the device template: Quick Template or Config Template
Latest version of the device template
Description of the device template
Last Modified By
Login name of the operator who last modified the device template
Last Update Time
Time when the device template was last updated
Deployment readiness of the device template: Needs Review, Disabled, or Enabled
Deployment status of the template: Created, Assigned, or Deployed
Template definitions are usually created by the Template Design Manager user role. Definition-based templates and Quick templates are created by the Template Manager user role. The following sections describe a template definition, device template, and the workflow to create and deploy templates:
A template definition is the building block of the configuration you create by using the device template feature. A template definition restricts the scope of the device template to a specific device family and Junos OS version.
When you create a template definition, you define the following aspects of the configuration options in the template definition:
Custom validation rules and error messages. For more information, see Working with Rules in a Template Definition.
Default values or device-specific values. You can also set up CSV files (outside of Junos Space Platform) as a basis for your template definitions. For more information, see Specifying Device-Specific Values in Template Definitions. CSV file values take precedence in case of conflicts with rules-based values.
Whether the configuration option is editable, read-only, or hidden
The data type of a configuration option is predefined in the DMI schema . You can modify the data type of the configuration option when you create the template definition. The data type of a configuration option determines the configurability of the option in the final definition. You can organize these configuration options across multiple pages.
Table 2 lists the data types for the configuration options and the tabs associated with each type. An * (asterisk) indicates that the tab is available for the corresponding data type. An — (en dash) indicates that the tab is not available for the corresponding data type. The DMI schema determines the data type, method of validation, and how the parameters are displayed.
To create a useful template definition, the Template Design Manager must determine in advance which parameters or configuration options he or she wants the Template Manager to set, which parameters are to be read-only, and which parameters, if any, are to be hidden from the Template Manager. The data type of an option determines how the data will be displayed and what tabs are available to enter data.
Table 2: Data Types and Tabs
The Container data type holds other data types.
The Table data type displays a list of records with identical structures.
String - Key column in a table
The String - Key column in a Table data type identifies the uniqueness of the record in the table. If the table has a key specified, only one record with the given key can exist.
The String data type contains character strings.
The Integer [Number] data type is used to specify a numeric value without a fractional component.
The Boolean data type has two possible values: true and false. The value is True if selected and False if not selected.
The Enumeration data type defines a variable to be a set of predefined constants. The variable must be equal to one of the values that has been predefined for it. Use this data type to create drop-down lists.
The Choice data type provides an option button. Select the option button to use the configuration option in the template.
Table 3 lists the validation parameters for the data types that require validation.
Table 3: Data Types and Validation Parameters
String - Key column in a table
All configuration options of the Table data type have a key column by default.
The Definitions page in the Device Templates workspace lists the template definitions in tabular view. Table 4 lists and describes the columns of the table.
Table 4: Definitions Page
Name of the template definition
Domain to which the template definition is assigned
Description of the template definition
Juniper Networks DMI Schema; for example, J Series, M Series, MX Series, T Series, and TX Series
Last Modified By
Login name of the template designer who last modified the template definition
Last Update Time
Time when the template definition was last updated
State of the template definition: published or unpublished
Junos Space Network Management Platform assigns different states to the template definitions. These states are listed in the State column of the table on the Definitions page. When a Template Design Manager finishes creating a template definition, that definition is automatically published by default. Template Design Managers can perform a series of operations on the definitions, but to do so, they must first unpublish the definitions. The Template Manager can see only published definitions; they cannot see unpublished definitions.
The Template Design Manager specifies not only which device parameters appear in the definition, but also which parameters can be edited by the Template Manager when he or she creates a template. The Template Design Manager also sets the defaults for the editable parameters.
You cannot edit, publish, or delete a template definition if the template definition is being edited by another user. You receive a pop-up message indicating the user who is currently editing the template definition.
Device Template States
Junos Space Platform assigns different states to the device templates based on their deployment readiness. Table 5 lists the states and their descriptions.
Table 5: Device Template States
The device template cannot be deployed until you review it. This state is triggered by a designer who is modifying the template definition on which the device template is based. That device template is then automatically moved to the Needs Review state.
The device template cannot be deployed. This state is triggered by the designer unpublishing the template definition upon which a device template is based. That device template is then automatically disabled.
The device template can be deployed. As soon as you finish creating a device template, it is enabled automatically.
Device Template Statuses
Junos Space Platform assigns different deployment statuses to the device templates. Table 6 lists the deployment statuses and their descriptions.
Table 6: Device Template Deployment Statuses
The device template displays this status if:
The device template is assigned to the device.
The device template is deployed to the device.
Device Templates Workflow
Device templates can be designed to allow (or prevent) specified tasks to be (or from being) performed by two predefined Junos Space Platform user roles:
Template Design Manager—A designer who understands both:
The technical details of the device configuration
How to implement this knowledge to solve specific business problems
Template Manager—An operator who executes the instructions of the Template Design Manager
A Template Design Manager (hereafter referred to as “designer”) creates template definitions and publishes them. A Template Manager (hereafter referred to as “operator”) selects a template definition and creates the device template from the template definition to configure one or more devices. The operator then tests the device template on the device (without deploying it). If the device template is validated, the operator deploys the device template to the device. With this division of labor, the operator does not need specialist knowledge. Alternatively, if one person is assigned both roles, using device templates radically reduces the volume of work and virtually eliminates operator error.
While creating the definition, the designer can verify what the operator sees when creating a device template from the definition. The operator, however, can gain no insight into what the designer saw when creating the definition. This has important consequences: while the designer can identify configuration options simply through their place in the hierarchy represented as a tree, the operator is entirely dependent on the label of the option. It is by means of the label alone that an operator determines which parameter he or she is configuring.
Designers can choose not only which options to display to the operators, but also whether to display them at all. They can make configuration options editable or read-only, and even provide customized explanations for the operators. Operators can immediately deploy a device template to the devices they select or schedule deployment for a later date.
Ensure that the following requirements are met to use the device template workflows successfully:
To be available for use by operators, template definitions must be published. Template definitions that are unpublished are not available for the creation of templates.
Templates based on a definition that was unpublished after the templates were created are automatically disabled.
Templates based on a definition that was unpublished and then republished are marked as needing review. They cannot be deployed before an operator reviews them.
Templates based on a definition that has been deleted are permanently disabled.
Templates based on a published definition that has not been unpublished in the meantime are enabled.
You cannot edit or delete a device template if the device template is being edited by another user. You receive a pop-up message indicating the user who is currently editing the device template.
We recommend that you do not navigate to other pages or other Junos Space applications when modifying a device template or a template definition. Save the changes before you navigate to other pages or other Junos Space applications.
Device Template Deployment
You can add and delete configuration details to and from device templates before deploying the template to a device. You can assign, deploy, unassign, and undeploy device templates to and from IPv4-enabled and IPv6-enabled devices manually, by using tags, or by using a CSV file. Assigning a device template to a device allows you to view the consolidated configuration changes to be deployed on the device from the Devices workspace. You can choose to include or exclude the configuration changes in or from the device template when you deploy the consolidated configuration changes by using the Review/Deploy Configuration workflow from the Devices workspace. For more information, see Reviewing and Deploying the Device Configuration. A device template that has been assigned to a device cannot be deployed using the Deploy workflow.
When you deploy a device template to a device, the unconfigured parameters are also committed. This means that if you applied two device templates to a device, only the configuration contained in the last device template is retained. For example, if you set the SNMP location in the first device template that you deployed, but did not do so in the second device template, the SNMP location information is lost as soon as you deploy the second device template. Therefore, to build a complex configuration by applying multiple device templates in stages, you should modify the last deployed definition or device template each time you add a layer of complexity.
With Junos Space Network Management Platform as the System of Record (in SSOR mode), you can deploy a template on a device in two ways:
Assign a template to a device by using the Assign to Device workflow in the Device Templates workspace, and approve and deploy the template by using the Review/Deploy Configuration workflow in the Devices workspace.
Deploy a template to a device by using the Deploy workflow in the Device Templates workspace.
If you assign a template to a device and use the Deploy workflow to deploy that template on the same device, although the template is deployed to the device, Junos Space Platform does not reflect this managed status. The managed status of the device is shown as "Space Changed" on the Device Management page.