source: trunk/scripts/xvm-migrate-machine @ 1430

Last change on this file since 1430 was 1429, checked in by price, 16 years ago

sketch out per-machine migration strategy

File size: 931 bytes
RevLine 
[1429]1##!/bin/bash
2# Migrates the machine named $1 from the dev cluster.
3# To be run on the prod cluster.
4
5## The present version is NOT A REAL SCRIPT.
6## Things may not even be tested.  Copy and paste.
7
8## dump from dev db; save info well
9
10#echo "\\a \\t \\\\ select * from machines where name = '$MACHINE';" \
11# | psql -h xvm -U sipb-xen sipb_xen -q
12## 581|fsck|256|price|price|2ab6638f-3f65-2b32-3fd3-c16b74a9b7fe|linux|f|1|price|test|f
13## watch out for funny characters in description; better (non-)quoting needed
14## also disks, nics
15
16## remove from dev db; ideally atomic with dump
17
18## shut down if up
19#remctl remote control $MACHINE destroy
20
21## copy disk image... copy, copy...
22## for each disk:
23lvname="d_${MACHINE}_${guest_device_name}"
24lvcreate xenvg -n "$lvname" -L "${size}"M
25ssh t-i dd if=/dev/xenvg/"$lvname" of=/dev/stdout bs=1M \
26 | dd if=/dev/stdin of=/dev/xenvg/"$lvname" bs=1M
27
28## add to dev db
29
30## power on if desired
Note: See TracBrowser for help on using the repository browser.