From: David C. <da...@da...> - 2002-10-17 22:49:33
|
Hi, Due to peer pressure, I've decided to make a release of UMLd, even though it's no where near done yet. I've not yet audited it for security issues, nor have I tested every single feature (namely snapshots). Note that this is a "serious rush job", since I need to be up in 6hrs to be at the airport, so if it doesn't work, don't be surprised. This script expects /dev/net/tun to be r/w by whoever runs UMLs, and the TUN/TAP support is already loaded (modprobe tun, for example). I'll probably make another release of this after the weekend, which hopefully will be substantially cleaner. Run it at your own risk, etc, etc, if your system bursts into flames, it was your own fault. UMLd listens on the IP and port as defined in umld.conf, although if one sets the IP to 'auto', it will resolve the hostname and use that IP, so if your hostname responds to '127.0.0.1', then you won't be able to connect remotly. The standard UMLd port is 29402, although one can quite easily change this. So far, it allows you to: * System authentication and basic host stuff auth user david pass <password> hinfo hcpu hload luml suml lkern * Stop, start, reboot (shutdown + restart from scratch) UMLs. auth secret <whatever> or auth user <me> pass <whatever> uml <umid> down uml <umid> reboot uml <umid> up uml <umid> shutdown * Configure individual UML preferences. uml <umid> config set mem 256M uml <umid> config get cpus uml <umid> config set kern 2.4.19-13um * Start UMLs at boot time (e.g. when UMLd is started) If the 'onboot' field is set in the 'umls' table. * Automatically setup tap devices and bridges for networking The 'netifs' table stores the interface configuration, and 'netdef' contains the network defaults for a particular UML profile. * Build new UML systems automatically (Debian only). create <umid> <username> <profile> <optional distro> The 'profile' sets the default RAM + kernel and such like when it builds a system, as well as being used to pull the default network configuration from 'netdef'. It will pick the next available IP in the range, and allocate that to the UML. It will also pick out the appropriate hostname from the 'profiles' table. Once it builds homefs and swapfs, it COWs itself a root filesystem by using uml_mconsole on an existing UML, as per the 'admin_uml' configuration option. Note that this UML must be running on the same system as the UMLd process which is creating the new UML, and the UML named in 'admin_uml' must be running UMLd on port 29402. This will then edit the appropriate files (/etc/network/interfaces, /etc/hosts, /etc/hostname) and run a dist-upgrade on the box. I've also set it up to remove NIS from the image, as I accidently neglected to remove NIS from my original backing file - I do intend to make a 'do install' and 'do purge' list for Debian. * MOTD support newmotd blahblahblah . motd You only need to be 'readonly' to get the motd (can't do much else atm). * Live snapshots uml <umid> backup rootfs uml <umid> backup homefs Live backups ONLY works with UP UMLs - You have to 'down' a SMP UML before taking a backup. * It can be downloaded from: http://uml.openconsultancy.com/umld/umld-0.1.tar.gz This contains: umld.php - The actual daemon. This MUST be run as root. uml.php - Some supporting libraries umld.conf - The configuration file uml.sql - SQL schema + some sample data I execute it here with; $ sudo php umld.php ./umld.conf You will need a build of PHP which contains MySQL and process control support (--with-mysql && --enable-pcntl) It will check /etc/umld.conf, if you don't supply it with a file on the command line. The configuration file should be fairly obvious, except for the secrets section. These are 128bit MD5s, and each umld should have at least 'admin' and 'readonly'. If my umld was going to connect to the umld running on the UML 'dcoulson', I would require the 'admin' md5 from 'dcoulson's UML to be available in my umld.conf as 'uml_dcoulson'. TODO: Add support for auto-building RedHat 8.0 configurations Add inter-host connectivity Add global UML control (requires above) Clean up code & add comments Image/filesystem resizing System restores Automatic install and purge of packages Web interface Console interface Clean up protocol specification. Extra checking for files Check responses when building new UMLs. COW file caching, so that we don't have to do a whole 'dist-upgrade' every time. Questions/comments/etc to the address below. Abuse, flames and such like can be sent to Jeff - His e-mail address is on http://user-mode-linux.sf.net/ ;-) David -- David Coulson http://davidcoulson.net/ d...@vi... http://journal.davidcoulson.net/ |