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

45 Commits

Author SHA1 Message Date
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
Dietmar Maurer
1858638fe3 replace change_config_nolock with update_config_nolock
We now use cfs_file_write() in order to avoid race conditions between
file IO and cfs operations (read after write works now).
2012-02-02 14:18:41 +01:00
Dietmar Maurer
97439670bc online migration fix: close tunnel later, wait for connection close 2012-01-17 11:25:44 +01:00
Dietmar Maurer
17eed025b3 use PVE::Tools::run_with_timeout 2011-12-15 11:29:01 +01:00
Dietmar Maurer
d68afb26bf improve error message 2011-12-08 10:07:19 +01:00
Dietmar Maurer
72afda82a1 fix migration tunnel 2011-12-08 09:32:09 +01:00
Dietmar Maurer
46a84fd400 replace logmsg() with $self->log() 2011-12-07 11:25:20 +01:00
Dietmar Maurer
16e903f2dc use new AbstractMigrate.pm 2011-12-07 06:36:20 +01:00
Dietmar Maurer
4bb5a31707 cleanup error messages 2011-11-29 12:43:34 +01:00
Dietmar Maurer
ff1a2432c8 activate LVM LVs more carefully
And remove syslog whenever possible (we run most commands as tasks, so
the output is loged anyways)
2011-11-25 08:08:27 +01:00
Dietmar Maurer
e6c3b671bf fix online migration 2011-09-15 08:31:17 +02:00
Dietmar Maurer
3ea94c60d2 move code from qmigrate into PVE/QemuMigrate.pm
and make migrate a subcommand of qm
2011-09-14 13:33:34 +02:00