Config Manager Render Service
Overview
The NVIDIA Config Manager Network Template Render Service is an event-driven microservice that automatically generates and versions network device configurations. The configured DCIM provider supplies device data and change events; the built-in nautobot-2x provider remains the default. Rendered configurations are stored in the Config Store.
Architecture
The service consists of three main components: the API, the event consumers, and the event dispatcher.
API endpoints
You can use the render service’s API endpoints to trigger the rendering of network device configurations.
POST /v1/render/{device_uuid}/render- Render the configuration for a single devicePOST /v1/render/all- Queue renders for all devices that are enabled for renderingPOST /v1/render/batch- Queue renders for a list of devices
Event Consumers
Two specialized pull-based consumers process NATS JetStream events:
The DCIM event consumer responds to provider-neutral change events for objects such as devices, interfaces, cables, and IP addresses. The consumer validates the event envelope, dispatches it to model-specific handlers, and queues device renders. The built-in Nautobot provider translates its legacy changelog payload at the provider boundary during the compatibility window.
The device change consumer responds to queued render requests from event handlers. It executes renders with distributed locking and updates the Config Store.
External NATS administration
External NATS deployments using password or JWT authentication must provide a tls:// or wss:// endpoint. Secure WebSockets (wss://) establish TLS before the NATS handshake and do not require the native NATS handshake_first setting. Native tls:// endpoints must enable TLS-first negotiation on the server. Add handshake_first: true to the server’s existing tls block, retaining the deployment’s certificate and verification settings:
For native tls:// endpoints, the password- or JWT-authenticated client performs TLS before reading the initial server INFO message and does not fall back to INFO-first negotiation. NATS defaults to sending INFO before TLS, so a server without this setting can cause a TLS error or connection timeout even when its certificates and credentials are valid. The Helm chart does not configure an externally managed server; coordinate this setting with its administrator before connecting.
TLS-first avoids relying on an unauthenticated INFO message to request encryption before sending credentials. This requirement applies to external password and JWT authentication; the bundled nats:// deployment retains its existing negotiation behavior.
The bundled NATS deployment creates the streams automatically. The application creates missing durable consumers at runtime in both bundled and externally managed deployments. When NATS is owned outside the Config Manager deployment, coordinate the streams, account imports, and user permissions with the NATS administrator. An administrator can own consumer provisioning instead by omitting create permission and provisioning the fixed durables described below.
The application uses three fixed durable names in every deployment:
Each stream also has an apiPrefix value. Its default, $JS.API, addresses JetStream in the connected account directly. Override it when the stream belongs to another NATS account and its JetStream API service export is imported under a different local subject prefix. For example:
The prefix is configured per stream because the Config Manager stream can remain local while the Nautobot event stream is imported from another account. It is a local routing prefix, not a stream or consumer name. The NATS user permissions and account service imports must refer to the selected prefix.
For each render pull-consumer <prefix>, <stream>, and <consumer> tuple, the application account needs these consumer subjects:
The account also needs the ordinary data-plane permissions for its configured subjects: subscribe access to request/delivery inboxes, permission to publish acknowledgements to the reply subjects supplied by JetStream, and publish access to any event subjects produced by the application. In an account-import design, the owning administrator must export the corresponding JetStream service subjects and the application account must import them at apiPrefix.
When temporal.archive.enabled=true, the archive service consumes archiveSubject through the fixed archiveConsumer.name and archiveConsumer.deliverySubject. It requires consumer INFO and durable CREATE for that exact stream and durable, subscribe access to the configured delivery subject, and publish access to JetStream acknowledgement subjects. The archive service creates the push durable when it is missing. An administrator can provision the same durable with deliver_policy=new, ack_policy=explicit, ack_wait=360s, max_deliver=288, max_ack_pending=2, the configured filter and delivery subjects, and a delivery group matching the durable name.
The archive service acknowledges a message only after the record is written.
Failed writes retry every five minutes. New durables allow 288 deliveries,
providing roughly a day of retry attempts. This is not a retention guarantee:
stream limits can remove records sooner. Existing durables retain their
configured max_deliver; -1 retries indefinitely while the stream retains
the record. If the final delivery allowed by the durable still fails, the
service logs that it is giving up and terminates the message, leaving that
record unarchived. A successful final attempt is acknowledged normally.
A record that the backend rejects, a record missing a required field, or an unreadable payload is terminated without retry. The same applies when Temporal confirms that the workflow is missing from the namespace named in the event. A namespace mismatch is retried because a misconfigured archive namespace reports every workflow as missing. For older events without a namespace, the service terminates the event after it exceeds namespace retention or another event’s workflow has been found; until then it retries.
The service handles at most two messages concurrently, even if the durable permits more. Each archive attempt has a five-minute timeout within the six-minute acknowledgement wait. Longer attempts are abandoned and retried. During outages, backlog stays in the stream. On shutdown, the service stops taking messages and allows in-flight writes 20 seconds to finish; JetStream redelivers unacknowledged messages.
The archive service exits, and Kubernetes restarts the pod, when neither its durable nor the pod has made progress for 600 seconds, longer than the 360-second ack wait. A pod that is still receiving and retrying messages, as during an archive backend outage, is not restarted. With more than one replica, replicas that receive none of the retries restart each time the timeout passes. If the durable is deleted while the service runs, the service re-creates it after the last acknowledged message, so events published in between are still archived. If re-creation fails, for example without create permission, or if the durable is deleted while no archive pod is running, events published before the durable next exists are not archived. The pod serves nv_config_manager_archive_consumer_last_progress_timestamp_seconds and nv_config_manager_archive_consumer_processing_start_timestamp_seconds (the start of the oldest in-flight delivery, or 0 when idle) on temporal.archive.metricsPort (default 8000). The chart scrapes them when monitoring.podMonitors.enabled is set. Alert on them to find a pod whose event loop is blocked, because such a pod cannot detect its own stall. The chart does not ship these alerts.
Clients specify their stream explicitly and do not request STREAM.INFO for externally managed streams. Stream creation, mutation, and inspection therefore remain administrator operations. When externalServices.nats.local=true, the application retains its existing stream setup behavior for local development.
An administrator-provisioned consumer should use the configured stream and filter subject with the fixed durable name, deliver_policy=new, ack_policy=explicit, ack_wait=360s, and max_deliver=20. The application validates operational settings but does not change an existing consumer or require its delivery policy to match; the owner can retain the delivery policy chosen for a migration boundary.
The render consumers follow the max_deliver of the durable they find and recheck it about every 15 seconds, so an edited limit takes effect without a restart. If handling still fails or the device lock is still unavailable on the final delivery, a consumer logs that it is giving up and terminates the message. A lower limit shortens how long a render keeps retrying, and max_deliver=-1 retries indefinitely. A limit below 9 cannot outlast another render’s 180-second device lock, so it can discard a render that was only waiting for that lock; keep the default unless you have a reason to lower it. A message whose handler raises, for example because Redis or NATS is unavailable, is redelivered after a delay that doubles from 1 second up to 60 seconds, so the default limit rides out about 14 minutes of such failures. DCIM and Config Store errors are not retried: the dispatcher logs and counts them, and the message is acknowledged. A render that waits on another render’s device lock is retried after a delay that doubles from 5 seconds up to 30 seconds. Those retries count toward the same limit, and the default limit waits about 8 minutes, longer than a device lock can be held. A render that gives up because its data is bad is not lost for good: correcting the data triggers a new render.
A render consumer whose fetch loop keeps failing exits, and Kubernetes
restarts its container. The consumer exits when a fetch cycle fails and no
round trip to NATS has completed for CONSUMER_LIVENESS_TIMEOUT_SECONDS.
The default is 600 seconds and must exceed the 360-second acknowledgement
wait. The exit error states how long the consumer was stalled.
A round trip is a completed fetch, including an empty fetch while idle, or a consumer-info lookup while a handler runs. Long configuration-context batches therefore do not count as stalls while those lookups succeed. A blocked event loop or a handler that never returns does not reach the exit check. Alert on the progress and processing-start metrics below to find those cases.
If create permission is omitted and the durable is absent, the consumer logs the exact provisioning request. If delete permission is omitted, the reset API returns instructions to delete and recreate the exact durable at the stream head. Configuration mismatches likewise produce an administrator-ready update request in the consumer log.
Event Dispatcher
The event dispatcher is a dynamic event routing system that maps normalized DCIM object types to handler functions. It maintains a dispatch table for supported render impacts and exposes Prometheus metrics for event processing.
Rendering Process
The rendering process is as follows:
- Fetch normalized
RenderDatafrom the selected DCIM provider. - Render the configuration using the
nv_config_manager_templates.Renderer. - Persist the rendered files using the Config Store client.
- Record intended-configuration metadata through the DCIM provider.
Template Version Management
Template updater: Runs as a Kubernetes job after Helm installs and upgrades.
It queries the selected DCIM provider for devices with a stale template_version
and renders those devices directly with bounded concurrency. Each update uses the
device’s Redis-backed render lock.
The updater selects only render-enabled devices whose aggregate-management flag matches the environment. Every deployment also enforces ownership when a render executes: aggregate deployments reject non-aggregate-managed devices, and non-aggregate deployments reject aggregate-managed devices. Manual requests outside that scope return 403; queued requests are skipped without writing configs.
Version tracking: A successful render records the
nv_config_manager_templates version through the selected DCIM provider. The
next template-updater job skips devices that already have the current version.
Deployment
The service uses two consumer deployments (nautobot and device), a separate
template-updater job that runs after Helm installs and upgrades, and Redis for
distributed locking. It exposes Prometheus metrics on port 8000.
The service is configured using a configuration file (config.py). The configuration file contains the selected DCIM provider settings, NATS connection details (TLS, credentials), Redis connection for locking, Config Store client settings, and environment-specific aggregate management flags. External providers configure dcim_change_stream and dcim_change_subject; empty Helm values retain the historical Nautobot stream and subject.
Set global.defaultUserDomain in Helm to supply the fallback domain used for
Config Store attribution by the Render API, consumers, and template updater.
The chart exposes it to these workloads as NV_CONFIG_MANAGER_DOMAIN.
Monitoring
Prometheus metrics:
Event processing:
nv_config_manager_events_received- Events received through NATS (by model, instance, namespace).nv_config_manager_events_processed- Events successfully processed.nv_config_manager_events_skipped- Events skipped (no handler, device not enabled).nv_config_manager_events_failed- Events that failed processing (by exception type).nv_config_manager_event_processing_time- Event processing duration histogram.
Legacy Nautobot change compatibility:
nv_config_manager_nautobot_change_messages_receivednv_config_manager_nautobot_change_messages_processednv_config_manager_nautobot_change_messages_failednv_config_manager_nautobot_change_message_processing_time- Render durationnv_config_manager_nautobot_change_message_end_to_end_time- Nautobot publish to Config Store persist
Consumer delivery:
nv_config_manager_nats_consumer_messages_given_up_total- Messages terminated on the final delivery the durable allows (by consumer, stream, namespace, andreason:failedwhen every delivery failed,lockwhen the render never acquired the device lock)nv_config_manager_nats_consumer_last_progress_timestamp_seconds- Unix time the consumer last completed a fetch, idle fetches included, or finished handling a message. Alert whentime()minus this value keeps growing whileprocessing_start_timestamp_secondsis 0nv_config_manager_nats_consumer_processing_start_timestamp_seconds- Unix time the consumer started handling its current message, or 0 when idle. A nonzero value that stays unchanged for longer than your longest render is a handler that is not returningnv_config_manager_nats_consumer_processing_duration_seconds- Histogram of time spent handling a message, recorded when the handler returns or raisesnv_config_manager_nats_consumer_last_nats_success_timestamp_seconds- Unix time of the last completed fetch or consumer info lookupnv_config_manager_nats_consumer_nats_failures_total- Failed consumer cycles and consumer info lookups (byoperation:cycleorconsumer_info)nv_config_manager_nats_consumer_nats_reconnects_total- Times the NATS connection was re-established
Error handling
Exception types:
DCIMError- DCIM provider API errors, logged, ACK (not retried). An error from the event handler’s own lookups increments the event failed counter. An error while checking one device’s render status during enqueue only skips that device: it is logged and the event still counts as processed, so the failed counter does not show itRenderException- Template rendering failures, ACK (do not retry)DeviceNotEnabledError- Device not enabled for rendering, ACKEventParseError- Malformed event data, fail counter incrementedConfigStoreException- Config store persistence errors, logged and counted, ACK (not retried)
Consumer behavior:
- ACK: Successful processing, render exceptions (will not succeed on retry), DCIM and Config Store errors, disabled devices
- NAK: Handler failures other than DCIM and Config Store errors, with a delay that doubles from 1s up to 60s; lock acquisition failures, with a delay that doubles from 5s up to 30s
- TERM: The final delivery the durable’s
max_deliverallows, when the render still failed or never acquired the device lock - Consumer recreation: Any fetch/heartbeat failure triggers automatic consumer rebuild
Key design patterns
Provider-owned handler registration: The event dispatcher exposes a registration surface; the selected provider registers its own object-type handlers and owns affected-device resolution.
Pull-based consumption: Consumers fetch messages on demand instead of using push-based subscriptions, which improves flow control and horizontal scaling.
Distributed locking: Redis-backed locks prevent concurrent renders for the same device across multiple consumer instances.
Version-aware processing: The template-updater job selects only devices with rendering enabled in the DCIM provider, then compares the current template package version with the version recorded by the selected DCIM provider. It renders stale devices directly with bounded concurrency and per-device locks.
Provider-backed data access: Render obtains normalized device data and managed-device state from the configured DCIM provider. Template rendering runs in a thread pool using asyncio.to_thread() to avoid blocking the event loop.
Connection sharing: NATSConnectionManager shares the NATS connection across components within a process.