5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-02-02 09:47:13 +03:00

61 Commits

Author SHA1 Message Date
Fabian Grünbichler
8317c759bf Drop skiplock from write_config
Since write_config was always called with skiplock=1 except
once, it makes sense to drop this parameter like in
PVE::LXC::write_config . If needed in the future, the
caller can use check_lock before write_config anyway.
2016-02-12 12:16:57 +01:00
Fabian Grünbichler
63be43a947 Refactor update_config_nolock -> write_config
The method update_config wrapped update_config_nolock
using lock_config, but to prevent update races the whole
"read config", "do something", "write config" flow was
always protected by lock_config anyway, and update_config
was never called.

Thus, we can safely drop update_config and rename
update_config_nolock to write_config like in PVE::LXC .
2016-02-12 12:14:52 +01:00
Wolfgang Link
386c6ba7f5 close tunnel after migration is finish.
if we do not close it, there is a change that the tunnel stays open and the next migration will not work.
2016-02-02 18:16:18 +01:00
Alexandre Derumier
42dbd2ee30 add qemu_machine_pxe
return machinename with .pxe suffix if a nic with pxe romfile exist

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-11-06 10:51:14 +01:00
Alexandre Derumier
7bac824e19 use qom-get to check if pxe file are used V2
fix qemu 2.4 pxe -> qemu 2.4 efi

Changelog : forget to add a check on qom-get result

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-11-06 07:55:07 +01:00
Wolfgang Bumiller
407e0b8bef migration: improve ipv6 case
Qemu parses hostnames in brackets correctly but sets an ipv6
flag for them as if they were ipv6 addresses, only insert
brackets for ipv6 addresses.
2015-11-06 07:53:03 +01:00
Alexandre Derumier
289e0b8564 migrate : add nocheck for resume
Users have reported resume bug when HA is used.

They seem to have a little race (bench show >0s < 1s) between the vm conf file move on source node and replication to,
and resume on target node.

I don't known why this is only with HA, maybe this occur will standard migration too.

Anyway, we don't need to read the vm config file to resume the vm on target host,
as we are sure that the vm is migrated, and config file move action is correct in the cluster.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-10-15 12:41:13 +02:00
Wolfgang Bumiller
2fbd27eabc migration: put the source address in brackets
Always adding brackets around the address works. They're required for
ipv6 and qemu also accepts them for ipv4 and hostnames.
2015-05-21 17:30:30 +02:00
Wolfgang Bumiller
af0eba7e35 pass port family to next_*_port() calls 2015-05-12 12:28:56 +02:00
Wolfgang Link
adf8ac08c8 implement offline migration on zfs
Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2015-04-27 10:42:59 +02:00
Wolfgang Link
37a6dc7809 fix bug #618: correct typo
Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2015-04-27 10:42:49 +02:00
Alexandre Derumier
985a5f483d migration : add setup state
since qemu 1.5, they are a new migration state : "setup"

it's mainly use for rdma migration, but slow vm can it see and hang on migration

http://git.qemu.org/?p=qemu.git;a=commit;h=3b6959506831193f37cc830c8e111b437c0d1380

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-06-17 08:57:31 +02:00
Stefan Priebe
2e787b1892 QemuMigrate: print migration xbzrle if enabled (has xbzrlecachesize) for whatever reason (bug qemu, bug pve, ...)
Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
2014-02-10 12:29:17 +01:00
Alexandre Derumier
a89fded11f migration : enable auto-converge capability v2
This reduce guest cpu speed if dirtied bytes is 50% more than the approx.amount of bytes that just got transferred since the last time we were in this routine.

qemu commit :
http://git.qemu.org/?p=qemu.git;a=commit;h=bde1e2ec2176c363c1783bf8887b6b1beb08dfee

tested with "stress -m 2 -c 2" under debian

without autoconvergence : downtime 12s - duration 12min
with autoconvergence : downtime 2s - duration 4min

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-01-10 13:01:55 +01:00
Dietmar Maurer
dd25eecf62 code cleanup
Use new helper methods.
2013-12-10 10:46:50 +01:00
Alexandre Derumier
fd8469f7de qemu migrate : only wait for spice server online + eval
Currently offline migration fail ,because we are trying to check with qmp the spiceserver status.
This should be done online only.

I also add eval, to avoid migration lock if qmp query fail.

Fix :http://forum.proxmox.com/threads/16093-VM-is-locked-after-offline-migration?p=82852

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-09-19 06:28:17 +02:00
Dietmar Maurer
033a0b366d fix migration port (wrong quote) 2013-08-12 09:48:13 +02:00
Stefan Priebe
5bc1e0397e qemu-server: add support for unsecure migration (setting in datacenter.cfg)
This patch adds support for unsecure migration using a direct tcp connection
KVM <=> KVM instead of an extra SSH tunnel. Without ssh the limit is just the
bandwith and no longer the CPU / one single core.

