Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Performing Automatic Setup of a vSRX Instance Using an OpenStack Command-Line Interface

    You can launch and manage a vSRX instance using either the nova boot or openstack server create commands, which includes the use of a validated Junos OS configuration user-data file from your local directory to initialize the active configuration of the target vSRX instance.

    To initiate the automatic setup of a vSRX instance from an OpenStack command-line client:

    1. If you have not done so already, create a configuration file with the Junos OS command syntax and save the file. The configuration file can be plain text or MIME file type text/plain.

      The user-data configuration file must contain the full vSRX configuration that is to be used as the active configuration on each vSRX instance, and the string #junos-config must be the first line of the user-data configuration file before the Junos OS configuration.

      Note: The #junos-config string is mandatory in the user-data configuration file; if it is not included, the configuration will not be applied to the vSRX instance as the active configuration.

    2. Copy the Junos OS configuration file to an accessible location from where it can be retrieved to launch the vSRX instance.
    3. Depending on your OpenStack environment, use the nova boot or openstack server create command to launch the vSRX instance with a validated Junos OS configuration file as the specified user-data.

      Note: You can also use the nova boot equivalent in an Orchestration service such as HEAT.

      For example:

      • nova boot -user-data </path/to/vsrx_configuration.txt> --image vSRX_image --flavor vSRX_flavor_instance

      • openstack server create -user-data </path/to/vsrx_configuration.txt> --image vSRX_image --flavor vSRX_flavor_instance



        Where:

        -user-data </path/to/vsrx_configuration.txt> specifies the location of the Junos OS configuration file. The user-data configuration file size is limited to approximately 16,384 bytes.

        --image vSRX_image identifies the name of a unique vSRX image.

        --flavor vSRX_flavor_instance identifies the vSRX flavor (ID or name).

      Starting in Junos OS Release 15.1X49-D130, to enable the use of a configuration drive for a specific request in the OpenStack compute environment, include the -config-drive true parameter in the nova boot or openstack server create command.

      Note: It is possible to enable the configuration drive automatically on all instances by configuring the OpenStack Compute service to always create a configuration drive. To do this, specify the force_config_drive=True option in the nova.conf file.

      For example, to use the user-data attribute to pass the Junos OS configuration to each vSRX instance:

      nova boot -config-drive true -flavor vSRX_flavor_instance -image vSRX_image -user-data </path/to/vsrx_configuration.txt>

      Where:

      -user-data </path/to/vsrx_configuration.txt> specifies the location of the Junos OS configuration file. The user-data configuration file size is limited to approximately 64 MB.

      -image vSRX_image identifies the name of a unique vSRX image.

      -flavor vSRX_flavor_instance identifies the vSRX flavor (ID or name).


      For example, to specify the configuration drive with multiple files (Junos OS configuration file and license file):

      nova boot -config-drive true -flavor vSRX_flavor_instance -image vSRX_image [-file /junos-config/configuration.txt=/path/to/file] [-file /junos-license/license.lic=path/to/license]

      Where:

      [-file /junos-config/configuration.txt=/path/to/file] specifies the location of the Junos OS configuration file.

      [-file /junos-license/license.lic=path/to/license] specifies the location of the Junos OS configuration file.

      -image vSRX_image identifies the name of a unique vSRX image.

      -flavor vSRX_flavor_instance identifies the vSRX flavor (ID or name).

    4. Boot or reboot the vSRX instance. During the initial boot-up sequence, the vSRX instance processes the cloud-init request.

      Note: The boot time for the vSRX instance might increase with the use of the cloud-init package. This additional time in the initial boot sequence is due to the operations performed by the cloud-init package. During this operation, the cloud-init package halts the boot sequence and performs a lookup for the configuration data in each data source identified in the cloud.cfg. The time required to look up and populate the cloud data is directly proportional to the number of data sources defined. In the absence of a data source, the lookup process continues until it reaches a predefined timeout of 30 seconds for each data source.

    5. When the initial boot-up sequence resumes, the user-data file replaces the original factory-default Junos OS configuration loaded on the vSRX instance. If the commit succeeds, the factory-default configuration will be permanently replaced. If the configuration is not supported or cannot be applied to the vSRX instance, the vSRX will boot using the default Junos OS configuration.

    Modified: 2018-01-12