Notes - LXC Container
In the previous lab, we used a docker container with AppMgr to do application hosting on IOS-XR. Another option for container hosting is running an LXC (Linux container).
This is a bit more involved to setup, because the LXC needs to be created off-box. From a ubuntu machine:
In addition to the tarball, an LXC needs a spec file that is in XML. This file is called xr-lxc-app.xml
The two files are transferred over to the IOS-XR router in the /misc/app_host/scratch directory.
You then unpack the tar archive and use “virsh” to launch the container. (Note: From the book “Containers in IOS-XE/XR…”, while the /misc/app_host directory is accessible from the XRNNS, it is not advisable to run third-party apps here. Instead of using “run” we should use “bash” to enter the TPNNS.)
Because of the line <sharenet type='netns' value='global-vrf'/> in the XML file, the LXC shares the same namespace as the XR router. We can see that the interfaces are mapped directly to the LXC.
We can run iperf3 from here in -s mode listening on a unique port. The test is working:
Overall this method seems much less popular than using Docker, because with the AppMgr, we can manage the lifecycle of the container (starting it on bootup and restarting it on RSP failover). The LXC appears to need to be managed manually from the bash shell.
It seems that the AppMgr could theoretically manage LXCs as well as docker containers, but this does not appear to be an option.
Last updated