Automatic Out-of-band Management (OOB)#

Author: Sam Eure

April 4, 2025

[1]:
# Imports (run once)
from air_sdk import AirApi
from air_sdk.endpoints import Simulation
[ ]:
# Authentication (run once)
api = AirApi.with_ngc_config()
# OR api = AirApi.with_api_key(api_key="...")
# OR api = AirApi.with_device_login(email="...", org_num="...")
#    ^ use in terminal only — not supported in Jupyter notebooks

Configuring OOB during importing#

Clients can specify that they would like an OOB network to be automatically configured on top of their simulation’s primary network at the time of creation via JSON or DOT file importing.

Explicitly add OOB on import#

[ ]:
json_data = {
    'format': 'JSON',
    'name': 'JSON Sim',
    'content': {
        'nodes': {
            'node1': {
                'cpu': 2,
                'memory': 1024,
                'storage': 10,
                'os': 'generic/ubuntu2204',
                'cpu_arch': 'x86',
            },
        },
        'oob': True,  # <--- # This explicitly tells Air to add an OOB network
    },
}

sim: Simulation = api.simulations.import_from_data(**json_data)
sim.wait_for_state('INACTIVE', error_states='INVALID')
sim.auto_oob_enabled
True

Explicitly tell Air NOT to add OOB#

[ ]:
json_data = {
    'format': 'JSON',
    'name': 'JSON Sim',
    'content': {
        'nodes': {
            'node1': {
                'cpu': 2,
                'memory': 1024,
                'storage': 10,
                'os': 'generic/ubuntu2204',
                'cpu_arch': 'x86',
            },
        },
        'oob': False,  # <--- # This explicitly tells Air NOT to add an OOB network
    },
}

sim: Simulation = api.simulations.import_from_data(**json_data)
sim.wait_for_state('INACTIVE', error_states='INVALID')
# None here means OOB is not enabled (API leaves it unset when oob: false).
print(sim.auto_oob_enabled)
None

Implicitly add OOB#

[ ]:
json_data = {
    'format': 'JSON',
    'name': 'JSON Sim',
    'content': {
        'nodes': {
            'node1': {
                'cpu': 2,
                'memory': 1024,
                'storage': 10,
                'os': 'generic/ubuntu2204',
                'cpu_arch': 'x86',
            },
        },
        # Excluding the `oob` key from the payload
        # implicitly tells Air to add an OOB network
    },
}

sim: Simulation = api.simulations.import_from_data(**json_data)
sim.wait_for_state('INACTIVE', error_states='INVALID')
sim.auto_oob_enabled
True

Toggling On/Off Automatic OOB#

After a simulation has been created, the automatic OOB network may be toggled On/Off for an existing simulation.

Toggling On Automatic OOB#

[ ]:
sim_id = '...'  # <--- # Simulation ID for sim without OOB
sim: Simulation = api.simulations.get(sim_id)
assert sim.auto_oob_enabled is not True

# Toggle ON OOB
sim.enable_auto_oob()
sim.auto_oob_enabled
True

Toggling Off Automatic OOB#

[ ]:
sim_id = '...'  # <--- # Simulation ID for sim with OOB
sim: Simulation = api.simulations.get(sim_id)
assert sim.auto_oob_enabled is True

# Toggle OFF OOB
sim.disable_auto_oob()
sim.auto_oob_enabled
False