remctl support for renaming machines
authorTim Abbott <tabbott@mit.edu>
Mon, 8 Oct 2007 05:12:50 +0000 (01:12 -0400)
committerTim Abbott <tabbott@mit.edu>
Mon, 8 Oct 2007 05:12:50 +0000 (01:12 -0400)
svn path=/trunk/packages/sipb-xen-remctl-auto/sipb-xen-remctl-auto/; revision=132

files/etc/remctl/conf.d/sipb-xen-web
files/usr/sbin/remctl-update.sh
files/usr/sbin/sipb-xen-lvrename [new file with mode: 0755]

index b732ae6..8a984e4 100644 (file)
@@ -1,7 +1,9 @@
 web lvcreate /usr/sbin/sipb-xen-lvcreate /etc/remctl/acl/web
 web lvremove /usr/sbin/sipb-xen-lvremove /etc/remctl/acl/web
+web lvrename /usr/sbin/sipb-xen-lvrename /etc/remctl/acl/web
 web vmboot /usr/sbin/sipb-xen-boot /etc/remctl/acl/web
 web register /usr/sbin/remctl-update.sh /etc/remctl/acl/web
+web moveregister /usr/sbin/remctl-update.sh /etc/remctl/acl/web
 web unregister /usr/sbin/remctl-update.sh /etc/remctl/acl/web
 web remctl-moira-update /usr/sbin/remctl-update.sh /etc/remctl/acl/web
 web listvms /usr/sbin/sipb-xen-listvms /etc/remctl/acl/web
index 79c860a..7b205bf 100755 (executable)
@@ -80,6 +80,13 @@ case "$1" in
        rm -f "$MACHINEDIR"/"$machine"
        "$0" web
        ;;
+    moveregister)
+        oldmachine="$2"
+        newmachine="$3"
+        mv "$ACLDIR"/"$oldmachine" "$ACLDIR"/"$newmachine"
+        rm -f "$MACHINEDIR"/"$oldmachine"
+        "$0" web
+       ;;
     register)
        machine="$2"
        if [ "$machine" == "Domain-0" ]; then
diff --git a/files/usr/sbin/sipb-xen-lvrename b/files/usr/sbin/sipb-xen-lvrename
new file mode 100755 (executable)
index 0000000..8d46ee1
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+oldmachine="$2"
+newmachine="$3"
+disk="$4"
+
+if [ -e /etc/remctl/sipb-xen-auto/acl/"$oldmachine" ]; then
+       /sbin/lvrename xenvg "$oldmachine"_"$disk" "$newmachine"_"$disk"
+fi