dzs adapter¶
Inmanta module to manage DZS OLT devices.
Environment variables¶
Env variable name |
Description |
|---|---|
INMANTA_DZS_SESSION_IDLE_TIMEOUT |
Number of seconds an idle ssh session to a device is kept open before being closed (default: |
INMANTA_DZS_INVENTORY_TIMEOUT |
Number of seconds to wait for the |
Session idle timeout¶
The handlers share one ssh session per agent, which they cache and close once it was idle for
INMANTA_DZS_SESSION_IDLE_TIMEOUT seconds. The driver itself considers a session expired a few seconds
later (SESSION_IDLE_TIMEOUT_MARGIN), and reopens it before using it again, so that a session which the
cache didn’t close is never reused once it may have been dropped by the device.
The executor of an agent is stopped once it was idle for the executor retention time of the orchestrator
(executor-retention-time in the [agent] section of its config, 60 seconds by default), which closes its
session too. A session therefore stays open for the shorter of the two: to keep the sessions open longer,
raise both together, the executor retention time slightly above INMANTA_DZS_SESSION_IDLE_TIMEOUT.
The credentials of a dzs::Device can either be set directly (username/password) or resolved on the
agent at deploy time from an environment variable, using a reference (std::create_environment_reference).
Usage example¶
This example configures an onu, one of its rules and one of its bridges. It corresponds to the model
used in the test suite (tests/test_model.py).
import dzs
device = dzs::Device(
host="0.0.0.0",
username=std::create_environment_reference("DZS_USERNAME"),
password=std::create_environment_reference("DZS_PASSWORD"),
strict_key=false,
)
onu = dzs::Onu(
device=device,
slot=2,
olt=12,
me_profile="zhone-2424",
serial_number="00112233",
)
rule = dzs::Rule(
device=device,
group_index=1,
member_index=1,
access_type="PPPoE",
)
bridge = dzs::Bridge(
device=device,
onu=onu,
rule=rule,
vlan=100,
slan=0,
eth_port=1,
gtp=1,
encapsulation="tagged",
rg_bridged=false,
uni_vlan_priority_tagged=false,
)
dzs::Onu requires either regid or serial_number to be set (not both), to identify the onu on the
olt. The full model definition, with a description of every entity and attribute, is documented in
model/_init.cf and picked up by the generated module documentation, the same way as for other
Inmanta modules (e.g. netbox).