Description

VNF (virtualized network function) requires unique serial number for licensing purposes, and the requirement is to have a statically defined serial number based on UUID (Universal Unique Identifier) number.  The serial number is derived from the UUID.  However, when VNF is spun up, the UUID is not reflected based on what was configured for the VNF.

Symptoms

VNF was created, and a specific UUID was configured. Upon checking what was generated by issuing 'virsh dumpxml <vnf name> ' in JDM shell, the output showed the UUID did not match what was configured.

Solution

Libvirt always takes UUID hex digits in lower case.

NFX uses libvirt for managing VNF virtualization. By design, Libvirt will always take UUID hex digits in lower case. As a result, if UUID is specified in upper case, it will not take this into consideration, and will auto-generate the UUID instead of using the manually configured UUID for the VNF. 

Example

Assume a vSRX VNF is being configured. The configuration on JDM may be something like the following:

root@jdm# show virtual-network-functions vsrx | display set    
set virtual-network-functions vsrx type virtual-machine
set virtual-network-functions vsrx image /var/third-party/images/junos-media-vsrx-x86-64-vmdisk-18.4R2.7.qcow2
set virtual-network-functions vsrx uuid 395563BE-9936-48F9-8753-C64534BE77EF

When you commit this, you can see what the UUID has generated by going into JDM shell and apply the following:

jdm:~# virsh dumpxml vsrx | grep uuid
  <uuid> de7b74a2-bc3f-4d39-892c-16460c80512d

From this example, the UUID configured is not what is generated by libvirt.  Instead, it is doing a random system generated UUID.  This will generate a random UUID every time the NFX reboots. 

The resolution is to reconfigure the UUID with lower case characters.  Instead of 395563BE-9936-48F9-8753-C64534BE77EF ,  configure the UUID as 395563be-9936-48f9-8753-c64534be77ef

Configure this as follows:

  1. Deactivate the configuration of the VNF (this will make the VNF domain disappear, which is what we want)
  2. Commit the configuration
  3. Activate the same VNF configuration
  4. Set UUID 395563be-9936-48f9-8753-c64534be77ef
  5. Commit the configuration

For this example, the following configuration is committed:

root@jdm> show configuration virtual-network-functions vsrx | display set
set virtual-network-functions vsrx type virtual-machine
set virtual-network-functions vsrx image /var/third-party/images/junos-media-vsrx-x86-64-vmdisk-18.4R2.7.qcow2
set virtual-network-functions vsrx uuid 395563be-9936-48f9-8753-c64534be77ef

The resulting UUID is generated as the vSRX VNF is spun up:

root@jdm# run start shell
jdm:~# virsh dumpxml vsrx | grep uuid
  <uuid> 395563be-9936-48f9-8753-c64534be77ef

As you can see, the UUID generated is the one that is configured in JDM.