Sensor Power-State Management Support Using gNMI
You can use gNMI to manage the power state of the Routing Engines (controller cards) on a
dual Routing Engine system. You can configure a Routing Engine to power off and remain powered
off by using gNMI to set the OpenConfig
path/components/component/controller-card/config/power-admin-state
value to
POWER_DISABLED.
When you configure the power state of the backup Routing Engine (secondary controller card)
as POWER_DISABLED, the configuration takes effect immediately. The
device powers off the Routing Engine and sets the config/power-admin-state
to
POWER_DISABLED. The Routing Engine remains powered off even through
reboots. Similarly, setting the power state to POWER_ENABLED
immediately brings the Routing Engine back online.
If you configure the power state of the primary Routing Engine as POWER_DISABLED, the configuration takes effect upon the next reboot or switchover. However, configuring POWER_DISABLED on the primary Routing Engine automatically triggers a switchover. Thus, after the primary Routing Engine assumes the backup role, it immediately powers off.
Consider the following rules before making changes to the power-admin-state of your device:
-
Only controller cards in the SECONDARY
state/redundant-role
honor changes in theconfig/power-admin-state
to POWER_DISABLED. -
On controller cards in the PRIMARY
state/redundant-role
, if you try to setconfig/power-admin-state
to POWER_DISABLED, the operation is allowed. However, thestate/power-admin-state
may remain as POWER_ENABLED until the next switchover or reboot. -
A switchover is initiated to change the role of PRIMARY to SECONDARY as soon as you configure the active Routing Engine as POWER_DISABLED.
A gNMI client can configure a Routing Engine to remain powered off, for example:
gnmic -a hostname:port -u user -p password --tls-ca /path/to/serverRootCA --update-path /components/component[name=node]/controller-card/config/power-admin-state/ --update-value "POWER_DISABLED" --timeout timeout
The following example uses the gNMI client gnmic
to send a
SetRequest
to update the config/power-admin-state
value to
POWER_DISABLED
for the backup Routing Engine (RE1):
user@client:~$ gnmic -a 10.1.1.2:32767 -u grpc-user -p password --tls-ca /etc/pki/certs/serverRootCA.crt set --update-path /components/component[name=RE1]/controller-card/config/power-admin-state/ --update-value "POWER_DISABLED" --timeout 30s { "source": "10.1.1.2:32767", "timestamp": 1739315808281370579, "time": "2025-02-11T15:16:48.281370579-08:00", "results": [ { "operation": "UPDATE", "path": "openconfig:components/component[name=RE1]/controller-card/config/power-admin-state" } ] }
Verify the configuration.
user@host> show configuration openconfig-platform:components component RE1 { controller-card { config { openconfig-platform-controller-card:power-admin-state POWER_DISABLED; } } }
The OpenConfig configuration is equivalent to issuing the set system node offline
node
configuration mode command in the Junos OS Evolved
configuration.
Use the show system nodes
operational mode command to verify that the state
of the Routing Engine is offline.
user@host> show system nodes re1 Node: re1 Node Id : 0 Node Nonce : 0 Status : offline, configured-offline Attributes :
Similarly, you can re-enable the Routing Engine.
gnmic -a hostname:port -u user -p password --tls-ca /path/to/serverRootCA --update-path /components/component[name=node]/controller-card/config/power-admin-state/ --update-value "POWER_ENABLED" --timeout timeout
The following example uses the gNMI client gnmic
to send a
SetRequest
to update the config/power-admin-state
value to
POWER_ENABLED
for the backup Routing Engine (RE1) :
user@client:~$ gnmic -a 10.1.1.2:32767 -u grpc-user -p password --tls-ca /etc/pki/certs/serverRootCA.crt set --update-path /components/component[name=RE1]/controller-card/config/power-admin-state/ --update-value "POWER_ENABLED" --timeout 30s { "source": "10.1.1.2:32767", "timestamp": 1739315506688244303, "time": "2025-02-11T15:11:46.688244303-08:00", "results": [ { "operation": "UPDATE", "path": "openconfig:components/component[name=RE1]/controller-card/config/power-admin-state" } ] }
When you update the config/power-admin-state
to
POWER_ENABLED
, the Routing Engine is brought online.
user@host> show system nodes re1 Node: re1 Node Id : 2201170739205 Node Nonce : 2159053780 Status : online, apps-ready Attributes : FABRIC_CONTROL (Spare), FABRIC_FCHIP_PARALLEL (Spare), PFE_TOKEN (Spare), RE (Spare), TIMINGD_RE (Spare), BackupRE (Active)