unix:virtualization:virtlib:migrate
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
unix:virtualization:virtlib:migrate [2022/05/19 01:28] – created rodolico | unix:virtualization:virtlib:migrate [2022/05/22 21:22] (current) – rodolico | ||
---|---|---|---|
Line 62: | Line 62: | ||
I literally copied that block, did a //virsh edit// on each of my virtuals, found and deleted the existing < | I literally copied that block, did a //virsh edit// on each of my virtuals, found and deleted the existing < | ||
- | Now, if all my virtuals are set up to use a common set of cpu capabilities. | + | Now, all my virtuals are set up to use a common set of cpu capabilities. |
+ | |||
+ | ===== Get the correct version of netcat ===== | ||
+ | |||
+ | On my Devuan machine, installing //netcat// gives me something that is not compatible with what //virsh migrate// needs. You need the BSD version of netcat, which you can install with the command: | ||
+ | <code bash>apt -y install netcat-openbsd</ | ||
+ | |||
+ | Failing that, you will get an error about an incompatible netcat (nc) which does not have the -U flag. | ||
+ | |||
+ | ===== Set up root access between hypervisors ===== | ||
+ | |||
+ | I like to use ssh, and since I'm in a fairly secure environment, | ||
+ | |||
+ | On each machine, run the command <code bash> | ||
+ | |||
+ | Now, copy the contents of / | ||
+ | |||
+ | Test this by logging into each machine as root, then issue the following command for each of the other machines. This simply give a directory listing of /root/, which is all we need for a test. | ||
+ | <code bash>ssh hostname ' | ||
+ | If something breaks, fix this before you go further. | ||
+ | |||
+ | Finally, test the virsh connection between machines. Assuming virtlib running on both machines and ssh access, this should work: <code bash> | ||
+ | |||
+ | |||
+ | ===== Notes ===== | ||
+ | |||
+ | * Make sure you have the same bridges defined on all hypervisors, | ||
+ | * Make sure your paths are all the same on all hypervisors: | ||
+ | * There are several GUI and WebUI tools to do the migration, but the only one I've used (virt-manager) has some serious issues. | ||
+ | * It assumes you want to copy your block devices to the target, and fails when it tries to do it. However, I was able to shut down on one machine and start up on the second, once I had used --persistent one time to copy the config. | ||
+ | * I have some machines with the disks encrypted. The message to enter my passphrase doesn' | ||
+ | |||
+ | ===== Test the migration ===== | ||
+ | |||
+ | Ok, you know ssh works, and you have the correct version of cpu definition on all machines, and you have checked the configuration. Now it is time to test. On the source machine: | ||
+ | <code bash> | ||
+ | Replace // | ||
+ | |||
+ | * **--live** simply says "do this without shutting the virtual down | ||
+ | * **--persistent** copies the virtual' | ||
+ | * **--verbose** lets you see what is going on, which I like | ||
+ | * **qemu+ssh: | ||
+ | * **system** gives you access to the system on the target, allowing migrate to start the machine | ||
+ | |||
+ | There are a lot of additional things you can do with migrate. From the command prompt, <code bash>man virsh</ | ||
+ | |||
+ | ===== Links ===== | ||
+ | |||
+ | * https:// | ||
+ | * https:// |
unix/virtualization/virtlib/migrate.1652941711.txt.gz · Last modified: 2022/05/19 01:28 by rodolico