Prototype fast installer using a special guest.
authorGreg Price <price@mit.edu>
Tue, 13 Nov 2007 10:10:10 +0000 (05:10 -0500)
committerGreg Price <price@mit.edu>
Tue, 13 Nov 2007 10:10:10 +0000 (05:10 -0500)
Rather than poke directly in the boot sector, partition table,
etc, which caused so much pain last week (r231), we just dd
the entire disk.  Then we poke at the bits that need to change
(like secrets, the hostname, the root password, the filesystem uuids).
Since this poking is distribution-dependent, we want it to be
supplied by the image, so to make that safe we run it in a VM.

The plan is
 1. source image is dd'd (in the host) to the target image
 2. special copying-installer image is booted, with access to target
    and to a small image containing its arguments
 3. copying-installer guest reads arguments, mounts target,
    runs a script with a well-known name in target, passing arguments.

Bits I haven't done yet include
 - frob grub config in the copying-installer image so it boots
   with init = the copying-installer script (doing this manually for testing)
 - install script into copying-installer, or into my example image,
   in a sane automated way (they're checked into partial/ here)
 - all the tasks the image's script ought to actually carry out
 - make this all available from remctl and the web pages.

svn path=/trunk/packages/sipb-xen-database/sipb-xen-database/; revision=245

client/etc/xen/sipb-database

index 723eb78..fa75ebc 100644 (file)
@@ -72,7 +72,11 @@ if 'installer' in locals():
          + installer_options.split(' '))
     disk.append('file:'+tmptree+'/install.iso,hdc:cdrom,r')
     boot = 'd'
-    
+
+elif 'disks' in locals(): # for the copying installer's use
+    disk = disks.split(' ')
+    boot = 'c'
+
 elif 'cdrom_image' in locals():
     check(re.match('^[A-Za-z0-9][A-Za-z0-9_.-]*$', cdrom_image))
     disk.append('file:/srv/images/' + cdrom_image + '.iso,hdc:cdrom,r')