Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Installing vMX on Contrail

Read this topic to understand how to install the virtual MX router in the Juniper Networks Contrail environment.

Installing vMX on Contrail

After preparing the OpenStack environment, we need to create nova flavors and glance images for the VCP and VFP VMs. Scripts create the flavors and images based on information provided in the startup configuration file.

Setting Up the vMX Configuration File

The parameters required to configure vMX are defined in the startup configuration file (vmx.conf).

To set up the configuration file:

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

    tar xvf package-name

  2. Change directory to the location of the files.

    cd package-location/openstack/scripts

  3. Edit the vmx.conf text file with a text editor to create the flavors for a single vMX instance.

    Based on your requirements, ensure the following parameters are set properly in the vMX configuration file:

    • re-flavor-name

    • pfe-flavor-name

    • vcpus

    • memory-mb

    Sample vMX Startup Configuration File

    Here is a sample vMX startup configuration file for OpenStack:

Specifying vMX Configuration File Parameters

The parameters required to configure vMX are defined in the startup configuration file (vmx.conf). The startup configuration file generates a file that is used to create flavors. To create new flavors with different vcpus or memory-mb parameters, you must change the corresponding re-flavor-name or pfe-flavor-name parameter before creating the new flavors.

To customize the configuration, perform these tasks:

Configuring the Host

To configure the host, navigate to HOST and specify the following parameters:

  • virtualization-type—Mode of operation; must be openstack.

  • cpu-pinning—Specifies whether VCP and VFP are pinned to vCPU on host. By default, cpu-pinning is on and we recommend this setting.

  • compute—(Optional) Names of the compute node on which to run vMX instances in a comma-separated list. If this parameter is specified, it must be a valid compute node. If this parameter is specified, vMX instance launched with flavors are only run on the specified compute nodes.

    If this parameter is not specified, the output of the nova hypervisor-list command provides the list of compute nodes on which to run vMX instances.

Configuring the VCP VM

To configure the VCP VM, you must provide the flavor name.

Note:

We recommend unique values for the re-flavor-name parameter because OpenStack can create multiple entries with the same name.

To configure the VCP VM, navigate to CONTROL_PLANE and specify the following parameters:

  • re-flavor-name—Name of the nova flavor.

  • vcpus—Number of vCPUs for the VCP; minimum is 2.

  • memory-mb—Amount of memory for the VCP; minimum is 4 GB.

Configuring the VFP VM

To configure the VFP VM, you must provide the flavor name. Based on your requirements, you might want to change the memory and number of vCPUs. See Hardware Requirements for minimum hardware requirements.

To configure the VFP VM, navigate to FORWARDING_PLANE and specify the following parameters:

  • pfe-flavor-name—Name of the nova flavor.

  • memory-mb—Amount of memory for the VFP; minimum is 12 GB (performance mode) and 4 GB (lite mode).

  • vcpus—Number of vCPUs for the VFP; minimum is 7 (performance mode) and 3 (lite mode).

    Note:

    If you specify less than 7 vCPUs, the VFP automatically switches to lite mode.

Creating OpenStack Flavors

To create flavors for the VCP and VFP, you must execute the script on the vMX startup configuration file (vmx.conf).

To create OpenStack flavors:

  1. Run the vmx_osp_create_flavor.py with the startup configuration file to generate the vmx_osp_flavors.sh file that creates flavors.

    ./vmx_osp_create_flavor.py vmx.conf

  2. Execute the vmx_osp_flavors.sh to create flavors.

    sh vmx_osp_flavors.sh

Note:

If you are running on a vRouter in DPDK mode, you must enable Huge Pages for the VCP flavor with the nova flavor-key re-flavor-name set hw:mem_page_size=2048 command.

Installing vMX Images

To install the vMX software images for the VCP and VFP, you can execute the vmx_osp_images.sh script. The script adds the VCP image in qcow2 format and the VFP file in vmdk format.

