| 35 | |
| 36 | == Strategies == |
| 37 | |
| 38 | There are two main strategies we can use for transfer, which are rather different from one another: |
| 39 | |
| 40 | === Data synchronization === |
| 41 | |
| 42 | In this approach, we'd set up `$kvmguest` initially with a new IP address, as a clean minimal install. |
| 43 | |
| 44 | * synchronize packages (at the same versions) by copying the dpkg selections from `$xenguest` |
| 45 | * synchronize user data via rsync |
| 46 | * synchronize system configuration (except networking, maybe?) |
| 47 | * halt public-facing services on `$xenguest` |
| 48 | * touch up synchronization with another rsync run |
| 49 | * dump databases on `$xenguest`, restore them on `$kvmguest` |
| 50 | * halt `$xenguest` |
| 51 | * modify networking on `$kvmguest` to match the old `$xenguest` networking config |
| 52 | * restart services on `$kvmguest` (or just restart `$kvmguest` entirely) |
| 53 | |
| 54 | ==== Data synchronization advantages ==== |
| 55 | |
| 56 | * `$kvmguest` will be fully 64-bit from the start |
| 57 | * `$kvmguest` will be configured/arranged pretty closely to how we have all the other guests |
| 58 | |
| 59 | === Block device mirroring === |
| 60 | |
| 61 | In this approach, we'd approximate a direct transfer of disks from `$xenhost` to `$kvmhost` and try to disturb `$guest` as little as possible. |
| 62 | |
| 63 | * get a list of block devices for `$xenguest`, and construct a parent LV on `$kvmhost` large enough to fit them all. |
| 64 | * Use `parted` to carve up the device to match the filesystems currently exported to `$xenguest` Use `kpartx` to expose them to `$kvmhost` directly |
| 65 | * on `$xenguest`: |
| 66 | * go ahead and install packages for a normal kernel and a bootloader (`linux-image-2.6-amd64` and `grub`, presumably); configure the bootloader to use the serial console. |
| 67 | * ensure that `/etc/fstab` (and other config) refer to filesystems by UUID where possible |
| 68 | * rsync the virtual devices from `$xenhost` to `$kvmhost` |
| 69 | * shutdown `$xenguest` |
| 70 | * touch up rsync |
| 71 | * on `$kvmhost`, extract kernel and initrd from the filesystem |
| 72 | * boot `$kvmguest` with kernel + initrd directly into single user mode (using `-kernel`, `-append`, and `-initrd` arguments to `kvm`) in order to: |
| 73 | {{{ |
| 74 | rm -f /boot/grub/device.map |
| 75 | grub-install /dev/vda |
| 76 | update-grub |
| 77 | }}} |
| 78 | * restart `$kvmguest` "normally" (from emulated BIOS) |
| 79 | |
| 80 | ==== Block device mirroring advantages ==== |
| 81 | |
| 82 | * guest seems to change relatively little -- main changes (installation of kernel + bootloader packages and reconfiguration of `/etc/fstab`) can be tested while still running on `$xenhost` |
| 83 | * user data goes through fewer transformations |
| 84 | * no finicky network config shuffling, only one host active at once. |