Lines Matching +full:qemu +full:- +full:kvm

5 VM is migrated to a new QEMU instance on the same host.  It is
7 that run the VM, such as QEMU or even the host kernel. At this time,
8 the cpr-reboot and cpr-transfer modes are available.
10 Because QEMU is restarted on the same host, with access to the same
13 guest block devices between quitting old QEMU and starting new QEMU.
18 cpr-reboot mode
19 ---------------
21 In this mode, QEMU stops the VM, and writes VM state to the migration
22 URI, which will typically be a file. After quitting QEMU, the user
23 resumes by running QEMU with the ``-incoming`` option. Because the
24 old and new QEMU instances are not active concurrently, the URI cannot
32 software before restarting QEMU and resuming the VM. Further, if
34 then the user may reboot to a new host kernel before restarting QEMU.
38 ``guest-suspend-ram`` command to the QEMU guest agent. The agent
39 must be pre-installed in the guest, and the guest must support
48 memory, such as ``memory-backend-file,share=on``, and that the
49 ``x-ignore-shared`` capability be set. This combination allows memory
50 to be saved in place. Otherwise, after QEMU stops the VM, all guest
54 * Set the migration mode parameter to ``cpr-reboot``.
55 * Set the ``x-ignore-shared`` capability if desired.
60 * Quit when QEMU reaches the postmigrate state.
63 * Start QEMU with the ``-incoming defer`` option.
64 * Set the migration mode parameter to ``cpr-reboot``.
65 * Set the ``x-ignore-shared`` capability if desired.
66 * Issue the ``migrate-incoming`` command.
68 issued, then QEMU automatically resumes VM execution.
74 # qemu-kvm -monitor stdio
75 -object memory-backend-file,id=ram0,size=4G,mem-path=/dev/dax0.0,align=2M,share=on -m 4G
78 (qemu) info status
80 (qemu) migrate_set_parameter mode cpr-reboot
81 (qemu) migrate_set_capability x-ignore-shared on
82 (qemu) migrate -d file:vm.state
83 (qemu) info status
85 (qemu) quit
92 # qemu-kvm ... -incoming defer
93 (qemu) info status
95 (qemu) migrate_set_parameter mode cpr-reboot
96 (qemu) migrate_set_capability x-ignore-shared on
97 (qemu) migrate_incoming file:vm.state
98 (qemu) info status
105 # qemu-kvm -monitor stdio
106 -object memory-backend-file,id=ram0,size=4G,mem-path=/dev/dax0.0,align=2M,share=on -m 4G
107 -device vfio-pci, ...
108 -chardev socket,id=qga0,path=qga.sock,server=on,wait=off
109 -device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0
112 (qemu) info status
115 # echo '{"execute":"guest-suspend-ram"}' | ncat --send-only -U qga.sock
117 (qemu) info status
119 (qemu) migrate_set_parameter mode cpr-reboot
120 (qemu) migrate_set_capability x-ignore-shared on
121 (qemu) migrate -d file:vm.state
122 (qemu) info status
124 (qemu) quit
131 # qemu-kvm ... -incoming defer
132 (qemu) info status
134 (qemu) migrate_set_parameter mode cpr-reboot
135 (qemu) migrate_set_capability x-ignore-shared on
136 (qemu) migrate_incoming file:vm.state
137 (qemu) info status
139 (qemu) system_wakeup
140 (qemu) info status
146 cpr-reboot mode may not be used with postcopy, background-snapshot,
149 cpr-transfer mode
150 -----------------
152 This mode allows the user to transfer a guest to a new QEMU instance
154 RAM in place, albeit with new virtual addresses in new QEMU. Devices
157 The user starts new QEMU on the same host as old QEMU, with command-
158 line arguments to create the same machine, plus the ``-incoming``
160 In addition, the user adds a second -incoming option with channel
164 To initiate CPR, the user issues a migrate command to old QEMU,
166 argument. Old QEMU stops the VM, saves state to the migration
168 new QEMU.
170 New QEMU reads the CPR channel before opening a monitor, hence
172 migrate-incoming command. It may only be specified on the command
180 The VM must be started with the ``-machine aux-ram-share=on``
182 a memory-backend object) to be allocated by mmap'ing a memfd.
186 * Set the migration mode parameter to ``cpr-transfer``.
191 * Start new QEMU with two ``-incoming`` options.
193 issued, then QEMU automatically resumes VM execution.
198 cpr-transfer mode may not be used with postcopy, background-snapshot,
201 memory-backend-epc is not supported.
208 When using ``-incoming defer``, you must issue the migrate command to
209 old QEMU before issuing any monitor commands to new QEMU, because new
210 QEMU blocks waiting to read from the cpr channel before starting its
211 monitor, and old QEMU does not write to the channel until the migrate
212 command is issued. However, new QEMU does not open and read the
218 In these examples, we simply restart the same version of QEMU, but
219 in a real scenario one would start new QEMU on the incoming side.
220 Note that new QEMU does not print the monitor prompt until old QEMU
229 # qemu-kvm -qmp stdio
230 -object memory-backend-file,id=ram0,size=4G,
231 mem-path=/dev/shm/ram0,share=on -m 4G
232 -machine memory-backend=ram0
233 -machine aux-ram-share=on
235 # qemu-kvm -monitor stdio
236 -incoming tcp:0:44444
237 -incoming '{"channel-type": "cpr",
243 {"execute": "query-status"}
247 {"execute":"migrate-set-parameters",
248 "arguments":{"mode":"cpr-transfer"}}
251 {"channel-type": "main",
254 {"channel-type": "cpr",
258 QEMU 10.0.50 monitor
259 (qemu) info status
262 {"execute": "query-status"}
269 This example uses ``-incoming defer`` to hot plug a device before
271 migrate command to old QEMU before you can issue any monitor
272 commands to new QEMU.
279 # qemu-kvm -monitor stdio
280 -object memory-backend-file,id=ram0,size=4G,
281 mem-path=/dev/shm/ram0,share=on -m 4G
282 -machine memory-backend=ram0
283 -machine aux-ram-share=on
285 # qemu-kvm -monitor stdio
286 -incoming defer
287 -incoming '{"channel-type": "cpr",
294 "arguments": {"driver": "pcie-root-port"}}
296 {"execute":"migrate-set-parameters",
297 "arguments":{"mode":"cpr-transfer"}}
300 {"channel-type": "main",
303 {"channel-type": "cpr",
307 QEMU 10.0.50 monitor
308 (qemu) info status
310 (qemu) device_add pcie-root-port
311 (qemu) migrate_incoming tcp:0:44444
312 (qemu) info status
315 {"execute": "query-status"}
322 cpr-transfer mode is based on a capability to transfer open file
323 descriptors from old to new QEMU. In the future, descriptors for