1 # Move a VM from one cluster to another
3 * set `dnsTTL` to 30 in ldap for adayevskaya
4 * on the target create a new LV to accept the instance
6 lvcreate -n install-adayevskaya -L 5g vg_ganeti
8 * on the source, shut down the instance
10 gnt-instance shutdown adayevskaya.debian.orgĀ·
12 * give the source host ssh access to the target:
13 * `cat /etc/ssh/ssh_host_rsa_key.pub`
14 * `tee -a /etc/ssh/userkeys/root`
15 * `iptables -I INPUT -s bm-bl1 -j ACCEPT`
16 * `ip6tables -I INPUT -s bm-bl1 -j ACCEPT`
19 cat /dev/mapper/adayevskaya | ssh root@manda-node03 'cat > /dev/vg_ganeti/install-adayevskaya'
20 # pidof cat, and cat /proc/<pid>/fdinfo/[01] to check on progress
22 * clean up ssh and the firewall again:
25 ferm -i /etc/ferm/ferm.conf
27 * resize partitions if the new block device is larger using `fdisk`. Delete and create the partition at the same starting position.
28 * open the partition table:
30 kpartx -a -v -p -part /dev/vg_ganeti/install-adayevskaya
32 * fsck the filesystem if required, resize if necessary
34 fsck.ext4 /dev/mapper/vg_ganeti-install--adayevskaya-part1
35 resize2fs /dev/mapper/vg_ganeti-install--adayevskaya-part1
37 * mount the partition and fix etc/network/interfaces:
39 mkdir /mnt/target-adayevskaya
40 mount /dev/mapper/vg_ganeti-install--adayevskaya-part1 /mnt/target-adayevskaya
41 cd /mnt/target-adayevskaya
42 vi etc/hosts etc/network/interfaces
44 umount /mnt/target-adayevskaya
45 rmdir /mnt/target-adayevskaya
49 kpartx -d -v -p -part /dev/vg_ganeti/install-adayevskaya
51 * create the instance, adopting the block device
59 --disk=0:adopt=install-adayevskaya \
60 --backend-parameters memory=2g,vcpus=2 \
63 adayevskaya.debian.org
66 --disk-template drbd \
67 -n manda-node04.debian.org \
68 adayevskaya.debian.org
70 * start the instance, check everything works
72 gnt-instance start adayevskaya.debian.org
73 gnt-instance console adayevskaya.debian.org
75 * update ud-ldap (ip addresses, physicalHost, sponsor, location, dnsTTL) and ud-generate
76 * ud-replicate on denis
77 * check puppet and ssh authkeys on all hosts for the old IP address
79 * update dsa-passwords
81 * zero volumes on the old cluster
82 * remove the instance on the old cluster
83 * remove volumes from puppet/multipath/storage arrays and our google docs LUN map