You can enable this by adding:
migration_unsecure: 1
to datacenter.cfg

Examples using qemu 1.4 as migration with qemu 1.3 still does not work for me:

current default with SSH Tunnel VM uses 2GB mem:
Dec 27 21:10:32 starting migration of VM 105 to node 'cloud1-1202' (10.255.0.20)
Dec 27 21:10:32 copying disk images
Dec 27 21:10:32 starting VM 105 on remote node 'cloud1-1202'
Dec 27 21:10:35 starting ssh migration tunnel
Dec 27 21:10:36 starting online/live migration on localhost:60000
Dec 27 21:10:36 migrate_set_speed: 8589934592
Dec 27 21:10:36 migrate_set_downtime: 1
Dec 27 21:10:38 migration status: active (transferred 152481002, remaining 1938546688), total 2156396544) , expected downtime 0
Dec 27 21:10:40 migration status: active (transferred 279836995, remaining 1811140608), total 2156396544) , expected downtime 0
Dec 27 21:10:42 migration status: active (transferred 421265271, remaining 1669840896), total 2156396544) , expected downtime 0
Dec 27 21:10:44 migration status: active (transferred 570987974, remaining 1520152576), total 2156396544) , expected downtime 0
Dec 27 21:10:46 migration status: active (transferred 721469404, remaining 1369939968), total 2156396544) , expected downtime 0
Dec 27 21:10:48 migration status: active (transferred 875595258, remaining 1216057344), total 2156396544) , expected downtime 0
Dec 27 21:10:50 migration status: active (transferred 1034654822, remaining 1056931840), total 2156396544) , expected downtime 0
Dec 27 21:10:54 migration status: active (transferred 1176288424, remaining 915369984), total 2156396544) , expected downtime 0
Dec 27 21:10:56 migration status: active (transferred 1339734759, remaining 752050176), total 2156396544) , expected downtime 0
Dec 27 21:10:58 migration status: active (transferred 1503743261, remaining 588206080), total 2156396544) , expected downtime 0
Dec 27 21:11:02 migration status: active (transferred 1645097827, remaining 446906368), total 2156396544) , expected downtime 0
Dec 27 21:11:04 migration status: active (transferred 1810562934, remaining 281751552), total 2156396544) , expected downtime 0
Dec 27 21:11:06 migration status: active (transferred 1964377505, remaining 126033920), total 2156396544) , expected downtime 0
Dec 27 21:11:08 migration status: active (transferred 2077930417, remaining 0), total 2156396544) , expected downtime 0
Dec 27 21:11:09 migration speed: 62.06 MB/s - downtime 37 ms
Dec 27 21:11:09 migration status: completed
Dec 27 21:11:13 migration finished successfuly (duration 00:00:41)
TASK OK

with unsecure migration without SSH Tunnel:
Dec 27 22:43:14 starting migration of VM 105 to node 'cloud1-1203' (10.255.0.22)
Dec 27 22:43:14 copying disk images
Dec 27 22:43:14 starting VM 105 on remote node 'cloud1-1203'
Dec 27 22:43:17 starting online/live migration on 10.255.0.22:60000
Dec 27 22:43:17 migrate_set_speed: 8589934592
Dec 27 22:43:17 migrate_set_downtime: 1
Dec 27 22:43:19 migration speed: 1024.00 MB/s - downtime 1100 ms
Dec 27 22:43:19 migration status: completed
Dec 27 22:43:22 migration finished successfuly (duration 00:00:09)
TASK OK
2013-07-26 11:23:49 +02:00
Dietmar Maurer
7c14dcae1f use STDIN to pass spice ticket 2013-07-24 12:19:51 +02:00
Dietmar Maurer
86b8228b59 new vga_conf_has_spice() helper
code cleanups
2013-07-24 12:01:03 +02:00
Alexandre Derumier
95a4b4a98b add spice migration
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-07-24 10:54:20 +02:00
Dietmar Maurer
42668529e6 migrate: pass --machine parameter to remote 'qm start' command 2013-06-05 10:24:39 +02:00
Dietmar Maurer
f9a971e0ee fix bug #381: use PVE::Tools::next_migrate_port() 2013-05-13 07:30:50 +02:00
Dietmar Maurer
b7b1ac9d04 fix check if a backing file exist 2013-02-28 06:36:46 +01:00
Alexandre Derumier
d5f315fda5 migration : display qm resume error in task log
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-25 06:15:45 +01:00
Alexandre Derumier
d560409207 forbid offline migration of a non shared volume if it's a clone
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-15 07:52:53 +01:00
Dietmar Maurer
0302101cf1 remove expected_downtime from migration status 2013-02-13 10:47:54 +01:00
Stefan Priebe
19168b91ae QemuMigrate: phase2_cleanup misses migrate_cancel
Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
2013-01-02 06:36:53 +01:00
Stefan Priebe
865ef13278 implement dynamic migration_downtime
changelog:

