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. Later in this howto, we will let you know how to setup the first domU by hand on the shell, using the dtc_reinstall_os script provided by DTC-Xen.
2 - Naming conventions
Your Xen Server dom0 MUST have a node name like nodeXXXX.your-domain.com, or alpha.example.com. In earlier versions of DTC-Xen, it was required to use numbering with nodeXXXX (with X being with 4 to 5 characters) and being the host names. This is not required anymore since version 0.5.x of DTC-Xen, and you can now use any naming scheme you like.
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, and hostname --fqdn returns node1212.my-host.com.
4 - Installing the dtc-xen package
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)
The full repository list is available from here.
After apt-get update, it's time to:
apt-get install dtc-xen
Answer to it's questions. The current package does not support weird character (ex: " ") in the password. 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 the general config -> VPS server screen). Make sure you keep this password somewhere, as it will be crypted and you will need to enter it in your DTC panel interface.
Then run the dtc-xen_finish_install and issue /etc/init.d/ssh restart (don't worry, the later will NOT disconnect you from ssh). If you don't understand why you need to do these 2, please read the README.Debian in the doc folder of dtc-xen.
After you have CAREFULLY read the /etc/dtc-xen/dtc-xen.conf and edited it according to your needs (especially, the MAC address prefix), restart DTC-Xen, otherwise Debian installs of your domU wont work:
/etc/init.d/dtc-xen restart
You can as well install the anti-DoS firewall script of DTC-Xen:
apt-get install dtc-xen-firewall
The configuration files for this script is in /etc/dtc-xen as well. Feel free to customize to your needs.
5 - Installing your first domU VM
Once DTC-Xen is setup, you can use the dtc_reinstall_os script to setup your first domU, where you might install the DTC web interface. Before you do it, you should create the disks of your VM:
dtc_setup_vps_disk 01 15000 512 lvm
This will create a 15G partition and a 512 MB swap.
Then you can install the operating system. There's a man page for it, so feel free to read it. I'll still give you an example (type it on one line):
dtc_reinstall_os -v -vpsid 01 -ram 512
-nic 192.168.2.176,255.255.255.0,192.168.2.255 -pass MyRootPass
-os debian-dtc -gw 192.168.2.1 -dns 192.168.2.1
This will setup a VM named xen01 with 512 MB of RAM, using 192.168.2.176 as IP address, 255.255.255.0 as netmask, 192.168.2.255 as broadcast address, 192.168.2.1 for the gateway, and the same IP for the DNS. At the first boot, you will see that it will install DTC for you.
Once the script has finished the installation of your VM, you can install DTC in it. To do this, follow the instructions here: Installing DTC in Debian
6 - Adding the Xen Server to the DTC panel, and provisionning some VPS
Now that the dtc-xen package is setup, and the DTC web interface is installed as well, you can connect them together. Go in the general config screen of dtc, click on the IP pool editor. Add your IP pools there. Then open the vps server tab, and enter the following in the feilds:
A.A.A.A / node12456.example.com / dtc-xen / 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. A.A.A.A is the IP of your dom0.
7 - 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.
Note that DTC will account all individual IPs you enter in it, so it will be impossible to use the same IP address in multiple places, which is a nice way to avoid IP conflicts.
8 - Preparing the server for setting-up other distributions
If DTC uses debootstrap and yum to setup respectively Debian and CentOS, you still need to use images for the setup of other distributions. In our repositories and it's mirror, you will find lot's of Debian package containing the images. Simply do a "apt-cache search dtc-xen-os" and you will find these packages. Note that for the case of NetBSD, the package only contains the 2 NetBSD5 kernels and nothing more, as it is enough to do the setup. You will also find some appliances if you do "apt-cache search dtc-xen-app". Install of of these packages if you like (currently, it takes about 1GB in your /usr to have them all in your dom0).
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.