Operating System Images

Merge allows you to choose from a number of standard operating system images. The example below shows a 5 node experiment where each node has a different OS image.

Images are specified as constraints on a node when the node is defined.

from mergexp.machine import image
net.device(name, image == "debian:10")

The standard format for images is os-family:version. The versions used are numeric, and not the code name of the distribution. For example debian:10 instead of debian:buster and ubuntu:2004 instead of ubuntu:focal.

This is so you can use inequality constraints against images. For example

from mergexp.machine import image
net.device(name, image >= "ubuntu:1804")

Available Images

The images that are currently available on all Merge testbeds are the following

Image IdDistro Codename
debian:10Debian Buster
debian:11Debian Bullseye
ubuntu:1804Ubuntu Bionic
ubuntu:2004Ubuntu Focal

Complete Example

import mergexp as mx
from mergexp.machine import image
from mergexp.net import addressing, ipv4
def ubuntu(name, version):
dev = net.device(name, image == "ubuntu:"+version)
dev.props['group'] = version
return dev
def debian(name, version):
dev = net.device(name, image == "debian:"+version)
dev.props['group'] = version
return dev
net = mx.Topology('rainbow', addressing == ipv4)
nodes = [
ubuntu('a','1804'),
ubuntu('b','2004'),
debian('c', '10'),
debian('d', '11')
]
lan = net.connect(nodes)
mx.experiment(net)