User Tools

Site Tools


soft:omfdebiansliver

How to create an OMF enabled Debian sliver

This is a tutorial on how to create Debian sliver with OMF pre-installed. This sliver can therefore be used for the OMF integration in CONFINE.

Debian sliver

To be able to create an OMF enabled Debian sliver, the following tutorial Creating a Debian sliver template needs to be used.

OMF enabled sliver preseed file

Instead of using the preseed file presented at Creating a Debian sliver template, the following preseed file should be used to allow OMF to be installed on your sliver.

# # Debian preseed file for CONFINE (OMF enabled) sliver template
# Tested on lxc 0.9.0~alpha2 and live-debconfig 4.0~a16.

# ## Distribution and packages
lxc-debconfig lxc-debconfig/distribution string squeeze
lxc-debconfig lxc-debconfig/architecture string i386
lxc-debconfig lxc-debconfig/archives multiselect \
    squeeze-security, squeeze-updates, squeeze-backports
lxc-debconfig lxc-debconfig/mirror string \
    http://http.debian.net/debian/
lxc-debconfig lxc-debconfig/mirror-security string \
    http://security.debian.org/
lxc-debconfig lxc-debconfig/mirror-backports string \
    http://http.debian.net/debian-backports/
lxc-debconfig lxc-debconfig/archive-areas multiselect main
lxc-debconfig lxc-debconfig/packages string \
    iperf iptables iputils-ping less man-db openssl screen \
    traceroute tshark vim-tiny w3m wget \
    omf-common-5.4 omf-resctl-5.4 libocomm0 liboml2-0 oml2-otg2 oml2-iperf

# For configuring additional package sources.
##lxc-debconfig lxc-debconfig/archives0/repository string \
##    https://debian.example.com/  squeeze  main
##lxc-debconfig lxc-debconfig/archives0/list string local-my-repo
##lxc-debconfig lxc-debconfig/archives0/comment string \
##    My custom package repository
##lxc-debconfig lxc-debconfig/archives0/source boolean true
##lxc-debconfig lxc-debconfig/archives0/key string \
##    https://debian.example.com/keys/archive-key.asc

lxc-debconfig lxc-debconfig/archives0/repository string \
	http://pkg.mytestbed.net/ubuntu/ oneiric/
lxc-debconfig lxc-debconfig/archives0/list string omf-oneiric-repo
lxc-debconfig lxc-debconfig/archives0/comment string \
    The OMF repo (oneiric).
lxc-debconfig lxc-debconfig/archives0/source boolean false

lxc-debconfig lxc-debconfig/archives1/repository string \
        http://pkg.mytestbed.net/ubuntu/ precise/
lxc-debconfig lxc-debconfig/archives1/list string omf-precise-repo
lxc-debconfig lxc-debconfig/archives1/comment string \
    The OMF repo (precise).
lxc-debconfig lxc-debconfig/archives1/source boolean false

# ## Network
# Please adjust to the name of the bridge used in your host.
lxc-debconfig lxc-debconfig/eth0-bridge string vmbr
# Private MAC address, to be replaced on sliver creation.
lxc-debconfig lxc-debconfig/eth0-mac string 52:C0:CA:FE:BA:BE
# Private veth interface name, to be replaced on sliver creation.
lxc-debconfig lxc-debconfig/eth0-veth string veth-sliver

# ## Other container options
lxc-debconfig lxc-debconfig/auto boolean false
# Use live-debconfig to further configure the container.
lxc-debconfig lxc-debconfig/lxc-debconfig-with-live-debconfig boolean true
lxc-debconfig lxc-debconfig/apt-recommends boolean false
# Avoid debconf questions.
lxc-debconfig lxc-debconfig/debconf-frontend select noninteractive
## (default value)
##lxc-debconfig lxc-debconfig/debconf-priority string medium

# For running commands in the container and host at the end.
##lxc-debconfig lxc-debconfig/late-command string container-command args...
##lxc-debconfig lxc-debconfig/late-host-command string host-command args...

# Capabilities to be dropped from the container.
lxc-debconfig lxc-debconfig/capabilities string \
    audit_control audit_write ipc_lock mac_admin mac_override \
    sys_admin sys_boot sys_module sys_pacct sys_rawio sys_resource sys_time \
    syslog wake_alarm

