Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

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). The stack_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). The stack_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). The stack_name is always set to get_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 the stack_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:

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.

where

  • public_network—Network ID of the existing neutron network used for the management (fxp0) port.

  • fpc_img—Change this parameter to linux-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 to linux-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.

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:

  1. Download the vMX KVM software package from the vMX page and uncompress the package.

    tar xvf package-name

  2. Change directory to the location of the files.

    cd package-location/openstack

  3. Edit the 1vmx.yaml file to modify the OS::Networking::VmxPort resource.

    To add a virtio port, add another OS::Networking::VmxPort entry but change the port number to the next number, the vnetwork_id parameter to net_id2, and the pname parameter to the name of the new port. For example:

    Note:

    If you are adding virtio port entries (OS::Networking::VmxPort resource), make sure you do not include SR-IOV port entries (OS::Networking::VmxSriovPort resource) because mixed interfaces are not supported.

  4. To add an SR-IOV port, change the type parameter to OS::Networking::VmxSriovPort for the OS::Networking::VmxPort entry.

    To add another SR-IOV port, add another OS::Networking::VmxSriovPort entry but change the port number to the next number, the vnetwork_id parameter to the next number, and the pname parameter to the name of the new port. For example, if the template file already has two ports:

    Note:

    If you are adding SR-IOV port entries (OS::Networking::VmxSriovPort resource), make sure you do not include virtio port entries (OS::Networking::VmxPort resource) because mixed interfaces are not supported.

  5. If you have more than one port, you must modify the package-location/openstack/vmx.yaml file to add another {get_attr: [fpc0_ge_port1, port]} entry (separated by a comma) in the fpc0 resources section under all_ports properties for each additional port and changing the port number to the next number. For example, this configuration has two ports.
  6. Add additional net_id parameters under the parameters section of the template file for each vnetwork_id that you added for the VmxPort or VmxSriovPort resources.
  7. Add additional net_id parameters under the parameters section of the corresponding environment file for each vnetwork_id that you added for the VmxPort or VmxSriovPort resources.
    Note:

    If you are adding SR-IOV interfaces, make sure you have prepared the controller and compute nodes properly. See Installing vMX on OpenStack.

  8. Create the vMX instance with the heat stack-create –f heat-filename –e environment-filename vmx-name command.
  9. Verify that the vMX instance is created with the heat stack-list | grep vmx-name command.

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:

  1. Copy the sample topology template file and environment file to the top-level directory.
  2. Edit the 1vmx1net.yaml file to add another OS::Nova::Vmx entry but change the last stack_name parameter to the next number. For example:
  3. Make sure the net_id parameter is listed under the parameters section of the corresponding environment file for the vMX instance (in this case, 1vmx.env).
    Note:

    If you are adding SR-IOV interfaces, make sure you have prepared the controller and compute nodes properly.

  4. Start the vMX instances with the heat stack-create –f heat-filename –e environment-filename stack-name command.
  5. Verify that the vMX instance is created with the heat stack-list | grep vmx-name command.

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:

  1. Copy the sample topology template file and environment file to the top-level directory.
  2. Edit the 2vmx1net.yaml file to add another OS::Networking::VmxNet entry but change the CIDR of the network (net_cidr) and the name of the bridge (bname) to the next number. For example:
  3. To each OS::Nova::Vmx entry, add the next bridge network ID. For example:
  4. Add ge_cidr parameter under the parameters section for the port.
  5. Make sure the parameters section of the corresponding environment file for the vMX instance (in this case, 1vmx.env) lists all the net_id parameters.
    Note:

    If you are adding SR-IOV interfaces, make sure you have prepared the controller and compute nodes properly.

  6. Start the vMX instances with the heat stack-create –f heat-filename –e environment-filename stack-name command.
  7. Verify that the vMX instance is created with the heat stack-list | grep vmx-name command.