Skip to content

Conversation

@sdargoeuves
Copy link
Collaborator

Following the discussion #2732 (reply in thread), where we mentioned adding a netscaler.yml file under devices, so we can set the user/password in the netscaler.yml device file when creating the docker image.

This branch contains:

  1. add function to render Dockerfile.j2 template (build.py)
  • Allows netlab clab build to detect and render .j2 Dockerfile templates
  • render_j2_dockerfile() function loads system defaults and renders templates with device variables
  • Includes fail() function for template validation with clear error messages
  1. create netscaler Dockerfile.j2 template(Dockerfile.j2)
  • Reads ansible_user and ansible_ssh_pass from device YAML at build time
  • Validates required credentials during template rendering (fails with clear error if missing)
  • Interactive SSH works (netlab connect), show commands functional (netlab connect -s)
  1. Add basic support for netscaler (netscaler.yml)
  • Minimal device support: readiness-check, deploy-config (only hostname and interface descriptions)

Here is a simple topology with a netscaler:

---
message: "Citrix ADC (VPX)"

defaults.devices.eos.clab.image: "ceos:4.29.9.1M"
provider: clab

groups:
  switches:
    _auto_create: true
    device: eos
    members: [ sw1, sw2 ]

nodes:
  lb:
    image: netlab/netscaler # 13.1 - working OK
    device: netscaler
    memory: 4096
    cpu: 2

links:
  - sw1:
    lb:
  - lb:
    sw2:

And it works smoothly:

╰─❯ dnetlab connect lb -s ns runnin
Connecting to container clab-ml_4-lb, executing nscli -U 127.0.0.1:clab:clab@123 "show ns runnin"
 Done
#NS13.1 Build 60.29
# Last modified Tue Jan  6 11:31:35 2026
set ns config -IPAddress 192.168.4.201 -netmask 255.255.255.0
[...]
set ns hostName lb
set interface 0/1 -haHeartbeat OFF -throughput 0 -bandwidthHigh 0 -bandwidthNormal 0 -intftype Linux -ifnum 0/1
set interface 0/2 -speed 1000 -duplex FULL -throughput 0 -bandwidthHigh 0 -bandwidthNormal 0 -intftype Linux -ifnum 0/2
set interface 0/3 -speed 1000 -duplex FULL -ifAlias "lb -> sw1" -throughput 0 -bandwidthHigh 0 -bandwidthNormal 0 -intftype Linux -ifnum 0/3 -lldpmode TRANSCEIVER
set interface 0/4 -speed 1000 -duplex FULL -ifAlias "lb -> sw2" -throughput 0 -bandwidthHigh 0 -bandwidthNormal 0 -intftype Linux -ifnum 0/4 -lldpmode TRANSCEIVER
[...]

Interfaces from the GUI:
image

IP from the GUI:
image

I also have an ugly playbook that builds all the Servers, Service Groups, Services and Virtual Servers, but I don't know if it has a space in netlab yet.

Final point, I haven't done any documentation, but I wanted to discuss first what I'm proposing before working on this.
@ipspace @jbemmel please let me know your thoughts

@sdargoeuves sdargoeuves requested review from ipspace and jbemmel January 6, 2026 11:42
Copy link
Owner

@ipspace ipspace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job. Just a bunch of minor gotchas.

@sdargoeuves sdargoeuves force-pushed the add_netscaler_device branch from bacca37 to 6120218 Compare January 7, 2026 02:23
@ipspace
Copy link
Owner

ipspace commented Jan 7, 2026

Anyway, tell me when the code is somewhat ready to be merged. I'll merge it and then maybe do a bit of polishing:

  • Use the new "run scripts in containers" capability
  • Assign VLANs to interfaces somewhere in Python code

@sdargoeuves
Copy link
Collaborator Author

I'm quite happy with the current state, I've ran some more tests, it works great with two different versions of 13.1 but with the latest 14.1, netlab completes successfully, the loadbalancer is configured as expected, I am just not able to access the GUI, and I can't figure out why. Let's just say it works fine with 13.1, and no GUI with 14.1

Copy link
Owner

@ipspace ipspace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good. Let me try to clean up the deployment task list, then I'll merge it.

@ipspace
Copy link
Owner

ipspace commented Jan 9, 2026

@sdargoeuves -- Submitted my changes as a PR in your repo. If you're OK with them and merge them, they might appear here ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants