Skip to content. | Skip to navigation

Personal tools


You are here: Home / Wiki / Emulabimages


I made the multi-kernel image we talked about at the end of last week; it's tbres/dj-fc6-virt. It has support for the latest stable openvz and vservers, and also the latest trellis kernel that Sapan pointed me to. All kernels have the right patches, configuration, etc, to boot on all our boxes...

Vserver Instructions

Note: the util-vserver software installed (see `rpm -qa

grep vserver) is from planetlab svn; there don't seem to be significant differences between it and the latest public util-vserver release. Moreover, I believe the plab devs plan to push their changes into util-vserver cvs.

Just after boot, run

    $ sudo /etc/init.d/util-vserver start
    $ sudo /etc/init.d/vprocunhide start

All the large vserver stuff is stored on the disk in /vservers, and it'll rapidly exceed the 1.3GB disk remaining. So,

    $ sudo su -
    $ mke2fs -j /dev/sda4
    $ mount /dev/sda4 /vservers

    # extract the layout of dirs the vserver tools expect to see in /vservers
    $ cd /vservers
    $ tar -xjpf /proj/tbres/johnsond/v/pl/vservers/vservers-baselayout.tar.bz2

    # extract the planetlab "reference" vserver image
    $ cd /vservers/.vref/default
    $ tar -xjpf /proj/tbres/johnsond/v/pl/vservers/vref.tar.bz2

You can either use the plab reference image, or you can create your own. To build a fresh vserver using fc6 rpms, do

    $ vserver <name> build -m yum --hostname <hostname> \
        --interface <iface>:<ip>/<net> --pkgbase /vservers/.pkgbase -- -d fc6

You can also use the planetlab way of making a vserver:

    $ vuseradd <name> -t /vservers/.vref/default

To delete a vuseradd'd vserver, do

    $ vuserdel <name>

If you want to "bridge" one IP address in a VPS to an interface in the root context, use the root context's interface, but use a different IP address. If you want to share, I think you can just use the same IP address that is used in the root context. If you use the vuseradd method of creating vservers, this happens by default.

OpenVZ Instructions

Note: you'll want to do the same dance with /dev/sda4 and /vz that you did with /vservers to create more space for storing openvz VEs. Once you've done that,

    $ /etc/init.d/vz start
    $ cp /proj/tbres/johnsond/v/vz/templates/* /vz/template/cache

This starts openvz and copies my templates to the right place. One template is a default one from openvz; don't use it (it does not have yum installed). The other is a "minimalized" template I made.

So, ops on a VE:

    $ vzctl create <idnum> --ostemplate fedora-6-minimal
    $ vzctl set <idnum> --ipadd <ipaddr> --nameserver --save
    $ vzctl start <idnum>
    $ vzctl enter <idnum>
    $ vzctl stop <idnum>

Finally, if you want to use private IP addresses in your VEs and still allow them to talk to the outside world, setup NAT:

    $ sudo iptables -t nat -A POSTROUTING -s <private_ipaddr>/<netmask> -o <public_iface> -j SNAT --to <public_ipaddr>

-- Main.DavidJohnson - 22 Jan 2008