First-Generation Compute Infrastructure

From Funtoo
Jump to: navigation, search

This page documents the setup of our first-generation OpenVZ-based compute infrastructure.

Reference Hardware






Hardware Deployment and Initial Setup


Configuration overview:

  1. I typically allocate 1GB for the /boot filesystem


Kernel Setup Steps


chroot # epro mix-ins +openvz-host
chroot # emerge -av openvz-rhel6-stable


boot {
        generate grub
        timeout 3 

"Funtoo Linux genkernel" {
        kernel kernel[-v]
        initrd initramfs[-v]
        params += real_root=auto rootfstype=auto


Initial Ebuilds


chroot # emerge -av vzctl
chroot # rc-update add vz default

Similarly, we will use SheerDNS to update DNS entries. In Funtoo master DNS, there is an NS record pointing to each of our OpenVZ hosts. This allows container DNS entries to be managed locally by SheerDNS and containers to have domain names:

chroot # emerge -av sheerdns
chroot # rc-update add sheerdns default

Initial Network Configuration

Now, to configure the network. As described in our summary above, we are going to create two bridges -- one for outgoing Internet traffic, and one for internal traffic. In this example, we are going to assign a routeable and private IP address to each bridge, respectively. This will allow you to also directly reach the OpenVZ host via the Internet as well as via a private IP when connecting to the LAN. Note that containers will use veth networking, which is more flexible than OpenVZ's typical venet networking. However, it does allow containers to make full use of the network interface, so it's recommended that each interface is "locked own" to only be able to use the container's IP, for example. We will cover the iptables rules for this later. For now, let's just get the interfaces set up.


chroot # cd /etc/init.d
chroot # ln -s netif.tmpl net.brwan
chroot # ln -s netif.eth0 net.eth0
chroot # rc-update add net.brwan default

In /etc/conf.d/net.eth0, put the following:




Follow the same steps to set up net.brlan, except use eth1 as your physical link, and specify a non-routeable IPv4 address in /etc/conf.d/net.brlan, and do not specify a gateway at all. And of course, plug your physical eth1 interface into a private LAN switch.

Congratulations! You've now completed all the variant install steps that are needed prior to reboot. Continue setting up the server after completing the official install steps that were not covered above. Remember to set a root password, reboot, and then continue setup below.

Recommended Ebuilds


# emerge -av sys-apps/haveged
# rc-update add haveged default


# emerge -av app-admin/mcelog
# rc-update add mcelog default


# emerge -av sys-apps/smartmontools
# rc-update add smartd default


# Remember to put a valid email address, above ^^