Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Configuring VNFs on NFX250 NextGen Devices

 

The NFX250 NextGen devices enable you to instantiate and manage virtualized network functions (VNFs) from the Junos Control Plane (JCP). The JCP supports the creation and management of third-party VNFs.

Load a VNF Image

To configure a VNF, you must log in to the JCP:

user@host:~ # cli
user@host>

To load a VNF image on the device from a remote location, use the file-copy command.

Note

You must save the VNF image in the /var/public directory.

user@host> file copy source-address /var/public

For example:

user@host> file copy scp://192.0.2.0//tftpboot/centos.img /var/public

Alternatively, you can load a VNF image by using the NETCONF command, file-put.

Prepare the Bootstrap Configuration

You can bootstrap a VNF using an attached config drive that contains a bootstrap-config ISO file. For an example of creating an ISO file, see the procedure in Creating a vSRX Bootstrap ISO Image. The procedure might differ based on the operating system (for example, Linux, Ubuntu) that you use to create the ISO file.

The config drive is a virtual drive, which can be a CD-ROM, USB drive or Disk drive associated to a VNF with the configuration data. Configuration data can be files or folders, which are bundled in the ISO file that makes a virtual CD-ROM, USB drive, or Disk drive.

A bootstrap configuration file must contain an initial configuration that allows the VNF to be accessible from an external controller, and accepts SSH, HTTP, or HTTPS connections from an external controller for further runtime configurations.

By attaching a config drive, you can pass the networking configurations such as the IP address, subnet mask, and gateway to the VNFs through a CLI. After receiving the configuration inputs, the device generates a bootstrap-config ISO file, and attaches the file to the VNF as a CD-ROM, USB drive, or Disk drive.

For more information about configuring and attaching a config drive, see (Optional) Attach a Config Drive to the VNF .

Note
  • The system saves the bootstrap-config ISO file in the /var/public folder. The file is saved only if the available space in the folder is more than double the total size of the contents in the file. If the available space in the folder is not sufficient, an error message is displayed when you commit the configuration.

  • When you reboot the system, the system generates a new bootstrap-config ISO file and replaces the existing ISO file with the new ISO file on the VNF.

  • The config drive is a read-only drive. Based on the VNF, you can specify the config drive as a read-only CD-ROM drive, USB drive, or a Disk drive.

The config drive supports the following data for VNFs:

  • Static content as files—The device accepts one or more file paths through a CLI, converts these files to an ISO image, and attaches it to the VNF. The config drive supports multiple static files in a VNF configuration.

  • Jinja2 template and parameters—Jinja2 parameters consist of key-value pairs. The key is specified in the template and the value replaces the key when the template is rendered. The system adds the rendered output file to the ISO image, and attaches it to the VNF. The maximum number of parameters for a template is 256 key-value pairs. The config drive supports multiple templates and its parameters in a VNF configuration.

    Note

    The config drive supports only Jinja2 templates.

  • Directory—The device accepts the specific directory contents, converts the folder structure in the given folder to an ISO image, and attaches it to the VNF. The config drive accepts only one folder. That folder becomes the root directory in the ISO image, and all the subsequent folders and files are added to the ISO image.

Note
  • You can add multiple source templates and source files in a VNF configuration.

  • To add multiple source templates and one source folder in a VNF configuration, the target template file must be inside the source folder.

  • You can add only one source folder in a VNF configuration.

  • If two VNFs share the same set of files, separate bootstrap-config ISO files are generated for each VNF. Deleting one VNF will not affect the other VNF.

Allocate CPUs for a VNF

Table 1 lists the CPUs available for VNF usage for the NFX250 models.

Table 1: CPUs Available for VNF Usage (Junos OS 19.1R1 Release)

Model

CPUs Available for VNF Usage

Throughput Mode

Hybrid Mode

Compute Mode

NFX250-S1

0

4

8

NFX250-S2

0

4

8

NFX250-S1E

0

4

8

Note

When you change the performance mode of the device, it is recommended to check the availability of the CPUs for VNFs.

To check the CPU availability and its status:

user@host> show system visibility cpu
Note

vjunos0 is a system VNF, you cannot modify the CPU allocation for the vjunos0.

