[xen-tools] reimage-support with more than one controllable host

Anton Dollmaier antondollmaier at aditsystems.de
Wed Apr 4 12:38:13 CEST 2007


My name is Anton Dollmaier, I heard about the Xen-Tools at the
Chemnitzer Linux Tage 2007
(http://chemnitzer.linux-tage.de/2007/info/). After some testing, I
want to use the Xen-Tools in a "hosting"-environment.

To improve services, I wrote a Xen-Installer-perl-script, which lists
a configurable list (names, mirrors, deb/rpm, informations) of
distributions and lets the customer choose which one he wants to
install on his domU.

To minimize the administration, the installer is located in /usr/bin,
with only a small bash-skript in /home/$user/image.sh to enable the
reimage-command in the xen-shell:

  /usr/bin/xen-installer $*

Unfortunately, the reimage-command has a problem: A User can control
multiple xen-hosts, and also issue the reimage-command for a specific
host, but how can the installer determine, which host to reimage?

so I changed the /usr/bin/xm-reimage to pass the host to image.sh:

  #  Run the reimage script.
  /home/${user}/image.sh ${host}

the username is read out of $ENV{'USER'}.
After the latest aptitude upgrade, the changes were removed ... I
don't know if this change is the best place, but I couldn't find
another possibility (except passing via ENV, which also needs a
modification in the code).

To be able to use different settings for each host, there's currently
a settings.txt in each users home, but I want to change this to use a
SQL- or XML-connection to a central server to retrieve the allowed values
for disksizes, ips, netmasks, gateways etc.

I don't append the code from the xen-installer to this mail as it
needs code cleanup, security-checks and some feature extensions (let
the user choose of the available role-scripts, ask for confirmation,
...). If there's interest in the code / the script itself, I can later
publish it to the xen-tools.

Best regards from Germany,

Anton Dollmaier,
ADIT Systems

More information about the xen-tools-discuss mailing list