- increment counter also if remaining memory equal 0 (qemu 1.4 migration code)
- only increment coutner and set down_time if memory transfert have occured. (to avoid too fast downtime increment)

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-12-31 07:20:56 +01:00
Alexandre Derumier
135007c099 add downtime && expected_downtime query-migrate info
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-12-27 12:45:56 +01:00
Alexandre Derumier
ab399b7c5d add error log for qm start of the target vm.
Can be usefull to see what's wrong if target vm doesn't start (missing storage, missing bridge,...)

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-12-27 12:44:34 +01:00
Alexandre Derumier
3beb415bd7 move qmp migrate_set_down && migrate_set_speed to qemumigrate
so we can set the values when the vm is running
also use int() to get json working

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-12-27 12:43:39 +01:00
Dietmar Maurer
d5769dc253 migrate volumes used inside snapshots including vmstate
Introduce new helper function foreach_volid()
2012-09-25 08:09:50 +02:00
Dietmar Maurer
a06c7f7ec4 fix check for non-shared disks 2012-09-25 07:26:34 +02:00
Dietmar Maurer
972511a06a migrate: disable xbzrle for now.
This is not stable, and sometimes cause endless migration (migration never stops).
2012-08-31 11:02:47 +02:00
Dietmar Maurer
94235c592c avoid warning about uninitialized value 2012-08-30 12:15:07 +02:00
Dietmar Maurer
b0b756c14d migrate: tolerate query-migrate errors 2012-08-30 09:28:24 +02:00
Alexandre Derumier
e18b0b9964 livemigrate : activate xbzrle cache
This help migrate for vm with of lot of memory access (like database)

live migration tests working:

kvm 1.2 -> kvm 1.2  (xbzrle set on both side)
kvm 1.1 -> kvm 1.2 (xbzrle on target)
kvm 1.1 -> kvm 1.1 (xbzrle not set, qmp command try to set xbzrle but fail)

failing migration

kvm 1.2 -> kvm 1.1 fail, but this is expected.

I tested with a memory benchmark running on the vm with 4GB ram

without xbzrle : migration take 10min, with many network hang
with xbzrle : migration take 1min, no hang

I display xbzrle counters for debug purpose, we can remove them later

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-29 07:55:21 +02:00
Dietmar Maurer
af30308f36 we call vm_stop to target host,
to be sure that kvm process is killed (but it should kill itself),
and deactivate volumes

I slightly modified this patch (orig. from Alexandre) so that it apply cleanly.
2012-08-23 10:28:41 +02:00
Alexandre Derumier
e52bd94c7e live migration: reduce sleep when remaining memory is low
Reduce sleep to 0.3s when remaining memory is lower than the average transfert in 1 iteration.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-23 07:37:59 +02:00
Dietmar Maurer
f5eb281ad3 cleanup: detete trailing whitespace 2012-08-23 07:36:48 +02:00
Alexandre Derumier
b67900f17a put target vm in singlestep mode and resume it only when config is moved
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-23 07:32:21 +02:00
Alexandre Derumier
7e8dcf2cb0 add migratedfrom param to start vm with conf file an another node
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-23 07:18:36 +02:00
Alexandre Derumier
c04b5b04de implement phase2_cleanup
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-23 07:17:15 +02:00
Alexandre Derumier
b8d208023b move config file in phase3, when live migration is finished
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-23 07:16:45 +02:00
Dietmar Maurer
373ea5798a migrate: only scan available storages 2012-07-16 10:20:36 +02:00
Dietmar Maurer
522c8f97d7 code cleanup, bump version to 2.0-44 2012-07-16 07:00:28 +02:00
Alexandre Derumier
80b2cbd1b9 migrate: syncdisk : avoid scanning shared storage
Currently we get list from PVE::Storage (for unused volumes), from all storage.
If something goes wrong with the network on host and thenwe can't communicate with a network shared storage(sheepdog,rbd,..),
the vdisk_list die (timeout) and we cannot migrate the vm on another kvm host.(online or offline).

We don't need to scan shared storage, as they are no disk to sync.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-07-16 06:52:35 +02:00
Dietmar Maurer
a05b47a8a8 migrate: fix warning about uninitialized values
And display acurate byte values instead of KB
2012-07-13 12:37:19 +02:00
Alexandre Derumier
5a7835f572 convert migrate monitor commands to qmp
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-06-26 06:38:34 +02:00