Docs
Tutorial

Deploy into a branch

Deploy the compute rack into a NetBox branch, look at it there, then merge it into main.

The rack is 271 objects, which is more than you'd want to put into a NetBox on faith. A plan can target a NetBox branch instead of main. Applying it writes to the branch, so you can look at the result in NetBox, with nothing on main changed, and then merge the branch or throw it away. This chapter merges it, and the deployment follows the rack to main.

This needs the NetBox Branching plugin on your NetBox, and the token's user allowed to create and merge branches. If you don't have it, skip to Deploy it to main: you arrive at the same place, and the rest of the tutorial is the same.

Plan into a branch

  1. Open tutorial/compute_rack in the catalogue and select Deploy, then choose your NetBox.
  2. Under Branch, enter rack-r1-build. Designs creates the branch, because NetBox doesn't have it yet.
  3. Under Deployment, leave New deployment selected and name it rack-r1.
  4. Set the variables: rack_name to R1, and site_slug to riga-dc, the site from A second design.
  5. Select Plan.

The plan is computed against the branch, which starts as a copy of main. It creates 271 objects: the rack, eleven devices and their modules, their interfaces, power ports, console ports and module bays, 30 cables, and the device types, module types, rack type, roles and manufacturers they need. Open a few of the groups to see how they nest: each server's interfaces sit under the server, and each cable names the two ports it joins.

Apply it, and look

Select Apply Changes. The changes go into the branch, and main is unchanged.

In NetBox, switch to the branch rack-r1-build in the branch selector. Go to Racks and open R1: the elevation shows the switch at the top and ten servers below it. Open a server and its interfaces: Ethernet/PCIE1/1 and Ethernet/PCIE1/2 are each cabled to a port on the switch, and iDRAC9 to another. Switch back to main: there is no rack R1.

That is the whole point of a branch. You have seen exactly what the design builds, in NetBox, and nothing has happened to main.

Merge it

In NetBox, open the branch rack-r1-build from the branch selector's list, select Merge, tick Commit changes (unticked, NetBox only rehearses the merge) and confirm. Rack R1 is on main, with the same ids the objects had on the branch.

Back in Designs, open Deployments. rack-r1 is on your NetBox now rather than on the branch: Designs asked NetBox about the branch, found it merged, and moved the deployment to main with everything it owns and its history, so the plan that built the rack is still there to open. It still owns the 271 objects it created, because NetBox kept their ids across the merge. Open it and select Check drift: in sync. Redeploy, Check drift and Tear down work on main from here.

Had you deleted the branch instead, the rack would have gone with it, main never having had it, and rack-r1 would be listed under All as Branch gone, owning nothing, with Remove to forget it. That is how to throw a deployment into a branch away.

You have the rack on main. Skip the next section, which is for readers without the Branching plugin.

Deploy it to main

If your NetBox has no Branching plugin, deploy the rack to main directly.

  1. Open tutorial/compute_rack in the catalogue and select Deploy, then choose your NetBox.
  2. Leave Branch empty.
  3. Under Deployment, leave New deployment selected and name it rack-r1.
  4. Set rack_name to R1 and site_slug to riga-dc, the site from A second design, and select Plan. It creates 271 objects.
  5. Select Apply Changes.

In NetBox, rack R1 stands in Riga DC, with its switch at the top, ten servers below it, and every cable connected.

Next, a second rack alongside it.

On this page