hellt / vrnetlab

Make VM-based Network OSes run in Containerlab
https://containerlab.dev
MIT License
129 stars 88 forks source link

vJunos/vSRX: Slim Dockerfiles, use virtio for boot disk mounting, standardise across Juniper models #210

Closed vista- closed 4 months ago

vista- commented 5 months ago

This PR contains "slim" Dockerfiles, virtio disks for all non-EOL Juniper models, and XHCI-based config disks for vJunos models.

Slim Dockerfiles

All vJunos-based models now have the same Dockerfile, which now contains the --no-install-recommends option for apt. This reduces the container image sizes by ~650 MB for every vJunos image.

virtio disks

All non-EOL Juniper devices now run off of virtio-mounted disks, which both increases boot speed and performance, and decreases virtualisation overhead.

I ran a benchmark launching all 4 VM models at the same time, and got the following results:

Type IDE boot time virtio boot time Improvement
vSRX 3.0 04:24 02:34 42%
vJunosEvolved 01:39 01:08 32%
vJunos-router 02:22 01:57 18%
vJunos-switch 02:30 02:04 18%

XHCI-based boot disks

All vJunos-based vrnet node types now use the same mechanism for loading a startup configuration, USB storage mounted through an XHCI controller. XHCI has lower virtualisation overhead[1] compared to EHCI/UHCI, and is supported by all vJunos models, it's an easy win for standardisation.

All changes have been tested with:

hellt commented 5 months ago

I did format the code with ruff (this is the default formatter for this repo) and left a single comment about the crypt module alternative

hellt commented 4 months ago

we are keeping this open till the issue with loop0 is solved (discussed in discord)

vista- commented 4 months ago

The loop issue fix is commited, this PR is ready for review again. I also increased the config disk size to a comfortable 32 MB.

hellt commented 4 months ago

lgtm, lets ship it