Docs
Tutorial

Deploy into a branch

Deploy the compute rack into a NetBox branch, look at it there, then deploy it to 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 needs the NetBox Branching plugin on your NetBox, and the token's user allowed to create and use branches. If you don't have it, skip to Deploy it to main: 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, or not

From here you can merge the branch in NetBox, and rack R1 is on main. To Designs, a branch is another NetBox: the deployment rack-r1 you just applied belongs to the branch, and the objects the merge puts on main belong to no deployment until you plan the design against main, which adopts them rather than creating them again.

For this tutorial, don't merge. Release the deployment, delete the branch in NetBox, and deploy the rack to main in the next step. The reason is what the last chapters rely on: a deployment that created its objects can tear them down, and one that adopted them never deletes them. Deploying to main directly means rack-r1 creates rack R1, so you can take it apart again in Tear down and release. Deployments explains created and adopted.

  1. Go to Deployments, open rack-r1, and select Release, then Confirm Release. Designs stops managing the branch's rack; nothing in NetBox changes. A deployment left on a branch that is then deleted would otherwise stay listed as if the branch were still there.
  2. In NetBox, delete the branch rack-r1-build.

Deploy it to main

  1. Select Deploy on tutorial/compute_rack again, and choose your NetBox.
  2. Leave Branch empty.
  3. Leave New deployment selected and name it rack-r1. It's a new deployment on main, even though the branch had one of the same name.
  4. Set rack_name to R1 and site_slug to riga-dc, and select Plan. It's the same 271 creates.
  5. Select Apply Changes.

In NetBox, on main this time, 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