Some days ago I got old server hardware. It's a Xeon with 4 cores @ 2.40GHz with 8GB RAM an SSD and 2 HDDs in RAID1.
I installed Debian 10 Buster with Xen to run it as a Bare Metal Hypervisor, just like a real server. To install and deal with Xen - I never used it before, and I'm developer not administrator -, I found this article very helpful.
Creating a new VM
Once Debian and the Xen System is installed and you have booted Xen and logged into the Control Domain (Domain-0), using it is a "nobrainer", but first of all you may want switch to the root user (su - root). Creating a new VM is just one command line, like:
xen-create-image --hostname=buildserver --lvm=vg0 --dist=buster --size=8G --memory=2048M --maxmem=2048M --swap=2048M --pygrub --dhcp
So you just call xen-create-image with a hostname, storage size, how much memory it should get and what distribution (it doesn't have to be Debian, Xen supports many different distributions out of the box). This will create the volumes (disk and swap), download and install the distribution, and it will create the configuration file. Bellow you can see the volumes for my VMs:
To start the VM it is enough to call xl create <config-file>, to stop it xl destroy <name>.
Building for Debian
The servers build on Manjaro with Clang since some time now, but since the VMs are all Debian they must also build on/for Debian. For this I created a Debian VM with all required development tools and libraries, just to compile the servers for Debian.
The differences is, that with Manjaro you get bleeding edge software, while software on Debian often lag behind a bit.
I'm still not smart enough for CMake, so I created makefiles for GNU make which should be quite generic so they don't need much attention, e.g. there is no need to manually add or remove files. The goal is to just do a git pull && cd debian && make and it should compile the latest version.
There were some minor issues I had to fix, but now the servers build with Clang 8.0.0, Clang 7.0.1 and GCC 8.3.0 fine on Manjaro and Debian.
Running the new VMs
Running stuff for the first time is always exciting, but everything went fine, I just had to install some Libraries (DB client libraries on the data server etc.). Bellow you can see the running VMs:
The Data server inside it's own VM:
All other servers inside the abgame VM:
Connecting to the new Server
The first observation was that I got back my nice 50ms Ping (round trip time) 😀.
You may wonder why the round trip time is always at least 50ms. Earlier I mentioned the server runs 20 updates per seconds, this means it runs one update every 50ms. That's why the round trip time is at least 50ms.