> This page is for Remediation Orchestrator.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/remediation-orchestrator/llms.txt.

# domains

**Experimental.** For evaluation. Interfaces, configuration, and behavior may change incompatibly.

Coordinates operations across nodes that share infrastructure domains. Available topology depends on the configured provider.

### Prerequisites

* Configured [Slurm](https://github.com/dsx-ai-factory/remediation-orchestrator/blob/1785e695a8bff76c910115b3c96398a5a59a7183/fern/pages/reference/starlark/catalog.mdx#slurm) or [Kubernetes](https://github.com/dsx-ai-factory/remediation-orchestrator/blob/1785e695a8bff76c910115b3c96398a5a59a7183/fern/pages/reference/starlark/catalog.mdx#kubernetes) with populated topology.

### Setup

* Loads automatically with a configured provider; no `[modules.domains]` table is needed.

Domain-level operations for managing groups of nodes that share infrastructure (e.g., NVSwitch domains).

## Members

* [cancel_workflows](#cancel_workflows)
* [get](#get)
* [get_nodes](#get_nodes)
* [get_racks](#get_racks)
* [join_domain_coordinator](#join_domain_coordinator)
* [list](#list)
* [perform](#perform)
* [set](#set)

## cancel_workflows

Cancel running workflows for nodes in a domain. Matches workflows whose ID contains the hostname as a '-'-delimited segment (e.g., on_taint, on_cordon, on_drain workflows). Optionally filter by script_name to cancel only workflows from a specific script. Blocks until each workflow's cancel handler completes.

Any hostname in the target domain.

Only cancel workflows from this script (e.g., 'breakfix.star'). If empty, cancels all matching workflows.

If true, skip cancelling the workflow for the triggering hostname.

Number of workflows cancelled.

## get

Read a domain row (state + metadata) from the domains table. Returns a DomainResult with name, state, and metadata. Errors if the row does not exist.

Domain name (e.g., 'nvl72D008').

DomainResult with name, state, and metadata.

## get_nodes

Get all node hostnames in the same domain as the given hostname.

Any hostname in the target domain.

List of all hostnames in the domain.

## get_racks

Get the racks and their node membership within a domain from one topology snapshot.

Domain whose direct Rack children should be returned.

RackResult values sorted by Rack name.

## join_domain_coordinator

Join the workflow coordinator for a domain at fixed id domain-coordinator-\{domain_key}: the first member starts that coordinator if needed, every member sends an ACK, then each blocks until the coordinator signals proceed.

Domain identifier; same for all members. Workflow id is domain-coordinator-\{domain_key}.

Members that must ACK (e.g. len(domains.get_nodes(h))).

Dedupe key, usually hostname. Empty uses this workflow run id.

Script that defines the coordinator-side Starlark function (e.g. breakfix.star). Empty disables coordinator Starlark.

Top-level function run on the coordinator; Args doc must use the Remediation Orchestrator argument format `name: dict\[string:any\], ...` (not `name (type):`). Empty disables.

Max time the coordinator waits for ACKs (e.g. '2h'). Defaults to '' (wait forever). On timeout it proceeds with whoever acked.

Max time this member waits for the coordinator's proceed signal (e.g. '4h'). Defaults to '' (wait forever). On timeout this member proceeds without it.

JoinCoordinatorResult with acked_count and timed_out.

## list

List all domain names persisted in the domains table for a cluster.

Domain names, sorted ascending.

## perform

Apply a function to each node in a domain. Retries failed nodes with exponential backoff until all succeed or the timeout is reached. Returns a PerformResult with succeeded/failed lists on success. Raises an error if the timeout is reached with nodes still failing. Example: domains.perform(node.node_id, lambda node_id: slurm.drain_node(node_id, reason), timeout='10m')

Any hostname in the target domain. Used to look up which domain to operate on.

Function to apply to each node in the domain. Called once per node with the node's hostname.

If true, skip the triggering hostname.

Max time to retry failed nodes (e.g., '10m', '30m'). Defaults to '10m'.

PerformResult with succeeded and failed hostname lists.

## set

Upsert a domain's state and/or metadata. An empty state leaves the existing state unchanged; an empty metadata dict leaves existing metadata unchanged. Example: domains.set('nvl72D008', state='draining', metadata=\{'reason': 'NVSwitch failure'})

Domain name (e.g., 'nvl72D008').

New state. Valid values: degraded, draining, healthy, with_provider. Empty string leaves it unchanged.

Metadata dict. Empty dict leaves existing metadata unchanged.

True on success.