Debian P2V : Différence entre versions
(→Prepare) |
(→Synchronise) |
||
Ligne 11: | Ligne 11: | ||
= Synchronise = | = Synchronise = | ||
− | + | To minimize downtime for the actual migration, one can synchronize the data beforehand: | |
− | {{ | + | {{Box Code|shell|2=<nowiki></nowiki> |
mount /dev/<path to disk image> /mnt | mount /dev/<path to disk image> /mnt | ||
rsync \ | rsync \ | ||
Ligne 29: | Ligne 29: | ||
umount /mnt}} | umount /mnt}} | ||
− | Note | + | |
+ | {{Box Note|This is to be refined and tested. To have an exact copy of the Physical Machine, we should use the ''--delete'' option if we synchronize multiple times; but that would also delete the files from our pre-seeded Xen Environment.<br> | ||
+ | As far as I can see, the only files we really need to keep are the kernel modules, but that needs to be confirmed. | ||
+ | }} | ||
= Migrate = | = Migrate = |
Version du 11 mars 2008 à 10:59
Debian Physical to Virtual -- Brain dump; this is very basic...
Prepare
Create the Debian Virtual Machine which will receive the Physical Machine data
Code: shell |
xen-create-image --hostname=... |
This is a bit an overkill as we do not really need to install an image in the Virtual Machine, but everything is setup nicely and we can test our configuration.
At this stage we use temporary IP addresses to avoid conflicts.
Synchronise
To minimize downtime for the actual migration, one can synchronize the data beforehand:
Code: shell |
mount /dev/<path to disk image> /mnt rsync \ --verbose \ --archive \ --numeric-ids \ --hard-links \ --exclude=/tmp \ --exclude=/proc \ --exclude=/dev \ --exclude=/sys \ --compress \ --rsh=ssh \ <physical machine>:/ \ /mnt/ umount /mnt |
Note: This is to be refined and tested. To have an exact copy of the Physical Machine, we should use the --delete option if we synchronize multiple times; but that would also delete the files from our pre-seeded Xen Environment.
As far as I can see, the only files we really need to keep are the kernel modules, but that needs to be confirmed.
Migrate
- Shutdown all services but ssh on the source server
- Synchronize (as above)
- Free / change IPs from the source server
- Mount / chroot to the disk image
- Install libc6-xen
- Cleanup fstab
- ...
- Unmount the image
- Start the VM
- Configure for pygrub