From: Tim Abbott Date: Mon, 8 Oct 2007 05:12:50 +0000 (-0400) Subject: remctl support for renaming machines X-Git-Tag: sipb-xen-remctl-auto/1.0.4~11 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-remote.git/commitdiff_plain/6c822b07513496b5a7243331733f6fe570d79fa8 remctl support for renaming machines svn path=/trunk/packages/sipb-xen-remctl-auto/sipb-xen-remctl-auto/; revision=132 --- diff --git a/files/etc/remctl/conf.d/sipb-xen-web b/files/etc/remctl/conf.d/sipb-xen-web index b732ae6..8a984e4 100644 --- a/files/etc/remctl/conf.d/sipb-xen-web +++ b/files/etc/remctl/conf.d/sipb-xen-web @@ -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 diff --git a/files/usr/sbin/remctl-update.sh b/files/usr/sbin/remctl-update.sh index 79c860a..7b205bf 100755 --- a/files/usr/sbin/remctl-update.sh +++ b/files/usr/sbin/remctl-update.sh @@ -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 index 0000000..8d46ee1 --- /dev/null +++ b/files/usr/sbin/sipb-xen-lvrename @@ -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