diff --git a/tsa/howto/ganeti.mdwn b/tsa/howto/ganeti.mdwn index 21a2f517dbc61fffc24d676ad3dab533f55d4f01..818f80a9d25cf034edbdf995eadb985d1d004ba7 100644 --- a/tsa/howto/ganeti.mdwn +++ b/tsa/howto/ganeti.mdwn @@ -218,7 +218,71 @@ hard-recover from a completely crashed node: Note that you might need the `--ignore-consistency` flag if the node is unresponsive. -## Importing external instances +## Importing external instances, semi-automatic + +Assumptions: + + * `INSTANCE`: name of the instance being migrated, the "old" one + being outside the cluster and the "new" one being the one created + inside the cluster (e.g. `chiwui.torproject.org`) + * `SPARE_NODE`: a ganeti node with free space + (e.g. `fsn-node-03.torproject.org`) where the `INSTANCE` will be + migrated + * `MASTER_NODE`: the master ganeti node + (e.g. `fsn-node-01.torproject.org`) + * `KVM_HOST`: the machine which we migrate the `INSTANCE` from + * the `INSTANCE` has only `root` and `swap` partitions + +Import procedure: + + 1. pick a viable SPARE NODE to import the INSTANCE (see "evaluating + cluster capacity" above, when in doubt) and find on which KVM HOST + the INSTANCE lives + + 2. copy the disks, without downtime: + + ./ganeti -v -H $INSTANCE libvirt-import --ganeti-node $SPARE_NODE --libvirt-host $KVM_HOST + + 3. copy the disks again, this time suspending the machine: + + ./ganeti -v -H $INSTANCE libvirt-import --ganeti-node $SPARE_NODE --libvirt-host $KVM_HOST --suspend --adopt + + 4. login the new machine through the ganeti console: + + gnt-instance console $INSTANCE + + 5. renumber the host: + + vi /etc/network/interfaces + service networking stop + service networking start + + 6. test services by changing your `/etc/hosts` + + 7. shutdown original instance: + + ssh $INSTANCE shutdown -h +1 'migrating to new server' + + 8. destroy test instance: + + gnt-instance remove $INSTANCE + + 9. redo migration as in step 3, 4 and 5 + + 10. final test procedure + + 11. switch to DRBD, still on the Ganeti MASTER NODE: + + gnt-instance stop $INSTANCE + gnt-instance modify -t drbd $INSTANCE + gnt-instance failover $INSTANCE + gnt-instance start $INSTANCE + + 12. switch DNS over to the new machine (see step 16 below) + + 13. retire old instance ([[retire-a-host]]) + +## Importing external instances, manual Assumptions: