add_node
Add a node to the open lab in PNETLab using a type and template, applying built-in defaults so it's fully configured and ready to boot. Pass optional overrides for customization.
Instructions
Add a node to the open lab. type/template come from list_templates
(e.g. type="vpcs" template="vpcs", or type="qemu" template="mikrotik").
By default (template_defaults=True) the template's built-in defaults are
auto-applied -- image, ram, cpu, qemu_arch/qemu_nic/qemu_options/qemu_version,
console, icon, config_script -- exactly what a GUI-created node inherits. So a
bare add_node("qemu", "mikrotik", "R1") produces a fully bootable node with
the right image and console; you usually don't need list_images first. Any field
you pass explicitly overrides the template default. Pass
template_defaults=False to supply everything yourself.
console defaults to the template's console, falling back to telnet for
qemu/iol/dynamips (needed for status reporting and the console tools). icon
defaults to the template's icon (e.g. mikrotik -> Router.png), falling back to
Desktop.png only when the template has none or template_defaults=False.
Pass an explicit icon to override. Node is added stopped; call start_node to
boot it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cpu | No | ||
| ram | No | ||
| top | No | ||
| icon | No | ||
| left | No | ||
| name | Yes | ||
| type | Yes | ||
| delay | No | ||
| image | No | ||
| config | No | Unconfigured | |
| serial | No | ||
| console | No | ||
| ethernet | No | ||
| firstmac | No | ||
| pci_mode | No | ||
| qemu_nic | No | ||
| template | Yes | ||
| qemu_arch | No | ||
| qemu_options | No | ||
| qemu_version | No | ||
| config_script | No | ||
| template_defaults | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |