Description

This article describes steps which can be performed to troubleshoot the vSRX loading with the factory default configuration instead of configuration used in Cloud-Init in OpenStack and AWS environments.

Symptoms

A few different issues may occur when initialization of the vSRX instances is automated using Cloud-Init. Three cases where the the vSRX loads with the factory default are listed below.

Note: The cloud-init log file is located in AWS EC2 syslog at: /var/log/cloud-init.log
[ Refer : Amazon Documentation at https://docs.aws.amazon.com/managedservices/latest/userguide/access-to-logs-ec2.html  ]

Case 1: Error reported in boot up log: ERROR: Failed to commit user data configuration!​

  • User-data file is supplied in text format; but vSRX boots up with factory default configuration.​
  • Boot up logs contains one of these strings:

    # ERROR: Failed to commit user data configuration!​
    # Using the factory default configuration

Case 2: Error reported in boot up log: #junos-config is missing in user-data is reported

  • Boot up logs contain the string:

    #junos-config is missing in user-data​

Case 3 : No errors reported in boot up log, but vSRX loads with factory default configuration.

  • Cloud-init logs contain the string:
    ​#junos-config

Solution

Case 1: Error reported in boot up log: ERROR: Failed to commit user data configuration!​

  • Configuration is incorrect. This indicates that the user provided configuration failed the mgd commit.​
  • Copy the /config/juniper_user_data.conf file to a running vSRX ​
  • In the configuration mode, run the command: load override <juniper_user_data.conf>
  • Confirm the error has been corrected.

Case 2: Error reported in boot up log: #junos-config is missing in user-data is reported

  • Make sure the user-data file contains the string:
    #junos-config

Case 3: No errors reported in boot up log, but vSRX loads with factory default configuration. This indicates that the configuration had some errors and it failed to load leading vSRX to fallback to factory-default.

  • Check if the network is unreachable.
  • Check if DHCP leases are available.
  • Make sure the metadata service is running on the specified IP for the platform
  • One common issue is seen when authentication key-pair format is NOT a match to the type of key-pair. E.g. The default key-pair type is "ssh-rsa" but the key provided is of some other type, the user-data configuration file fails to load. 


For more details, refer to the following technical documentation links:

Using Cloud-Init to Automate the Initialization of vSRX Instances in AWS
Using Cloud-Init in an OpenStack Environment to Automate the Initialization of vSRX Instances

 

Modification History

2019-09-20: Added links to technical documentation for more information.
2023-08-30:

  • Corrected the location of /var/log/cloud-init.log 
  • Added another commonly encountered failure scenario in Case-3.