Description

When VNF is brought up, it has a default configuration, but not what you may need from the start.  For example, fxp0 is not configured for DHCP.  This article walks you through configuring a config drive, so that when the VNF first boots up, it will start with the desired configuration

Symptoms

When vSRX is first spun up, liveliness will be detected as down, because the initial configuration of the vSRX does not have an IP address configured for fxp0.

Solution

This solution applies to NFX devices running nfx-3 software, Junos versions 19.1 and higher.

You can configure the VNF to boot up with an initial configuration that you design.  Use the config drive feature, which will load the config file in when the VNF boots up.  The initial config file will need to be a file called juniper.conf.  If any other name is used, the config drive will not load.  For other vendors, check what file they will be looking at as the default configuration file.

First, save the desired configuration, and save it as juniper.conf.  Then configure config-data on your VNF, as in the example below:

[edit virtual-network-functions vsrx]
--- snip ---
config-data {
    source {
        file /var/public/juniper.conf;
    }
    target {
        device-name {
            hdc;
        }
        device-type cdrom;
        device-label vsrx-bootstrap;
    }
}

Note:   If config-data is added to an already existing VNF, restart the VNF (request virtual-network-functions vsrx restart) after committing the config-data configuration.  This is the only way the external media can apply the changes.  If the entire configuration is committed, including the config-data, then the VNF will boot up fine on the first boot up of the VNF.

The config-data will internally create an ISO file. During VNF bootup, it will load the ISO instead of loading the default configuration.