To install the VCP and VFP images:

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

    tar xvf package-name

  2. Verify the location of the software images from the uncompressed vMX package. See vMX Package Contents.

    ls package-location/images

  3. Change directory to the location of the vMX OpenStack script files.

    cd package-location/openstack/scripts

  4. Run the vmx_osp_images.sh script to install the glance images.

    sh vmx_osp_images.sh vcp-image-name vcp-image-location vfp-image-name vfp-image-location

    Note:

    You must specify the parameters in this order.

    • vcp-image-name—Name of the glance image.

    • vcp-image-location—Absolute path to the junos-vmx-x86-64*.qcow2 file for launching VCP.

    • vfp-image-name—Name of the glance image.

    • vfp-image-location—Absolute path to the vFPC-*.img file for launching VFP.

For example, this command installs the VCP image as re-test from the /var/tmp/junos-vmx-x86-64-17.3R1.8.qcow2 file and the VFP image as fpc-test from the /var/tmp/vFPC-20170817.img file.

sh vmx_osp_images.sh re-test /var/tmp/junos-vmx-x86-64-17.3R1.8.qcow2 fpc-test /var/tmp/vFPC-20170817.img

To view the glance images, use the glance image-list command.

Starting a vMX Instance

To start a vMX instance, perform these tasks:

Modifying the Initial Junos OS Configuration

When you start the vMX instance, the Junos OS configuration file found in scripts/openstack/vmx-templates/liberty/vmx_baseline.conf is loaded. If you need to change this configuration, make any changes in this file before starting the vMX.

Note:

If you create your own vmx_baseline.conf file or move the file, make sure that the scripts/openstack/vmx-templates/liberty/re.yaml references the correct path.

Launching the vMX Instance

To create and start the vMX instance:

  1. Modify these parameters in the corresponding environment file for your configuration. Starting in Junos OS Release 17.4R1 for Contrail 4.0, use the v2 version of the Heat templates.
    • net_id1—Network ID of the existing neutron network used for the WAN port. Use the neutron net-list command to display the network ID.

    • public_network—Network ID of the existing neutron network used for the management (fxp0) port. Use the neutron net-list | grep public command to display the network ID.

    • fpc_img—Name of the glance image for the VFP; same as the vfp-image-name parameter specified when running the script to install the vMX images.

    • fpc_flav—Name of the nova flavor for the VFP; same as the pfe-flavor-name parameter specified in the vMX configuration file.

    • junos_flav—Name of the nova flavor for the VCP; same as the re-flavor-name parameter specified in the vMX configuration file.

    • junos_img—Name of the glance image for the VCP; same as the vcp-image-name parameter specified when running the 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.

  2. Start the vMX instance with the heat stack-create –f 1vmx_contrail.yaml –e 1vmx_contrail.env vmx-name command.

    This sample configuration starts a single vMX instance with one WAN port and one FPC.

  3. Verify that the vMX instance is created with the heat stack-list | grep vmx-name command.
  4. Verify that the VCP and VFP VMs exist with the nova-list command.
  5. Access the VCP VM with the nova get-vnc-console nova-id novnc command, where nova-id is the ID of the instance on the WAN network.
Note:

You must shut down the vMX instance before you reboot host server using the request system halt command.

CAUTION:

When you deploy a vMX instance with DPDK-enabled vRouter, the virtio interface (int interface) might be down if you restart vRouter service.

Workaround:

  • Define metadata tunable upfront during the deployment of the vMX instance. The support for the new tuanable is available from Junos OS Release 19.4 onwards.

  • Add the metadata variable in RE yaml file or in FPC yaml file. Example: For updating RE yaml file, navigate to package_location/vmx/openstack/vmx-components/vms/re.yaml and set the variable as shown below:

    Example:

    In the example, lockup timeout value is set as 10 seconds. You can set the value in the range of 10 through 1000 seconds.

Release History Table
Release
Description
17.4R1
Starting in Junos OS Release 17.4R1 for Contrail 4.0, use the v2 version of the Heat templates.