2 # Migration test scenario parameter description
4 # Copyright (c) 2016 Red Hat, Inc.
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License, or (at your option) any later version.
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, see <http://www.gnu.org/licenses/>.
21 class Scenario(object):
23 def __init__(self
, name
,
25 bandwidth
=125000, # 1000 gig-e, effectively unlimited
28 pause
=False, pause_iters
=5,
29 post_copy
=False, post_copy_iters
=5,
30 auto_converge
=False, auto_converge_step
=10,
31 compression_mt
=False, compression_mt_threads
=1,
32 compression_xbzrle
=False, compression_xbzrle_cache
=10,
33 multifd
=False, multifd_channels
=2,
34 dirty_limit
=False, x_vcpu_dirty_limit_period
=500,
39 # General migration tunables
40 self
._downtime
= downtime
# milliseconds
41 self
._bandwidth
= bandwidth
# MiB per second
42 self
._max
_iters
= max_iters
43 self
._max
_time
= max_time
# seconds
46 # Strategies for ensuring completion
48 self
._pause
_iters
= pause_iters
50 self
._post
_copy
= post_copy
51 self
._post
_copy
_iters
= post_copy_iters
53 self
._auto
_converge
= auto_converge
54 self
._auto
_converge
_step
= auto_converge_step
# percentage CPU time
56 self
._compression
_mt
= compression_mt
57 self
._compression
_mt
_threads
= compression_mt_threads
59 self
._compression
_xbzrle
= compression_xbzrle
60 self
._compression
_xbzrle
_cache
= compression_xbzrle_cache
# percentage of guest RAM
62 self
._multifd
= multifd
63 self
._multifd
_channels
= multifd_channels
65 self
._dirty
_limit
= dirty_limit
66 self
._x
_vcpu
_dirty
_limit
_period
= x_vcpu_dirty_limit_period
67 self
._vcpu
_dirty
_limit
= vcpu_dirty_limit
72 "downtime": self
._downtime
,
73 "bandwidth": self
._bandwidth
,
74 "max_iters": self
._max
_iters
,
75 "max_time": self
._max
_time
,
77 "pause_iters": self
._pause
_iters
,
78 "post_copy": self
._post
_copy
,
79 "post_copy_iters": self
._post
_copy
_iters
,
80 "auto_converge": self
._auto
_converge
,
81 "auto_converge_step": self
._auto
_converge
_step
,
82 "compression_mt": self
._compression
_mt
,
83 "compression_mt_threads": self
._compression
_mt
_threads
,
84 "compression_xbzrle": self
._compression
_xbzrle
,
85 "compression_xbzrle_cache": self
._compression
_xbzrle
_cache
,
86 "multifd": self
._multifd
,
87 "multifd_channels": self
._multifd
_channels
,
88 "dirty_limit": self
._dirty
_limit
,
89 "x_vcpu_dirty_limit_period": self
._x
_vcpu
_dirty
_limit
_period
,
90 "vcpu_dirty_limit": self
._vcpu
_dirty
_limit
,
94 def deserialize(cls
, data
):
104 data
["post_copy_iters"],
105 data
["auto_converge"],
106 data
["auto_converge_step"],
107 data
["compression_mt"],
108 data
["compression_mt_threads"],
109 data
["compression_xbzrle"],
110 data
["compression_xbzrle_cache"],
112 data
["multifd_channels"])