Description

This article is designed to guide you through updating the pristine configuration to include the essential mgmt_junos VRF before upgrading to Juniper Apstra 4.2.1, a requirement applicable exclusively to Juniper Junos devices.

 

For versions leading up to Juniper Apstra 4.2, the minimal configuration documentation highlighted the necessity of the mgmt_junos routing instance for maintaining management connectivity. Nevertheless, Apstra did not mandate this configuration; its absence allowed the configuration to function without this specific section.

 

Starting with Juniper Apstra 4.2 and subsequent versions, incorporating this routing instance becomes crucial for enabling gRPC for telemetry gathering. Should your devices lack this configuration in their pristine setup, it's mandatory to address this omission. It is recommended to address this prior to upgrading to Apstra 4.2.

 

 

Symptoms

After switching the maintenance mode back to 'Normal' in your upgraded 4.2 VM, it is anticipated that devices without the mgmt_junos instance will experience a Config Deployment Failure.

 

Deploy Failed

  1. Apply config failed: CommitError(edit_path: [edit system services extension-service request-response grpc routing-instance], bad_element: routing-instance mgmt_junos, message: error: Referenced routing instance must be defined under [edit routing-instances] hierarchy level or in case of managment routing-instance 'mgmt_junos' make sure 'system management-instance' configuration is set error: commit failed: (statements constraint check failed))

Solution

Ensure that your pristine configuration includes the mgmt_junos VRF. To do this, from the Apstra UI, proceed to Devices > Managed Devices and select your devices by clicking on their Management IP addresses. Then, access the 'Pristine Config' tab. For the expected minimal configuration details, refer to the Juniper Apstra official documentation.

 

https://www.juniper.net/documentation/us/en/software/apstra4.1/apstra-user-guide/topics/topic-map/agent-juniper.html#juniper_device_agent_initial_juniper_junos_configuration

https://www.juniper.net/documentation/us/en/software/apstra4.2/apstra-user-guide/topics/topic-map/agent-juniper.html#juniper_device_agent_initial_juniper_junos_configuration

 

Expected minimal configuration regarding the management routing instance:

 

system {
    management-instance;
}
routing-instances {
    mgmt_junos {
        routing-options {
            static {
                route 0.0.0.0/0 next-hop <management-default-gateway>;
            }
        }
    }
}

If the configuration is not present, please follow these steps depending on your Apstra version:

 

Juniper Apstra < 4.1.2

 

For versions before Apstra 4.1.2, modifying the pristine config requires undeploying the device. If undeployment is not feasible, consider upgrading to Apstra 4.1.2 or 4.2.1, where the configuration can be adjusted after the upgrade.

 

  • Within your Apstra blueprint, navigate from Staged > Physical > Topology, select the device, and from the Device tab in the right-side panel, choose to 'Undeploy' the device and remove its Serial Number. Commit this change. Note that this action will impact service since it removes the configuration from the device.

 

  • Update the switch's configuration via CLI to align with the required minimal config. Ensure you have Console access to avoid losing management connectivity, and use the 'commit confirmed' command for safety.

 

  • From the Apstra UI, go to Devices > Managed Devices, click on the switch's Management IP address, and proceed to the 'Pristine Config' tab. Select 'Update From Device' to capture the updated Pristine configuration. Confirm that the updated pristine matches the necessary changes.

 

  • Return to your Blueprint, redeploy the device, and reassign the Serial Number. Finalize by committing this adjustment.

 

Juniper Apstra 4.1.2 / Juniper Apstra 4.2.1 

 

Apstra-CLI Command Method (recommended)

 

In Apstra 4.1.2 and 4.2.1, you have the ability to fix the mgmt_junos VRF related configuration from apstra-cli. 


Please download the latest apstra-cli version that matches your Juniper Apstra release. To fix the mgmt_junos related configuration on one or multiple devices, use the command provided. Note that this command will insert only the configs necessary to meet the minimal Junos offbox agent configuration, If your pristine setup requires this VRF change for additional services like NTP, you'll need to manually address it by following the procedure described at the end of this article.

apstra-cli> scenario add-management-vrf-junos
                                               --systems   Id of the Systems, to choose all systems use "all"
                                               --all       Select all deployed nodes in BP.
                                               --password  Provide password from devices.
                                             --username  Provide username from devices if it's different of agent username.
                                               --nexthop   Provide next-hop if it does not available in pristine config.
                                               --help      show help

apstra-cli> scenario add-management-vrf-junos --all --username admin --password admin