To specify the number of virtual CPUs that are required for a VNF:

  1. Specify the number of CPUs required for the VNF:
    user@host# set virtual-network-functions vnf-name virtual-cpu count number
  2. Connect a virtual CPU to a physical CPU:
    user@host# set virtual-network-functions vnf-name virtual-cpu vcpu-number physical-cpu pcpu-number
  3. Commit the configuration:
    user@host# commit

The physical CPU number can be either a number or a number range. By default, a VNF is allocated one virtual CPU that is not connected to any physical CPU.

Note

You cannot change the CPU configuration of a VNF while the VNF is running. You must restart the VNF for the changes to take effect.

To enable hardware virtualization or hardware acceleration for VNF CPUs:

user@host# set virtual-network-functions vnf-name virtual-cpu features hardware-virtualization

Allocate Memory for a VNF

By default, a certain amount of memory is allocated for VNFs. Table 2 lists the possible memory availability for VNF usage for the NFX250 models.

Table 2: Memory Availability for VNF Usage

Model

Memory Availability for VNF Usage (Junos OS 19.1R1 Release)

NFX250-S1

6 GB

NFX250-S1E

6 GB

NFX250-S2

22 GB

To check the available memory:

user@host> show system visibility memory
Note

vjunos0 is a system VNF, you cannot modify the memory allocation for the vjunos0.

To specify the maximum primary memory that the VNF can use:

user@host# set virtual-network-functions vnf-name memory size size
Note

You cannot change the memory configuration of a VNF while the VNF is running. You must restart the VNF for the changes to take effect.

(Optional) Attach a Config Drive to the VNF

To attach a config drive to a VNF:

  1. Launch the VNF:
    user@host# set virtual-network-functions vnf-name image image-file-path
    user@host# set virtual-network-functions vsrx2 image image-type image-type

    For example:

    user@host# set virtual-network-functions vsrx2 image /var/public/media-vsrx-vmdisk-15.1X49-D78.4.qcow2.1
    user@host# set virtual-network-functions vsrx2 image image-type qcow2
  2. Specify the number of CPUs required for the VNF:
    user@host# set virtual-network-functions vnf-name virtual-cpu count number

    For example:

    user@host# set virtual-network-functions vsrx2 virtual-cpu count 2
  3. Pin virtual CPUs to physical CPUs:
    user@host# set virtual-network-functions vnf-name virtual-cpu vcpu-number physical-cpu pcpu-number

    For example:

    user@host# set virtual-network-functions vsrx2 virtual-cpu 0 physical-cpu 4
    user@host# set virtual-network-functions vsrx2 virtual-cpu 1 physical-cpu 5
  4. Enable hardware virtualization for the VNF CPUs:
    user@host# set virtual-network-functions vnf-name virtual-cpu features hardware-virtualization

    For example:

    user@host# set virtual-network-functions vsrx2 virtual-cpu features hardware-virtualization
  5. Specify the maximum primary memory that the VNF can use:
    user@host# set virtual-network-functions vnf-name memory size memory-size

    For example:

    user@host# set virtual-network-functions vsrx2 memory size 4194304
  6. Allocate hugepages:
    user@host# set virtual-network-functions vnf-name memory features hugepages page-size page-size

    For example:

    user@host# set virtual-network-functions vsrx2 memory features hugepages page-size 1024
  7. Disable autostart of the VNF when the VNF configuration is committed:
    user@host# set virtual-network-functions vnf-name no-autostart

    For example:

    user@host# set virtual-network-functions vsrx2 no-autostart
  8. Specify the source file to add in the config drive:
    user@host# set virtual-network-functions vnf-name config-data source file source-file-path
    user@host# set virtual-network-functions vnf-name config-data source file source-file-path

    For example:

    user@host# set virtual-network-functions vsrx2 config-data source file /var/public/source_file1
    user@host# set virtual-network-functions vrsx2 config-data source file /var/public/source_file2
  9. Specify the template file to add in the config drive:Note

    A template file can be of any format and keys are written inside the double {}. This feature replaces keys with values provided in the CLI to create a file and attach as storage media to the VNF. Its use depends upon the VNF. For more information about how to create a template, refer to jinja2 template guidelines.

    user@host# set virtual-network-functions vnf-name config-data source template template_name file file-path
    user@host# set virtual-network-functions vnf-name config-data source template template_name parameters image_path image-path
    user@host# set virtual-network-functions vnf-name config-data source template template_name parameters image_type image-type

    For example:

    user@host# set virtual-network-functions vsrx2 config-data source template template_sample file /var/public/template_sample
    user@host# set virtual-network-functions vsrx2 config-data source template template_sample parameters image_path /var/tmp/disk_image.qcow2
    user@host# set virtual-network-functions vsrx2 config-data source template template_sample parameters image_type qcow2

    Following is a sample template:

    user@host# cat /var/public/template_sample
  10. Specify the maximum memory of the source template:
    user@host# set virtual-network-functions vnf-name config-data source template template_name parameters mem-size memory-size

    For example:

    user@host# set virtual-network-functions vsrx2 config-data source template template_sample parameters mem-size 4096
  11. Allocate pages for the source template:
    user@host# set virtual-network-functions vnf-name config-data source template template_name parameters page-size page-size

    For example:

    user@host# set virtual-network-functions vsrx2 config-data source template template_sample parameters page-size 1024
  12. Specify the target file that contains the generated file from the source template:
    user@host# set virtual-network-functions vnf-name config-data source template template_name target target-file-path

    For example:

    user@host# set virtual-network-functions vsrx2 config-data source template template_sample target /var/public/template_output
  13. Specify the device name, device type, and device label to add in the config drive:
    user@host# set virtual-network-functions vnf-name config-data target device-name device-name
    user@host# set virtual-network-functions vnf-name config-data target device-type device-type
    user@host# set virtual-network-functions vnf-name config-data target device-label device-label

    For example:

    user@host# set virtual-network-functions vsrx2 config-data target device-name hda
    user@host# set virtual-network-functions vsrx2 config-data target device-type cdrom
    user@host# set virtual-network-functions vsrx2 config-data target device-label template_label

    The target device-type is optional. If you do not specify, it takes the device type as cd-rom.

    The target device-label is optional. If you do not specify, it takes the device label as config-data.

  14. Commit the configuration:
    user@host# commit

