Note this setup is for Sarge
1 - Setup a DTC control panel
This wont be detailed here. Note that you can do this inside one of the VMs of your Xen Server, that's no problem.
2 - Naming conventions
Your Xen Server dom0 MUST have a node number like nodeXXXX.your-domain.com, with XXXX being with 4 to 5 characters. At GPLHost, we use the phone number prefix for the first 2 or 3 characters, and then the last 2 increase. If you will have only one xen server, 00001 is fine. We will use 1212 in this example, and my-host.com as the domain name, so this will be: node1212.my-host.com, and 1.2.3.4 as the IP of the dom0 of your xen server.
3 - Preparing the dom0
Your dom0 MUST be able to find 1.2.3.4 when it tries to resolve node1212.my-host.com. Best is to setup /etc/hosts the following way:
1.2.3.4 node1212.my-host.com node1212
And check that /etc/hostname has node1212.
4 - Installing the replacement libc6, dtc-xen package and the rest
You might have noticed that when starting your server you saw a message asking you to move /lib/tls away. This is because you don't have a libc6 that is Xen aware. No problem, GPLHost has one ready for you. First, add one of the GPLHost repository to your dom0 in your /etc/apt/sources.list:
deb ftp://ftp.gplhost.com/debian stable main # US main ftp
deb ftp://ftp.gplhost.sg/debian stable main # Singapore mirror (for asian users)
deb ftp://ftp.gplhost.fr/debian stable main # Paris mirror (for european users)
Do a apt-get update, then apt-get upgrade to get the xen-aware libc6. Note that Etch has already a libc6 that work for Xen (it's called something like libc6-xen...), and that amd64 arch don't need the update.
Then it's time to:
apt-get install dtc-xen
Answer to it's questions. Best is to pickup a randomly generated password for the SOAP server and cut-past it to the debconf screen when it asks for a password (dtc can do it for you in many screen, like the email tab of the client interface). Make sure you keep this password somewhere, as it will be crypted and you will need to enter it in your DTC panel interface.
5 - Adding the Xen Server to the DTC panel, and provisionning some VPS
Now that the dtc-xen package is setup, you can connect the dtc panel to it. Go in the general config screen of dtc, click on the vps server tab, and enter the following in the feilds:
node1212.my-host.com / XXXXXXX / YYYYYYYYY
where XXXXXXX is the SOAP password you have just entered durring the setup, and YYYYYYYYY is just the location of the Xen server to show up when somebody will register (something like "foo data center in bar country" is fine). Note that if there is more than one server with the exact same location, the panel will show only one entry in the registration popup, which is rather nice.
6 - Provisionning some IPs, VMs and editing in the package manager
Next, you should click on "edit ip addresses" and add some VPS IPs to your xen servers. Add as much as you can, and they will be able to be taken by your customers when they register with DTC.
Then you should go in the Package manager and create some VPS package. Nothing special to say here, exept that you need to create some renewal package as well in order to enable recurring possibility.
7 - Preparing the server for hosting NetBSD and CentOS
You need to download all the packages necessary to setup a CentOS distrib. Do it this way:
cd /usr/src
mkdir centos3
rpmstrap --verbose --download-only centos3 /usr/src/centos3
Then for NetBSD, you only need to download the NetBSD normal and install kernel for xenU:
cd /boot
wget ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-daily/netbsd-4/200609170000Z/i386/binary/kernel/netbsd-XEN3_DOMU.gz
gzip -d netbsd-XEN3_DOMU.gz
mv netbsd-XEN3_DOMU netbsd-XENU
wget ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-daily/netbsd-4/200609170000Z/i386/binary/kernel/netbsd-INSTALL_XEN3_DOMU.gz
gzip -d netbsd-INSTALL_XEN3_DOMU.gz
mv netbsd-INSTALL_XEN3_DOMU netbsd-INSTALL_XENU
You can replace XEN3 by XEN2 depending on what you use. Also, the URL showed here are only examples, you might wont be able to find them as those are the daily archives (often rotated), but it should be pretty easy to find.
8 - Fixing python-soappy on debian Sarge + amd64 + Xen 3
When running this configuration, you will see that the dtc-xen SOAP server will generate an exeption when trying to dump a long. In fact this is not a bug in dtc-xen itself, but in python-soappy. To fix, you need to edit the following file line 51:
/usr/lib/python2.3/site-packages/SOAPpy/fpconst.py
Change the ll by ii, and it will work as normal. On a AMD64 system, 'l', which long, is 64-bits wide, that's why this fails. Using ii instead seems to fix the problem.
Note that the Debian maintainer of the python-soappy package is aware of the problem did a fix, but it was not uploaded to the Debian repostory yet... I wonder why, as to me this is a VERY important problem that is anoying.
In Etch - you can resolve the issue with:
ln -s /usr/lib/xen-default/lib/python/xen /usr/lib/python2.3/site-packages
ln -s /usr/lib/xen-default/lib/python/xen /usr/lib/python2.4/site-packages
ln -s /usr/lib/xen-default/lib/python/xen /usr/lib/python2.5/site-packages
9 - popularity-contest
If you want to help us and "vote" for dtc-xen in Debian, please apt-get install popcon to participate to the Debian package popularity contest.