Changeset 741


Ignore:
Timestamp:
Jul 27, 2008, 11:35:58 PM (16 years ago)
Author:
ecprice
Message:

New guest-based autoinstaller

Location:
trunk/packages/sipb-xen-guest-installer
Files:
6 added
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-guest-installer/debian/control

    r719 r741  
    1 Source: sipb-xen-guest-installer
     1Source: sipb-xen-autoinstaller
    22Section: net
    33Priority: extra
     
    66Standards-Version: 3.7.2
    77
    8 Package: sipb-xen-guest-installer
     8Package: sipb-xen-autoinstaller-guest
    99Architecture: all
    10 Depends: ${misc:Depends}, patch, xen-tools, kpartx
    11 Description: SIPB Xen automatic guest-image installer system
     10Depends: ${misc:Depends}, patch, xen-tools, kpartx, lvm2
     11Description: SIPB Xen automatic guest-image installer system (guest)
    1212 This is our automatic guest-image installer system.
     13
     14Package: sipb-xen-autoinstaller-host
     15Architecture: all
     16Depends: ${misc:Depends}
     17Description: SIPB Xen automatic guest-image installer system (host)
     18 This is our automatic guest-image installer system.
  • trunk/packages/sipb-xen-guest-installer/debian/control.in

    r719 r741  
    1 Source: sipb-xen-guest-installer
     1Source: sipb-xen-autoinstaller
    22Section: net
    33Priority: extra
     
    66Standards-Version: 3.7.2
    77
    8 Package: sipb-xen-guest-installer
     8Package: sipb-xen-autoinstaller-guest
    99Architecture: all
    10 Depends: ${misc:Depends}, patch, xen-tools, kpartx
    11 Description: SIPB Xen automatic guest-image installer system
     10Depends: ${misc:Depends}, patch, xen-tools
     11Description: SIPB Xen automatic guest-image installer system (guest)
    1212 This is our automatic guest-image installer system.
     13
     14Package: sipb-xen-autoinstaller-host
     15Architecture: all
     16Depends: ${misc:Depends}
     17Description: SIPB Xen automatic guest-image installer system (host)
     18 This is our automatic guest-image installer system.
  • trunk/packages/sipb-xen-guest-installer/domU/usr/sbin/sipb-xen-install

    r641 r741  
    33TARGET=/dev/hda
    44
    5 #For some strange reason, . $TARGET doesn't work reliably.
     5# Read in the environment variables
     6# For some strange reason, . $TARGET doesn't work reliably.
    67eval `grep -a -m1 -B 100 ^return$ $TARGET | grep -v return`
    7 
    8 
    9 #HOSTNAME=foobar
    10 #DIST=etch
    11 #MIRROR=http://debian.lcs.mit.edu/debian
    12 #IMAGESIZE=3800
    138
    149ARCH=amd64
    1510
    16 #LVSIZE=`lvs --noheadings --units M --nosuffix -o Size /dev/xenvg/d_foobar_hda | sed 's/\..*//'`
     11echo ,${IMAGESIZE}$',L,*\n,,S\n;\n;' | sfdisk -uM -H 255 -S 63 $TARGET
    1712
    18 # If this script is interrupted, it may not clean up after itself.
    19 # In particular, it may leave ${VOLUME}1 mounted somewhere in tmp.
    20 # Unmount it, then kpartx -d $VOLUME to clean up.
    21 
    22 ###
    23 ###  Create the device for SIPB-Xen purposes
    24 ###
    25 echo ,${IMAGESIZE}$',L,*\n,,S\n;\n;' | sfdisk -uM -H 255 -S 63 $TARGET
    26 #kpartx -a $TARGET
    27 
    28 xen-create-image --image-dev ${TARGET}1 --swap-dev ${TARGET}2 --fs ext3 --ide --arch $ARCH --dist $DIST --hostname $HOSTNAME --mirror $MIRROR --dhcp --cache=yes
    29 
    30 #kpartx -d $TARGET
     13xen-create-image --image-dev ${TARGET}1 --swap-dev ${TARGET}2 --fs ext3 --ide --arch $ARCH --dist $DIST --hostname $HOSTNAME --mirror $MIRROR --ip=$IP --netmask=255.255.0.0 --gateway=18.181.0.1 --cache=yes
  • trunk/packages/sipb-xen-guest-installer/files/usr/sbin/sipb-xen-install

    r642 r741  
    1 #!/bin/sh
     1#!/bin/bash
    22
    3 export PATH #WTF?
     3export PATH
    44
    55HOSTNAME="$2"
     
    99IP="$6"
    1010
    11 ARCH=amd64
     11VOLUME=/dev/mapper/xenvg-d_${HOSTNAME}_hda
    1212
    13 #LVSIZE=`lvs --noheadings --units M --nosuffix -o Size /dev/xenvg/d_foobar_hda | sed 's/\..*//'`
     13cat > $VOLUME <<EOF
     14HOSTNAME=$HOSTNAME
     15DIST=$DIST
     16MIRROR=$MIRROR
     17IMAGESIZE=$IMAGESIZE
     18IP=$IP
     19return
     20EOF
    1421
    15 if [ -z "$IP" ]; then
    16     IP=`host $HOSTNAME.xvm.mit.edu | sed 's/.* //' | head -n 1`
    17 fi
    18 
    19 VOLUME=/dev/mapper/xenvg-d_$(echo "$HOSTNAME" | sed -e 's/-/--/g')_hda
    20 
    21 # If this script is interrupted, it may not clean up after itself.
    22 # In particular, it may leave ${VOLUME}1 mounted somewhere in tmp.
    23 # Unmount it, then kpartx -d $VOLUME to clean up.
    24 
    25 ###
    26 ###  Create the device for SIPB-Xen purposes
    27 ###
    28 echo ,${IMAGESIZE}$',L,*\n,,S\n;\n;' | sfdisk -uM -H 255 -S 63 $VOLUME
    29 kpartx -a $VOLUME
    30 
    31 # We use static IP addresses since dhcp doesn't work in paravm because
    32 # of a UDP checksum bug.
    33 
    34 xen-create-image --image-dev ${VOLUME}1 --swap-dev ${VOLUME}2 --fs ext3 --ide --arch $ARCH --dist $DIST --hostname $HOSTNAME --mirror $MIRROR --ip=$IP --netmask=255.255.0.0 --gateway=18.181.0.1 --template=/dev/null --cache
    35 
    36 # xen-create-image always creates a config file.  The
    37 # --template=/dev/null argument makes it empty, but it still should be
    38 # removed.
    39 rm -f /etc/xen/$HOSTNAME.cfg
    40 
    41 kpartx -d $VOLUME
     22xm create autoinstall.cfg target=$HOSTNAME guestip=$IP
Note: See TracChangeset for help on using the changeset viewer.