******************************************************
******************** <SN> ********************
******************************************************
================== START ========================
1/5)    Task:    Get and check pristine config
        Status:    "routing-instance mgmt_junos;" not found in pristine config. Continue.
==================================================
2/5)    Task:    Get next hop from pristine config
        Status:    Get OK
==================================================
3/5)    Task:    Update running config on Device
10.28.17.12 config check: passed, committing change.
        Status:    Update OK
==================================================
4/5)    Task:    Update device pristine config
        Status:    Update done
==================================================
5/5)    Task:    Accept running config as golden
        Status:    Accepting done
==================================================
================== END ===========================

<SN> Pristine config successfully updated

 

Manual Pristine Config Update Method

 

Alternatively, you can manually force an update to the Pristine configuration directly in the device CLI by following the procedure outlined below. However, we recommend using the apstra-cli command to avoid validation and syntax errors.

 

Ensure that your UI version includes the 'Force Update?' feature. Navigate to Devices > Managed Devices, select the switch by its Management IP address, and proceed to the 'Pristine Config' tab. Here, when editing the committed_configuration via the option on the left, the 'Force Update?' option should be present next to the 'Update' button. If you do not see this option, please reach out to Juniper Apstra TAC for assistance in upgrading your UI version.

Upon upgrading to Apstra 4.2.1, we recommend fixing this configuration prior to changing the Maintenance Mode to 'Normal'. This will prevent the expected deployment errors due to lack of mgmt_junos VRF. 

 

To address this issue, it's recommended to start by focusing on a single switch to become familiar with the process before applying the same steps to other devices that lack the mgmt_junos VRF:

To address the configuration requirements before upgrading to Apstra 4.1.2 or higher, please follow these structured steps for each device that lacks the mgmt_junos VRF:

 

  • Check for Pending Configurations: In Apstra 4.1.2, before you start, confirm that there are no pending configurations for deployment on the device. This can be done by checking the Service Config section in your Blueprint's Dashboard. Ensure there are no ongoing Pending jobs for the device. Allow any pending job to either complete or fail before proceeding to the next step.

 

  • Update Pristine Configuration in Apstra UI:

    • In the Apstra UI, go to Devices > Managed Devices, click on the switch's Management IP address, and head to the 'Pristine Config' tab.
    • Modify the 'committed_configuration' to include the changes as per the official documentation (system management-instance, adding routing-instances mgmt_junos, etc). Do Not click on the Update button at this point yet. Given that Apstra doesn't verify pristine configurations for accuracy, it's essential to ensure the syntax is accurate prior to updating. 
    • Verify the pristine syntax before updating it. Copy the 4.2.1 editted pristine configuration and go to your switch CLI:

admin@switch> configure exclusive

admin@switch# load override terminal

<paste the contents of the pristine on 4.2.1 VM>

<enter>

^D (ctrl+D)

Only one error related to the gRPC key should be observed, this can be safely ignored (you can also use 'commit check' to verify the syntax after loading the configuration.

Rollback the configuration:

admin@switch# rollback 0 

exit
 

  • Post-editing, from the Pristine Config tab, select the 'Force Update?' option next to the Update button and Update.

 

  • Update Configuration via CLI:

    • Access the switch's CLI and adjust its configuration to meet the required specifications. It's advisable to secure Console access and use the Junos 'commit confirmed' command to prevent being disconnected during the update process.
    • Use the following commands as guidelines, making sure to validate the existing syntax and make the necessary modifications:


set system  management-instance
set routing-instances mgmt_junos routing-options static route 0.0.0.0/0 next-hop <ip_address>
delete routing-options static

 

  • Commit and Review the Changes: Once you've made the adjustments, commit these changes and then review the configuration. It should now incorporate the routing-instances mgmt_junos and system management-instance commands in line with Apstra's official documentation.

 

admin@switch# commit check
admin@switch# commit and-quit

 

  • Change the Maintenance Mode / Apply Full Configuration:

    • If these changes were performed in Apstra 4.2.1 before changing the Maintenance Mode to 'Normal', update it now to 'Normal', all the deployments should turn green from your Blueprint Dashboard.

    • If the change was accomplished after hitting the deployment error, or to verify the correct deployment after performing these changes, from the Telemetry tab of the device, select Config and 'Apply Full Config'. Monitor the success of the deployment through the blueprint's dashboard; ideally, there should be no Failed config anomalies concerning this device. Should any issues emerge, verify the syntax and attempt the process again or contact Juniper Apstra TAC.

Modification History

  • 13 February 2024 - Initial version
  • 6 March 2024 - Included Apstra-cli command