To verify whether the config drive is attached to the VNF, see the VNF Disk Information section in the show system visibility vnf command output message.

For example:

user@host> show system visibility vnf vsrx2

Configure Interfaces and VLANs for a VNF

You can configure a VNF interface and attach the interface to a physical NIC port, a management interface, or VLANs.

To attach a VNF interface to a physical NIC port by using the SR-IOV virtual function:

user@host# set virtual-network-functions vnf-name interfaces interface-name mapping physical-interface-name virtual-function [vlan-id vlan-id]

vlan-id is the VLAN ID of the port and is an optional value.

To attach a VNF interface to a VLAN:

  • Create a VLAN:

    user@host# set vmhost vlan vlan-name
  • Attach a VNF interface to a VLAN:

    user@host# set virtual-network-functions vnf-name interfaces interface-name mapping vlan members list-of-vlans [mode trunk|access]
Note
  • The interfaces attached to a VNF are persistent across VNF restarts.

  • If the VNF supports hot-plugging, you can attach the interfaces while the VNF is running. Otherwise, you must add the interfaces, and then restart the VNF.

  • You cannot change the mapping of a VNF interface while the VNF is running.

Starting in Junos OS Release 19.2R1, changes to the default MAC flooding behavior of the VNF interfaces improve the performance of multicast traffic. If a VNF interface is not attached to a VLAN, drop flow is not configured. The interface functions as a trunk port that can receive and forward the VLAN traffic. If the destination MAC address is known, the interface forwards the traffic to the destined port. If the MAC address is unknown, or if it is broadcast or multicast traffic, the interface forwards the traffic to all the ports in the same VLAN and to the ports that do not have a VLAN assigned.

In earlier releases, if a VNF interface is not attached to a VLAN, drop flow is configured and the VNF interface drops the outgoing traffic.

Note

You can prevent the VNF interface from sending or receiving traffic by using the deny-forwarding CLI option.

If you use an interface with deny-forwarding enabled to configure cross-connect, the interface receives only the cross-connect traffic and drops all other traffic.

set virtual-network-options vnf-name interface interface-name forwarding-options deny-forwarding

To specify the target PCI address for a VNF interface:

user@host# set virtual-network-functions vnf-name interfaces interface-name pci-address target-pci-address

You can use the target PCI address to rename or reorganize interfaces within the VNF.

For example, a Linux-based VNF can use udev rules within the VNF to name the interface based on the PCI address.

