Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Juniper Apstra Device Replacement Guide

An essential operation in a working data center network is the need to replace a device that failed or needs to be re-allocated or reused for other purposes. This document describes how to replace a Juniper Apstra managed device using the Apstra GUI and Apstra Terraform Provider.

Replace a Managed Device Using the Apstra GUI

Replacing a managed device in the Apstra GUI is a straightforward set of tasks. The managed devices are abstracted from their role in the fabric using Logical Devices and Interface Maps and are assigned to a blueprint.

Note:

In these procedures, we are replacing the leaf2 device in the GUI. The replacement device (leaf2) is exactly the same physical device (make, model and port configuration) as the device we are replacing.

In this topic, we'll show you how to replace a device using the following methods:

Delete a Leaf with a Still Connected Device

  1. From the left navigation menu in the Apstra GUI, navigate to Blueprints > Blueprint ID > Staged > Physical > Build, then click the Devices icon.

  2. Click Assigned System IDs - Managed Nodes , then click the Change System IDs Assignments icon.

  3. Click the trash icon, then click Update Assignments to unassign leaf2.

    Here we can see that leaf2 in no longer assigned.

  4. Navigate to the Uncommitted tab and click the Commit rocket icon.

  5. Add a comment if desired, and click Commit.

  6. When the commit is complete, navigate to the Devices > Managed Devices to return to the Managed Devices table view.

    Leaf2 is now unassigned from the blueprint.

  7. Uninstall the agent from leaf2 by clicking the Uninstall icon.

  8. From the pop-up dialog box, click Confirm to uninstall the system agent.

  9. After the uninstall completes, the leaf2 State shows as oos-nocomms with a red x in the Comms column.

  10. The final step is to delete the leaf2 device completely from Apstra. There are two steps:
    1. First, click the trash icon in the Device panel.

      Then click Delete from the following dialog to remove the device.

    2. The click the Agent Uninstall icon in the Agent panel.

      Then click Confirm from the dialog box to uninstall the agent.

When complete the leaf2 device is removed from the blueprint.

Delete a Failed Leaf Device

For this procedure, we'll delete a that has failed and is no longer communicating with Apstra.

  1. From the left navigation menu in the Apstra GUI, navigate to Blueprints> Staged > Physical > Build and click the Devices icon. If the device already exists in the table, you can skip this step and proceed to Step 2.

  2. Click Assigned System IDs - Managed Nodes > and click the Change System IDs Assignments icon.

  3. Click the trash icon to remove the leaf2 assignment, then click Update Assignments.

  4. Verify that leaf2 is no longer assigned.

  5. Navigate to the Uncommitted tab, then click the Commit rocket icon.

  6. Add a comment if desired, and click Commit.

  7. When the commit is complete, navigate to the Devices > Managed Devices panel to return to the managed devices table view.

    The Leaf2 device is now unassigned from the blueprint.

  8. Click the trash icon in the Device panel.

  9. Click Delete to remove the failed device (leaf2) from the Managed Devices table.

  10. Delete the agent from the device.

    Select the device from the Managed Devices table (10.28.252.14 in our example) and click the trash icon in the Agent panel to delete the agent.

  11. Click the Force delete check box, then click Delete to force the deletion.

You successfully removed the failed device from the blueprint.

Add the Replacement Device to the Blueprint

Let's now take a look at what is required to replace the device back into the blueprint.

  1. From the left navigation menu in the Apstra GUI, navigate to Devices > Managed Devices.

    If the device already exists in the table, you can skip this step and proceed to Step 2.

  2. From the Managed Devices page, click Create Onbox Agents(s). Note that SONIC devices use Onbox Agents.

  3. Enter the device address, username and password, then click Create.

  4. When the agent completes the installation, click Acknowledge selected systems from the Device panel located above the Managed Devices table.

  5. Click Confirm from the dialog box to acknowledge the device.

  6. Navigate to Blueprints > Blueprint ID > Staged > Physical > Build, then click the Devices icon.

  7. Click Assigned System IDs - Managed Nodes , then click the Change System IDs Assignments icon.

  8. Select the leaf2 replacement device, click the Deploy radio button, then click Update Assignments.

  9. Commit the change by navigating to the Uncommitted tab, then click the Commit rocket icon.

  10. Comment and click Commit to add the replacement device to your blueprint.

    Note:

    The deployment will take some time to stabilize and any anomalies should eventually converge and disappear.

Replace a Device in Apstra Using Apstra Terraform Provider

You can easily replace a device in a blueprint using Apstra Terraform Provider. The below diagram shows the topology we are using in this procedure.

In the following example Terraform configuration, we are replacing the leaf device (rack_a_001_leaf1).
Note:

We assume that the Terraform configuration is applied to the Apstra server and all of the resources for the blueprint are allocated and committed.

Example Terraform Configuration

To replace a device using Terraform:

  1. Remove the following resource block for the device from the Terraform configuration. Note that you cannot remove a device from Apstra without first removing it from your blueprint.
    In this example, we are removing the rack_a_001_leaf1 device.

    Run the terraform apply command to apply the changes.

  2. After the apply is complete, commit the changes.
  3. Update the Terraform configuration with the new information for the replacement device.
    Replace the device_key and the agent_id with the new values.
    You can derive these values in the Apstra GUI by navigating to the Devices > Managed Devices page and selecting the device IP address as follows:
  4. From the Device page, copy the encoded device key and agent ID from the URL string.
    To decode the URL string and obtain the new device_key (system-id) and agent ID values, run the pbpaste | base64 --decode command. For example:
    Note:

    You can also derive the agent-id from a data source, from Swagger, or from the Terraform resource that created it.

  5. Once you have replaced the information into Terraform, apply the new configuration:
  6. Commit your changes in the Apstra GUI or in Terraform to finish replacing the device.
Good job! You successfully replaced a device in Apstra.
Note:

In our examples, we removed any existing configuration from the new device and performed a device reboot. However, in some use cases, such as SONiC devices, you might be required to remove any existing configuration from the device.

For example:

See the Juniper Apstra User Guide for information about configuring a SONiC device.