# For mounting filesystems in container.
##lxc-debconfig lxc-debconfig/mount0/entry string \
##    /host/path/foo  /container/path/bar  none  bind  0  0
##lxc-debconfig lxc-debconfig/mount0/comment string \
##    Bind mount host path in container

# ## Live-debconfig scripts configuration

# (For some reason live-debconfig options must be on a single line
# or the following options are not interpreted correctly.)

# These are the only scripts needed to get a clean template.
live-debconfig live-debconfig/scripts multiselect sysvinit, util-linux
# To get a runnable container, use the following line instead.
##live-debconfig live-debconfig/scripts multiselect hostname, ifupdown, openssh-server, passwd, sysvinit, util-linux

# ### LXC (sysvinit)
# Perform LXC tweaks in the container.
live-debconfig live-debconfig/sysvinit/lxc-enable boolean true
## (default values)
##live-debconfig live-debconfig/sysvinit/lxc-consoles string 6
##live-debconfig live-debconfig/sysvinit/lxc-disable-services string checkroot.sh hwclockfirst.sh hwclock.sh kmod module-init-tools mountall.sh mountkernfs.sh umountfs umountroot

### Hardware clock access (util-linux)
live-debconfig live-debconfig/util-linux/hwclockaccess boolean false

# --------
# (The rest of options until the end of the file are only taken into account
# when creating a runnable container.)

# ### Host name (hostname)
# Host name, to be replaced on sliver creation.
live-debconfig live-debconfig/hostname/hostname string sliver

# ### Network configuration (ifupdown)
live-debconfig live-debconfig/ifupdown/lo-comment string The loopback interface
live-debconfig live-debconfig/ifupdown/lo-enable boolean true

# Private interface method, to be replaced on sliver creation.
live-debconfig live-debconfig/ifupdown/eth0-ipv4-comment string The private interface
live-debconfig live-debconfig/ifupdown/eth0-ipv4-method select dhcp

# For static configuration of network interfaces.
##live-debconfig live-debconfig/ifupdown/eth0-ipv4-method select static
##live-debconfig live-debconfig/ifupdown/eth0-ipv4-address string 1.2.3.4
##live-debconfig live-debconfig/ifupdown/eth0-ipv4-netmask string 255.255.255.0
##live-debconfig live-debconfig/ifupdown/eth0-ipv4-gateway string 1.2.3.1
##live-debconfig live-debconfig/ifupdown/eth0-ipv4-network string 1.2.3.0
##live-debconfig live-debconfig/ifupdown/eth0-ipv4-broadcast string 1.2.3.255
##live-debconfig live-debconfig/ifupdown/eth0-ipv4-mtu string 1500
##live-debconfig live-debconfig/ifupdown/eth0-ipv4-post-up string post-command

# For static configuration of DNS.
##live-debconfig live-debconfig/ifupdown/nameserver-addresses string 5.6.7.8 9.10.11.12
##live-debconfig live-debconfig/ifupdown/nameserver-domain string example.com
##live-debconfig live-debconfig/ifupdown/nameserver-search string lan example.com
##live-debconfig live-debconfig/ifupdown/nameserver-options string debug

# ### Users (passwd)
live-debconfig live-debconfig/passwd/shadow boolean true
live-debconfig live-debconfig/passwd/root-password string confine

As you can see several OMF and OML packages are added and two repositories are added.

NOTE: When creating this sliver, you probably get following message when the sliver is created:

WARNING: The following packages cannot be authenticated!
  libocomm0 liboml2-0 oml2-iperf omf-common-5.4 omf-resctl-5.4 oml2-otg2

You can fix this by adding –force-yes to the line where the packages are installed in the lxc-debconfig template file (/usr/share/lxc/templates/lxc-debconfig > line 335 in lxc version 0.9.0.alpha3), so replacing:

 Chroot "${_ROOTFS}" apt-get --option Dpkg::Options::="--force-overwrite" --option Dpkg::Options::="--force-confold" --yes install ${_PACKAGES}

with

 Chroot "${_ROOTFS}" apt-get --option Dpkg::Options::="--force-overwrite" --option Dpkg::Options::="--force-confold" --yes --force-yes install ${_PACKAGES}

Now, the OMF and OML packages should be installed correctly and you have an OMF enabled Debian sliver.

soft/omfdebiansliver.txt · Last modified: 2013/05/22 14:23 by gdaneels