hellt / vrnetlab

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

vSRX Doesn't have UUID #242

Closed bruenor80 closed 3 months ago

bruenor80 commented 3 months ago

It looks like the docker container created with vSRX isn't being given a UUID resulting in there not being a chassis serial number(which is used for many management platforms). I tested with two versions of vSRX and had the same result. A QEMU booted vSRX was fine. vJunosSwitch also didn't have a UUID but it must not use the UUID to generate the Serial number because they still had unique serial numbers. Is there any way to pass a UUID to the container?

Edit: This only seems to be the case for the BSD based JUNOS platforms - vJunosEVO was fine - uuid was listed under /etc/machine-id as expected.


vrnet srx


admin@hub-srx> start shell user root Password: root@hub-srx:/var/tmp # sysctl hw.re.uuid hw.re.uuid: root@hub-srx:/var/tmp # cli admin@hub-srx> show chassis hardware Hardware inventory: Item Version Part number Serial number Description Chassis VSRX Midplane System IO Routing Engine VSRX-2CPU-4G memory FPC 0 BUILTIN BUILTIN FPC PIC 0 VSRX DPDK GE Power Supply 0


Normal Qemu vSRX


showjcluser@vSRX-0> show chassis hardware Hardware inventory: Item Version Part number Serial number Description Chassis 6B623A4F9D7D VSRX Midplane REV 08 750-058562 423EC768 VSRX Pseudo CB 0
Routing Engine 0 BUILTIN BUILTIN VSRX-S FPC 0 REV 07 611-049549 RL3714040 FPC PIC 0 BUILTIN BUILTIN VSRX DPDK GE

jcluser@vSRX-0> start shell % sysctl hw.re.uuid hw.re.uuid: 423ec768-1c71-9dde-fd1c-6b623a4f9d7d


vrnet vJunos Switch


admin@vex2> start shell % sysctl hw.re.uuid hw.re.uuid:

bruenor80 commented 3 months ago

Looks like it was just missing the uuid gen in the launch.py file for the vsrx.

I added:

import uuid

# generate UUID to attach self.qemu_args.extend(["-uuid", str(uuid.uuid4())])

to vsrx/docker/launch.py and it fixed the issue for me.

hellt commented 3 months ago

Hi @bruenor80 do you want to raise a PR with this addition?

bruenor80 commented 3 months ago

Sure

hellt commented 3 months ago

fixed in #243