vMX Heat Templates for OpenStack
Heat templates define vMX instances and topologies on OpenStack. Read this topic to understand how to create vMX instances that can be used with a topology template to define interconnection of vMX instances.
vMX Heat Templates
Heat templates define vMX instances and topologies on OpenStack. The vmx.yaml template defines a vMX instance, including the VCP, the VFP, and the bridge between them. It also defines any WAN ports and bridges. A topology template can have multiple vMX instances interconnected by bridges. Heat templates get their input parameters from the corresponding environment file.
You can download the vMX software package from the vMX page and uncompress the package for sample templates.
vMX Instance Template
You can customize the vmx.yaml template to create vMX instances. The Heat template obtains its input parameters from the corresponding environment file.
In the vMX instance template, you modify these resources:
OS::Networking::VmxPort—Defines the WAN port of the FPC for virtio interfaces as either ge-x/x/x or xe/0/0/0. The input parameters obtained from the environment file are network ID of the network on which the WAN port is added (
vnetwork_id
) and the name of the port (pname
). Thestack_name
does not change.OS::Networking::VmxSriovPort—Defines the WAN port of the FPC for SR-IOV interfaces as either ge-x/x/x or xe/0/0/0. The input parameters obtained from the environment file are network ID of the network on which the WAN port is added (
vnetwork_id
) and the name of the port (pname
). Thestack_name
does not change.
You can find the sample instance templates at package-location/openstack.
vMX Topology Template
You can customize the vmx.yaml template to create vMX instances that can be used with a topology file to define how to interconnect vMX instances. The Heat template obtains its input parameters from the corresponding environment file.
In the topology template, you modify these resources:
OS::Networking::VmxNet—Defines the OVS bridge instance. The input parameters obtained from the environment file are the CIDR of the network (
net_cidr
) and the name of the bridge (bname
). Thestack_name
is always set toget_param: 'OS::stack_name'
.OS::Nova::Vmx—Defines the vMX instance. The input parameters obtained from the environment file are the network ID of the bridge (
net_id1
) and thestack_name
.
You can find the sample instance templates at package-location/openstack/vmx-topologies/osp-topologies.
Environment File
The Heat template obtains its input parameters from the corresponding environment file. The environment file is in YAML format.
The environment file for the vMX instance has the net_id1
parameter:
parameters: net_id1:
where net_id1
is the network ID of the existing neutron
network with a given VLAN ID used for the WAN port.
The environment file for the topology has the n1
parameter,
which is the instance name.
Starting with Junos OS Release 17.4R1, the environment file has these parameter defaults.
parameter_defaults: public_network: fpc_img: fpc_flav: junos_flav: junos_img: project_name: gateway_ip:
where
public_network
—Network ID of the existing neutron network used for the management (fxp0) port.fpc_img
—Change this parameter tolinux-img
. Name of the glance image for the VFP that was created by script to install vMX images.For Junos OS Releases 17.3R1 and earlier,
vfp_image
is the parameter. Name of the glance image for the VFP that was created by script to install the vMX images.fpc_flav
—Change this parameter tolinux-flav
. Name of the nova flavor for the VFP that was created by script to create OpenStack flavors.For Junos OS Releases 17.3R1 and earlier,
vfp_flavor
is the parameter. Name of the nova flavor for the VFP that was created by script to create OpenStack flavors.junos_flav
—Name of the nova flavor for the VCP that was created by script to create OpenStack flavors.For Junos OS Releases 17.3R1 and earlier,
vcp_flavor
is the parameter. Name of the nova flavor for the VCP that was created by script to create OpenStack flavors.junos_img
—Name of the glance image for the VCP that was created by script to install vMX images.For Junos OS Releases 17.3R1 and earlier,
vcp_image
is the parameter. Name of the glance image for the VCP that was created by script to install the vMX images.project_name
—Any project name. All resources will use this name as the prefix.gateway_ip
—Gateway IP address.
In Junos OS Release prior to 17.4R1, the environment file has the following parameter defaults.
parameter_defaults: public_network: vfp_image: vfp_flavor: vcp_flavor: vcp_image: project_name: gateway_ip:
where
public_network
—Network ID of the existing neutron network used for the management (fxp0) port.vfp_image
—Name of the glance image for the VFP that was created by script to install vMX images.vfp_flavor
—Name of the nova flavor for the VFP that was created by script to create OpenStack flavors.vcp_flavor
—Name of the nova flavor for the VCP that was created by script to create OpenStack flavors.vcp_image
—Name of the glance image for the VCP that was created by script to install vMX images.project_name
—Any project name. All resources will use this name as the prefix.gateway_ip
—Gateway IP address.
Modifying the Ports in a Heat Template for an Instance
You can modify the vMX instance template to add or delete ports and to change between virtio and SR-IOV interfaces. For example, the package-location/openstack/1vmx.yaml file creates a single instance.
To add a port to the template:
To delete a port, remove all the lines you included to add a port.
Defining a Topology
You can create vMX instances that can be used with a topology template to define how to interconnect vMX instances. The Heat template obtains its input parameters from the corresponding environment file. The following examples demonstrate how to modify topologies.
Creating a vMX Instance in an Existing WAN Network
The package-location/openstack/vmx-topologies/osp-topologies/1vmx1net.yaml file creates one vMX instance with ports on an existing bridge.
To add a vMX instance to this template:
Connecting vMX Instances with Two OVS Bridges
The package-location/openstack/vmx-topologies/osp-topologies/2vmx1net.yaml file creates two instances with one port each that share a bridge.
To add a bridge that connects a second port on each vMX instance: