Changeset 146 for trunk


Ignore:
Timestamp:
Oct 9, 2007, 2:27:21 AM (17 years ago)
Author:
tabbott
Message:

1) reworking of lvm stuff into a single python script rather than a pile of shell scripts

2) changing naming for database VMs to always start with d_

Location:
trunk/packages
Files:
1 added
2 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-database/sipb-xen-database/client/etc/xen/sipb-database

    r117 r146  
    55
    66connect('postgres://sipb-xen@sipb-xen-dev.mit.edu/sipb_xen')
     7prefix = "d_"
    78
    89# 'machine_name', and optionally 'cdrom_image', should get passed in
     
    2122maxmem = memory
    2223check(re.match('^[A-Za-z0-9][A-Za-z0-9._-]*$', machine.name))
    23 name = machine.name
     24name = prefix + machine.name
    2425check(re.match('^[0-9a-f-]+$', machine.uuid))
    2526uuid = machine.uuid
     
    5960for d in machine.disks:
    6061    check(re.match('^[A-Za-z0-9]+$', d.guest_device_name))
    61     device = '/dev/xenvg/' + machine.name + '_' + d.guest_device_name
     62    device = '/dev/xenvg/' + prefix + machine.name + '_' + d.guest_device_name
    6263    dspec = 'phy:%s,%s%s,w' % (device, diskioemu, d.guest_device_name)
    6364    disk.append(dspec)
  • trunk/packages/sipb-xen-remctl-auto/sipb-xen-remctl-auto/files/etc/remctl/conf.d/sipb-xen-web

    r132 r146  
    1 web lvcreate /usr/sbin/sipb-xen-lvcreate /etc/remctl/acl/web
    2 web lvremove /usr/sbin/sipb-xen-lvremove /etc/remctl/acl/web
    3 web lvrename /usr/sbin/sipb-xen-lvrename /etc/remctl/acl/web
     1web lvcreate /usr/sbin/sipb-xen-lvm /etc/remctl/acl/web
     2web lvremove /usr/sbin/sipb-xen-lvm /etc/remctl/acl/web
     3web lvrename /usr/sbin/sipb-xen-lvm /etc/remctl/acl/web
     4web lvresize /usr/sbin/sipb-xen-lvm /etc/remctl/acl/web
    45web vmboot /usr/sbin/sipb-xen-boot /etc/remctl/acl/web
    56web register /usr/sbin/remctl-update.sh /etc/remctl/acl/web
  • trunk/packages/sipb-xen-remctl-auto/sipb-xen-remctl-auto/files/usr/sbin/dispatch.sh

    r141 r146  
    1111
    1212ACTION=$(echo "$0" | awk -F'.' '{print $2}')
    13 MACHINE="$1"
     13ORIGMACHINE="$1"
     14MACHINE="d_$ORIGMACHINE"
    1415
    1516case "$ACTION" in
    1617    list|vcpu-list|destroy|create|uptime|shutdown)
    1718        xm "$ACTION" "$MACHINE"
    18         exit 0
    1919        ;;
    2020    reboot-with-cdrom)
    2121        xm shutdown "$MACHINE"
    22         xm create sipb-database machine_name="$MACHINE" cdrom_image="$2"
     22        xm create sipb-database machine_name="$ORIGMACHINE" cdrom_image="$2"
    2323        ;;
    2424    reboot)
    2525        if [ -n "$2" ]; then
    26             /usr/sbin/dispatch.reboot-with-cdrom.sh "$1" "$2" &
     26            /usr/sbin/dispatch.reboot-with-cdrom.sh "$ORIGMACHINE" "$2" &
    2727        else
    2828            xm reboot "$MACHINE"
  • trunk/packages/sipb-xen-remctl-auto/sipb-xen-remctl-auto/files/usr/sbin/remctl-update.sh

    r132 r146  
    4747}
    4848
     49check_machine_name()
     50{
     51    machine="$1"
     52    if ! perl -0e 'exit($ARGV[0] !~ /^[A-Za-z0-9][A-Za-z0-9._-]*$/)' -- "$machinename"; then
     53        echo "Bad machine name"
     54        exit 1
     55    fi
     56}
     57
    4958case "$1" in
    5059    moiragroup)
     
    7786    unregister)
    7887        machine="$2"
     88        check_machine_name "$machine"
    7989        rm -f "$ACLDIR"/"$machine"
    8090        rm -f "$MACHINEDIR"/"$machine"
     
    8494        oldmachine="$2"
    8595        newmachine="$3"
     96        check_machine_name "$oldmachine"
     97        check_machine_name "$newmachine"
    8698        mv "$ACLDIR"/"$oldmachine" "$ACLDIR"/"$newmachine"
    8799        rm -f "$MACHINEDIR"/"$oldmachine"
     
    90102    register)
    91103        machine="$2"
    92         if [ "$machine" == "Domain-0" ]; then
    93             echo "No, you can't control Domain 0"
    94             exit 1
    95         fi
    96         if [ -e /etc/xen/"$machine" ]; then
    97             echo "Machine already exists outside database"
    98             exit 1
    99         fi
     104        check_machine_name "$machine"
    100105        if [ -e "$ACLDIR"/"$machine" ]; then
    101106            echo "Machine already registered"
  • trunk/packages/sipb-xen-remctl-auto/sipb-xen-remctl-auto/files/usr/sbin/sipb-xen-listvms

    r122 r146  
    11#!/bin/sh
    22
    3 xm uptime
     3xm uptime | sed -n 's/^d_// p'
Note: See TracChangeset for help on using the changeset viewer.