sketch out per-machine migration strategy
authorGreg Price <price@mit.edu>
Wed, 29 Oct 2008 06:24:59 +0000 (02:24 -0400)
committerGreg Price <price@mit.edu>
Wed, 29 Oct 2008 06:24:59 +0000 (02:24 -0400)
svn path=/trunk/scripts/; revision=1429

xvm-migrate-machine [new file with mode: 0644]

diff --git a/xvm-migrate-machine b/xvm-migrate-machine
new file mode 100644 (file)
index 0000000..d8c729e
--- /dev/null
@@ -0,0 +1,30 @@
+##!/bin/bash
+# Migrates the machine named $1 from the dev cluster.
+# To be run on the prod cluster.
+
+## The present version is NOT A REAL SCRIPT.
+## Things may not even be tested.  Copy and paste.
+
+## dump from dev db; save info well
+
+#echo "\\a \\t \\\\ select * from machines where name = '$MACHINE';" \
+# | psql -h xvm -U sipb-xen sipb_xen -q
+## 581|fsck|256|price|price|2ab6638f-3f65-2b32-3fd3-c16b74a9b7fe|linux|f|1|price|test|f
+## watch out for funny characters in description; better (non-)quoting needed
+## also disks, nics
+
+## remove from dev db; ideally atomic with dump
+
+## shut down if up
+#remctl remote control $MACHINE destroy
+
+## copy disk image... copy, copy...
+## for each disk:
+lvname="d_${MACHINE}_${guest_device_name}"
+lvcreate xenvg -n "$lvname" -L "${size}"M
+ssh t-i dd if=/dev/xenvg/"$lvname" of=/dev/stdout bs=1M \
+ | dd if=/dev/stdin of=/dev/xenvg/"$lvname" bs=1M
+
+## add to dev db
+
+## power on if desired