Note
  • The target PCI address string should be in the following format:

    0000:00:<slot:>:0, which are the values for domain:bus:slot:function. The value for slot should be different for each VNF interface. The values for domain, bus, and function should be zero.

  • You cannot change the target PCI address of VNF interface while the VNF is running.

To delete a VNF interface:

user@host# delete virtual-network-functions vnf-name interfaces interface-name
user@host# commit
  • To delete a VNF interface, you must stop the VNF, delete the interface, and then restart the VNF.

  • After attaching or detaching a virtual function, you must restart the VNF for the changes to take effect.

  • eth0 and eth1 are reserved for the default VNF interfaces that are connected to the internal network and the out-of-band management network. Therefore, the configurable VNF interface names start from eth2.

  • Within a VNF, the interface names can be different, based on guest OS naming conventions. VNF interfaces that are configured in the JCP might not appear in the same order within the VNF.

  • You must use the target PCI addresses to map to the VNF interfaces that are configured in the JCP and you must name them accordingly.

  • Starting in Junos OS Release 19.2R1, you can manually disable the VNF interfaces (eth0 through eth9) on the OVS or custom bridge by issuing the following command:

    user@host# set virtual-network-functions vnf-name interfaces interface-name link disable
    Note
    • If a link in a cross-connect configuration is down, then the cross-connect will also be down.

    • You cannot manually disable the VF interfaces on the VNF.

    • The eth0 and eth1 interfaces, which function as management interfaces, can be disabled only if the no-default-interfaces option is configured.

    To identify a disabled link, issue the following command:

    user@host> show vmhost network nfv-back-plane

    For example, the following output shows that the eth2 link on the centos VNF is disabled. Note that the output is truncated to provide only the details relevant to the disabled link.

Configure Storage Devices for VNFs

An NFX250 (NG) device supports the following storage options for VNFs:

  • CD-ROM

  • Disk

  • USB

To add a virtual CD or to update the source file of a virtual CD:

user@host# set virtual-network-functions vnf-name storage device-name type cdrom source file file-name

You can specify a valid device name in the format hdx, sdx, or vdx—for example, hdb, sdc, vdb, and so on.

To add a virtual USB storage device:

user@host# set virtual-network-functions vnf-name storage device-name type usb source file file-name

To attach an additional hard disk:

user@host# set virtual-network-functions vnf-name storage device-name type disk [bus-type virtio | ide] [file-type raw | qcow2] source file file-name

To delete a virtual CD, USB storage device, or hard disk from the VNF:

user@host# delete virtual-network-functions vnf-name storage device-name
Note
  • After attaching or detaching a CD from a VNF, you must restart the device for the changes to take effect. The CD detach operation fails if the device is in use within the VNF.

  • A VNF supports one virtual CD, one virtual USB storage device, and multiple virtual hard disks.

  • You can update the source file in a CD or USB storage device while the VNF is running.

  • You must save the source file in the /var/public directory, and the file must have read and write permission for all users.

Instantiate a VNF

You can instantiate a VNF by configuring the VNF name, and by specifying the path of an image.

While instantiating a VNF with an image, two VNF interfaces are added by default. These interfaces are required for management and for the internal network.

Note

Only QCOW2, IMG, and RAW image types are supported.

To instantiate a VNF by using an image:

user@host# set virtual-network-functions vnf-name image file-path
user@host# set virtual-network-functions vnf-name image image-type image-type
user@host# commit
Note

When you configure VNFs, do not use VNF names in the format vnfn—for example, vnf1, vnf2, and so on. Configurations that contain such names fail to commit.

(Optional) To specify a UUID for the VNF:

user@host# set virtual-network-functions vnf-name [uuid vnf-uuid]

uuid is an optional parameter. We recommend that you allow the system to allocate a UUID for the VNF.

Note

You cannot change the image configuration for a VNF after saving and committing the configuration. To change the image for a VNF, you must delete the VNF and create a VNF again.

Verify the VNF Instantiation

To verify that the VNF is instantiated successfully:

user@host> show virtual-network-functions

The output in the Liveliness field of a VNF indicates whether the IP address of the VNF is reachable over the internal management network. The default IP address of the liveliness bridge is 192.0.2.1/24. Note that this IP address is internal to the device and is used for VNF management.