This article discusses the commands required to spin vSRX and the resulting VNF descriptor/XML file. The same concepts can be applied to spin any other VNF on NFX with enhanced orchestration enabled. Enhanced orchestration is enabled by default, starting from Junos OS 15.1X53-D45.
ovs-sys-br is the default Open vSwitch (OVS) on NFX. You do not have to create it. VLAN is created on the ovs-sys-br
ovs-sys-br
virbr0 and eth0br are default Linux bridges available on NFX. You do not have to configure them. By default, when you spin a VNF via JDM, the first and second NIC of the VNF will be added to virbr0 and eth0br respectively.
virbr0
eth0br
Configuration to create VLANs on the default ovs-sys-br
set host-os vlans v1 vlan-id 1 set host-os vlans v7 vlan-id 7
Configuration to create custom OVS bridge. Use this custom OVS bridge to glue between VSRX/VNFs.
set host-os vlans custom-ovs vlan-id none
Configuration to spin VSRX:
set virtual-network-functions vSRX-7 image /var/third-party/images/media-vsrx-vmdisk-15.1X49-D80.4.qcow2 set virtual-network-functions vSRX-7 virtual-cpu 0 physical-cpu 4 <-- vCPU pinning set virtual-network-functions vSRX-7 virtual-cpu 1 physical-cpu 11 set virtual-network-functions vSRX-7 virtual-cpu count 2 set virtual-network-functions vSRX-7 virtual-cpu features hardware-virtualization set virtual-network-functions vSRX-7 interfaces eth2 mapping vlan members v7 <-- Configurable interface name starts from eth2 set virtual-network-functions vSRX-7 interfaces eth3 mapping vlan members custom-ovs <-- Attaching vnic to custom OVS bridge set virtual-network-functions vSRX-7 interfaces eth4 mapping vlan members v1 set virtual-network-functions vSRX-7 interfaces eth5 mapping hsxe0 virtual-function <-- SR-IOV assignment set virtual-network-functions vSRX-7 interfaces eth6 mapping hsxe1 virtual-function set virtual-network-functions vSRX-7 memory size 4194304 set virtual-network-functions vSRX-7 memory features hugepages
vCPU pinnin
Below is the XML template of the generated VNF, that was created via the JDM CLI.
virsh dumpxml vSRX-7 --------------------- <domain type='kvm' id='5' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'> <name>vSRX-7 <uuid>0fbb2d52-c4ae-44c1-bf35-8955c0c19735 <memory unit='KiB'>4194304 <currentMemory unit='KiB'>4194304 <memoryBacking> <hugepages> <-- Command 'set virtual-network-functions vSRX-7 memory features hugepages' enables description about huge pages <page size='1048576' unit='KiB'/> <locked/> <vcpu placement='static' current='2'>4 <cputune> <vcpupin vcpu='0' cpuset='4'/> <-- vCPU pinning <vcpupin vcpu='1' cpuset='11'/> <emulatorpin cpuset='0-5,7-11'/> <resource> <partition>/machine <os> <type arch='x86_64' machine='pc-i440fx-1.7'>hvm <boot dev='hd'/> <features> <acpi/> <apic/> <pae/> <-- Details under <features> tag get added with command 'set virtual-network-functions vSRX-7 virtual-cpu features hardware-virtualization' <cpu mode='host-model'> <model fallback='allow'/> <feature policy='require' name='vmx'/> <clock offset='utc'/> <on_poweroff>destroy <on_reboot>restart <on_crash>restart <devices> <emulator>/usr/bin/kvm <disk type='file' device='disk'> <driver name='qemu' type='qcow2' cache='none'/> <source file='/var/third-party/images/media-vsrx-vmdisk-15.1X49-D80.4.qcow2'/> <backingStore/> <target dev='vda' bus='virtio'/> <alias name='virtio-disk0'/>
2020-09-26: Article verified for accuracy. Article is valid and accurate.