Community Contribution — This project was originally authored by OpsMill community member Jordy.
This project provides a native way to generate rack elevation diagrams in Infrahub. It includes the schema definitions and transform logic needed to represent and render the physical layout of devices within a rack — directly inside your Infrahub instance.
This is not a plugin or a traditional extension. It's a self-contained set of resources (schemas, transforms, artifacts) that you can load into any Infrahub deployment using built-in platform features — no custom code or patching required.
If you manage physical infrastructure, you know that keeping track of what sits where in a rack is critical — for capacity planning, cable management, power budgeting, and change operations.
Rack Elevation gives you:
- A visual representation of device placement within racks, with accurate U-position mapping.
- A single source of truth — rack layout lives alongside the rest of your infrastructure data in Infrahub, not in a separate spreadsheet or tool. Changes made in Infrahub are automatically reflected in the rack elevation.
- Integration ready — generates a valid SVG file that you can query via the Infrahub API and display or share anywhere.
- Version control and branching — because it's native Infrahub data, your rack layouts benefit from the same Git-like workflow as everything else: branches, proposed changes, diff, and merge. You can view rack elevations as they were weeks ago.
Following the Infrahub philosophy, we give you direct access to the source code. It takes a bit more effort to integrate, but you have full control and can fine-tune it to fit your exact needs.
See more details in the Infrahub Artifact Guide.
Important
If you are not using the schema library, refer to the schema integration guide to integrate rack elevation into your project.
If you are using the schema library, the only schema change required is ensuring your LocationRack node inherits from the CoreArtifactTarget generic.
- name: Rack
namespace: Location
inherit_from:
+ - CoreArtifactTargetCreate a StandardGroup named racks and add all the rack objects you want a rack elevation artifact for.
In the UI, go to Object Management > Groups.
Make sure you have copied all files to the corresponding folders in your Infrahub repository. You can adjust the naming in the next step, but ensure all files are in place as follows:
.
├── transforms/
│ ├── rack_svg.py
│ └── rack_elevation.svg.j2
├── schemas/
└── queries/
└── rack_visualization.gql
Then add the following to your .infrahub.yml file:
---
artifact_definitions:
- name: rack_elevation
artifact_name: rack_elevation
content_type: image/svg+xml
targets: racks
transformation: rack_elevation
parameters:
name: name__value
python_transforms:
- name: rack_elevation
class_name: RackElevationTransform
file_path: transforms/rack_svg.py
queries:
- name: rack_elevation_query
file_path: queries/rack_visualization.gqlTo confirm everything works, run the transform to get the SVG output.
uv run infrahubctl transform rack_elevation name=my-rack --branch "main"This returns the full SVG string, which you can paste into any SVG viewer to inspect the result.
Tip
You should be all set for the initial setup. Push everything to the Git repository connected to your Infrahub instance, then move on to the usage section below.
This follows standard artifact/transform usage in Infrahub.
First, make sure the new query and transform have been imported from Git. You can verify this under Integrations > Git repositories by clicking on your repository.
- Create a branch.
- Add a rack to the
racksgroup created earlier. - Open a proposed change.
- Alternatively, go to
Actions>Artifact Definitionto force generation.
- Alternatively, go to
- Wait for the tasks to complete.
Tip
Open the detailed view of your rack. In the Artifacts tab you should find the rack elevation artifact.
This is a community-driven project. If you'd like to contribute — whether it's fixing a bug or improving the visualization — feel free to open an issue or submit a pull request.
