xref: /openbmc/qemu/qapi/migration.json (revision a89f364a)
1# -*- Mode: Python -*-
2#
3
4##
5# = Migration
6##
7
8{ 'include': 'common.json' }
9
10##
11# @MigrationStats:
12#
13# Detailed migration status.
14#
15# @transferred: amount of bytes already transferred to the target VM
16#
17# @remaining: amount of bytes remaining to be transferred to the target VM
18#
19# @total: total amount of bytes involved in the migration process
20#
21# @duplicate: number of duplicate (zero) pages (since 1.2)
22#
23# @skipped: number of skipped zero pages (since 1.5)
24#
25# @normal: number of normal pages (since 1.2)
26#
27# @normal-bytes: number of normal bytes sent (since 1.2)
28#
29# @dirty-pages-rate: number of pages dirtied by second by the
30#        guest (since 1.3)
31#
32# @mbps: throughput in megabits/sec. (since 1.6)
33#
34# @dirty-sync-count: number of times that dirty ram was synchronized (since 2.1)
35#
36# @postcopy-requests: The number of page requests received from the destination
37#        (since 2.7)
38#
39# @page-size: The number of bytes per page for the various page-based
40#        statistics (since 2.10)
41#
42# Since: 0.14.0
43##
44{ 'struct': 'MigrationStats',
45  'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
46           'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
47           'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
48           'mbps' : 'number', 'dirty-sync-count' : 'int',
49           'postcopy-requests' : 'int', 'page-size' : 'int' } }
50
51##
52# @XBZRLECacheStats:
53#
54# Detailed XBZRLE migration cache statistics
55#
56# @cache-size: XBZRLE cache size
57#
58# @bytes: amount of bytes already transferred to the target VM
59#
60# @pages: amount of pages transferred to the target VM
61#
62# @cache-miss: number of cache miss
63#
64# @cache-miss-rate: rate of cache miss (since 2.1)
65#
66# @overflow: number of overflows
67#
68# Since: 1.2
69##
70{ 'struct': 'XBZRLECacheStats',
71  'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
72           'cache-miss': 'int', 'cache-miss-rate': 'number',
73           'overflow': 'int' } }
74
75##
76# @MigrationStatus:
77#
78# An enumeration of migration status.
79#
80# @none: no migration has ever happened.
81#
82# @setup: migration process has been initiated.
83#
84# @cancelling: in the process of cancelling migration.
85#
86# @cancelled: cancelling migration is finished.
87#
88# @active: in the process of doing migration.
89#
90# @postcopy-active: like active, but now in postcopy mode. (since 2.5)
91#
92# @completed: migration is finished.
93#
94# @failed: some error occurred during migration process.
95#
96# @colo: VM is in the process of fault tolerance, VM can not get into this
97#        state unless colo capability is enabled for migration. (since 2.8)
98#
99# @pre-switchover: Paused before device serialisation. (since 2.11)
100#
101# @device: During device serialisation when pause-before-switchover is enabled
102#        (since 2.11)
103#
104# Since: 2.3
105#
106##
107{ 'enum': 'MigrationStatus',
108  'data': [ 'none', 'setup', 'cancelling', 'cancelled',
109            'active', 'postcopy-active', 'completed', 'failed', 'colo',
110            'pre-switchover', 'device' ] }
111
112##
113# @MigrationInfo:
114#
115# Information about current migration process.
116#
117# @status: @MigrationStatus describing the current migration status.
118#          If this field is not returned, no migration process
119#          has been initiated
120#
121# @ram: @MigrationStats containing detailed migration
122#       status, only returned if status is 'active' or
123#       'completed'(since 1.2)
124#
125# @disk: @MigrationStats containing detailed disk migration
126#        status, only returned if status is 'active' and it is a block
127#        migration
128#
129# @xbzrle-cache: @XBZRLECacheStats containing detailed XBZRLE
130#                migration statistics, only returned if XBZRLE feature is on and
131#                status is 'active' or 'completed' (since 1.2)
132#
133# @total-time: total amount of milliseconds since migration started.
134#        If migration has ended, it returns the total migration
135#        time. (since 1.2)
136#
137# @downtime: only present when migration finishes correctly
138#        total downtime in milliseconds for the guest.
139#        (since 1.3)
140#
141# @expected-downtime: only present while migration is active
142#        expected downtime in milliseconds for the guest in last walk
143#        of the dirty bitmap. (since 1.3)
144#
145# @setup-time: amount of setup time in milliseconds _before_ the
146#        iterations begin but _after_ the QMP command is issued. This is designed
147#        to provide an accounting of any activities (such as RDMA pinning) which
148#        may be expensive, but do not actually occur during the iterative
149#        migration rounds themselves. (since 1.6)
150#
151# @cpu-throttle-percentage: percentage of time guest cpus are being
152#        throttled during auto-converge. This is only present when auto-converge
153#        has started throttling guest cpus. (Since 2.7)
154#
155# @error-desc: the human readable error description string, when
156#              @status is 'failed'. Clients should not attempt to parse the
157#              error strings. (Since 2.7)
158#
159# @postcopy-blocktime: total time when all vCPU were blocked during postcopy
160#           live migration (Since 2.12)
161#
162# @postcopy-vcpu-blocktime: list of the postcopy blocktime per vCPU (Since 2.12)
163#
164
165#
166# Since: 0.14.0
167##
168{ 'struct': 'MigrationInfo',
169  'data': {'*status': 'MigrationStatus', '*ram': 'MigrationStats',
170           '*disk': 'MigrationStats',
171           '*xbzrle-cache': 'XBZRLECacheStats',
172           '*total-time': 'int',
173           '*expected-downtime': 'int',
174           '*downtime': 'int',
175           '*setup-time': 'int',
176           '*cpu-throttle-percentage': 'int',
177           '*error-desc': 'str',
178           '*postcopy-blocktime' : 'int64',
179           '*postcopy-vcpu-blocktime': ['int64']} }
180
181##
182# @query-migrate:
183#
184# Returns information about current migration process. If migration
185# is active there will be another json-object with RAM migration
186# status and if block migration is active another one with block
187# migration status.
188#
189# Returns: @MigrationInfo
190#
191# Since: 0.14.0
192#
193# Example:
194#
195# 1. Before the first migration
196#
197# -> { "execute": "query-migrate" }
198# <- { "return": {} }
199#
200# 2. Migration is done and has succeeded
201#
202# -> { "execute": "query-migrate" }
203# <- { "return": {
204#         "status": "completed",
205#         "ram":{
206#           "transferred":123,
207#           "remaining":123,
208#           "total":246,
209#           "total-time":12345,
210#           "setup-time":12345,
211#           "downtime":12345,
212#           "duplicate":123,
213#           "normal":123,
214#           "normal-bytes":123456,
215#           "dirty-sync-count":15
216#         }
217#      }
218#    }
219#
220# 3. Migration is done and has failed
221#
222# -> { "execute": "query-migrate" }
223# <- { "return": { "status": "failed" } }
224#
225# 4. Migration is being performed and is not a block migration:
226#
227# -> { "execute": "query-migrate" }
228# <- {
229#       "return":{
230#          "status":"active",
231#          "ram":{
232#             "transferred":123,
233#             "remaining":123,
234#             "total":246,
235#             "total-time":12345,
236#             "setup-time":12345,
237#             "expected-downtime":12345,
238#             "duplicate":123,
239#             "normal":123,
240#             "normal-bytes":123456,
241#             "dirty-sync-count":15
242#          }
243#       }
244#    }
245#
246# 5. Migration is being performed and is a block migration:
247#
248# -> { "execute": "query-migrate" }
249# <- {
250#       "return":{
251#          "status":"active",
252#          "ram":{
253#             "total":1057024,
254#             "remaining":1053304,
255#             "transferred":3720,
256#             "total-time":12345,
257#             "setup-time":12345,
258#             "expected-downtime":12345,
259#             "duplicate":123,
260#             "normal":123,
261#             "normal-bytes":123456,
262#             "dirty-sync-count":15
263#          },
264#          "disk":{
265#             "total":20971520,
266#             "remaining":20880384,
267#             "transferred":91136
268#          }
269#       }
270#    }
271#
272# 6. Migration is being performed and XBZRLE is active:
273#
274# -> { "execute": "query-migrate" }
275# <- {
276#       "return":{
277#          "status":"active",
278#          "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
279#          "ram":{
280#             "total":1057024,
281#             "remaining":1053304,
282#             "transferred":3720,
283#             "total-time":12345,
284#             "setup-time":12345,
285#             "expected-downtime":12345,
286#             "duplicate":10,
287#             "normal":3333,
288#             "normal-bytes":3412992,
289#             "dirty-sync-count":15
290#          },
291#          "xbzrle-cache":{
292#             "cache-size":67108864,
293#             "bytes":20971520,
294#             "pages":2444343,
295#             "cache-miss":2244,
296#             "cache-miss-rate":0.123,
297#             "overflow":34434
298#          }
299#       }
300#    }
301#
302##
303{ 'command': 'query-migrate', 'returns': 'MigrationInfo' }
304
305##
306# @MigrationCapability:
307#
308# Migration capabilities enumeration
309#
310# @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
311#          This feature allows us to minimize migration traffic for certain work
312#          loads, by sending compressed difference of the pages
313#
314# @rdma-pin-all: Controls whether or not the entire VM memory footprint is
315#          mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
316#          Disabled by default. (since 2.0)
317#
318# @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
319#          essentially saves 1MB of zeroes per block on the wire. Enabling requires
320#          source and target VM to support this feature. To enable it is sufficient
321#          to enable the capability on the source VM. The feature is disabled by
322#          default. (since 1.6)
323#
324# @compress: Use multiple compression threads to accelerate live migration.
325#          This feature can help to reduce the migration traffic, by sending
326#          compressed pages. Please note that if compress and xbzrle are both
327#          on, compress only takes effect in the ram bulk stage, after that,
328#          it will be disabled and only xbzrle takes effect, this can help to
329#          minimize migration traffic. The feature is disabled by default.
330#          (since 2.4 )
331#
332# @events: generate events for each migration state change
333#          (since 2.4 )
334#
335# @auto-converge: If enabled, QEMU will automatically throttle down the guest
336#          to speed up convergence of RAM migration. (since 1.6)
337#
338# @postcopy-ram: Start executing on the migration target before all of RAM has
339#          been migrated, pulling the remaining pages along as needed. NOTE: If
340#          the migration fails during postcopy the VM will fail.  (since 2.6)
341#
342# @x-colo: If enabled, migration will never end, and the state of the VM on the
343#        primary side will be migrated continuously to the VM on secondary
344#        side, this process is called COarse-Grain LOck Stepping (COLO) for
345#        Non-stop Service. (since 2.8)
346#
347# @release-ram: if enabled, qemu will free the migrated ram pages on the source
348#        during postcopy-ram migration. (since 2.9)
349#
350# @block: If enabled, QEMU will also migrate the contents of all block
351#          devices.  Default is disabled.  A possible alternative uses
352#          mirror jobs to a builtin NBD server on the destination, which
353#          offers more flexibility.
354#          (Since 2.10)
355#
356# @return-path: If enabled, migration will use the return path even
357#               for precopy. (since 2.10)
358#
359# @pause-before-switchover: Pause outgoing migration before serialising device
360#          state and before disabling block IO (since 2.11)
361#
362# @x-multifd: Use more than one fd for migration (since 2.11)
363#
364# @postcopy-blocktime: Calculate downtime for postcopy live migration
365#                     (since 2.12)
366#
367# Since: 1.2
368##
369{ 'enum': 'MigrationCapability',
370  'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
371           'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram',
372           'block', 'return-path', 'pause-before-switchover', 'x-multifd',
373           'postcopy-blocktime' ] }
374
375##
376# @MigrationCapabilityStatus:
377#
378# Migration capability information
379#
380# @capability: capability enum
381#
382# @state: capability state bool
383#
384# Since: 1.2
385##
386{ 'struct': 'MigrationCapabilityStatus',
387  'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
388
389##
390# @migrate-set-capabilities:
391#
392# Enable/Disable the following migration capabilities (like xbzrle)
393#
394# @capabilities: json array of capability modifications to make
395#
396# Since: 1.2
397#
398# Example:
399#
400# -> { "execute": "migrate-set-capabilities" , "arguments":
401#      { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
402#
403##
404{ 'command': 'migrate-set-capabilities',
405  'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
406
407##
408# @query-migrate-capabilities:
409#
410# Returns information about the current migration capabilities status
411#
412# Returns: @MigrationCapabilitiesStatus
413#
414# Since: 1.2
415#
416# Example:
417#
418# -> { "execute": "query-migrate-capabilities" }
419# <- { "return": [
420#       {"state": false, "capability": "xbzrle"},
421#       {"state": false, "capability": "rdma-pin-all"},
422#       {"state": false, "capability": "auto-converge"},
423#       {"state": false, "capability": "zero-blocks"},
424#       {"state": false, "capability": "compress"},
425#       {"state": true, "capability": "events"},
426#       {"state": false, "capability": "postcopy-ram"},
427#       {"state": false, "capability": "x-colo"}
428#    ]}
429#
430##
431{ 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
432
433##
434# @MigrationParameter:
435#
436# Migration parameters enumeration
437#
438# @compress-level: Set the compression level to be used in live migration,
439#          the compression level is an integer between 0 and 9, where 0 means
440#          no compression, 1 means the best compression speed, and 9 means best
441#          compression ratio which will consume more CPU.
442#
443# @compress-threads: Set compression thread count to be used in live migration,
444#          the compression thread count is an integer between 1 and 255.
445#
446# @decompress-threads: Set decompression thread count to be used in live
447#          migration, the decompression thread count is an integer between 1
448#          and 255. Usually, decompression is at least 4 times as fast as
449#          compression, so set the decompress-threads to the number about 1/4
450#          of compress-threads is adequate.
451#
452# @cpu-throttle-initial: Initial percentage of time guest cpus are throttled
453#                        when migration auto-converge is activated. The
454#                        default value is 20. (Since 2.7)
455#
456# @cpu-throttle-increment: throttle percentage increase each time
457#                          auto-converge detects that migration is not making
458#                          progress. The default value is 10. (Since 2.7)
459#
460# @tls-creds: ID of the 'tls-creds' object that provides credentials for
461#             establishing a TLS connection over the migration data channel.
462#             On the outgoing side of the migration, the credentials must
463#             be for a 'client' endpoint, while for the incoming side the
464#             credentials must be for a 'server' endpoint. Setting this
465#             will enable TLS for all migrations. The default is unset,
466#             resulting in unsecured migration at the QEMU level. (Since 2.7)
467#
468# @tls-hostname: hostname of the target host for the migration. This is
469#                required when using x509 based TLS credentials and the
470#                migration URI does not already include a hostname. For
471#                example if using fd: or exec: based migration, the
472#                hostname must be provided so that the server's x509
473#                certificate identity can be validated. (Since 2.7)
474#
475# @max-bandwidth: to set maximum speed for migration. maximum speed in
476#                 bytes per second. (Since 2.8)
477#
478# @downtime-limit: set maximum tolerated downtime for migration. maximum
479#                  downtime in milliseconds (Since 2.8)
480#
481# @x-checkpoint-delay: The delay time (in ms) between two COLO checkpoints in
482#          periodic mode. (Since 2.8)
483#
484# @block-incremental: Affects how much storage is migrated when the
485# 	block migration capability is enabled.  When false, the entire
486# 	storage backing chain is migrated into a flattened image at
487# 	the destination; when true, only the active qcow2 layer is
488# 	migrated and the destination must already have access to the
489# 	same backing chain as was used on the source.  (since 2.10)
490#
491# @x-multifd-channels: Number of channels used to migrate data in
492#                     parallel. This is the same number that the
493#                     number of sockets used for migration.  The
494#                     default value is 2 (since 2.11)
495#
496# @x-multifd-page-count: Number of pages sent together to a thread.
497#                        The default value is 16 (since 2.11)
498#
499# @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
500#                     needs to be a multiple of the target page size
501#                     and a power of 2
502#                     (Since 2.11)
503#
504# Since: 2.4
505##
506{ 'enum': 'MigrationParameter',
507  'data': ['compress-level', 'compress-threads', 'decompress-threads',
508           'cpu-throttle-initial', 'cpu-throttle-increment',
509           'tls-creds', 'tls-hostname', 'max-bandwidth',
510           'downtime-limit', 'x-checkpoint-delay', 'block-incremental',
511           'x-multifd-channels', 'x-multifd-page-count',
512           'xbzrle-cache-size' ] }
513
514##
515# @MigrateSetParameters:
516#
517# @compress-level: compression level
518#
519# @compress-threads: compression thread count
520#
521# @decompress-threads: decompression thread count
522#
523# @cpu-throttle-initial: Initial percentage of time guest cpus are
524#                        throttled when migration auto-converge is activated.
525#                        The default value is 20. (Since 2.7)
526#
527# @cpu-throttle-increment: throttle percentage increase each time
528#                          auto-converge detects that migration is not making
529#                          progress. The default value is 10. (Since 2.7)
530#
531# @tls-creds: ID of the 'tls-creds' object that provides credentials
532#             for establishing a TLS connection over the migration data
533#             channel. On the outgoing side of the migration, the credentials
534#             must be for a 'client' endpoint, while for the incoming side the
535#             credentials must be for a 'server' endpoint. Setting this
536#             to a non-empty string enables TLS for all migrations.
537#             An empty string means that QEMU will use plain text mode for
538#             migration, rather than TLS (Since 2.9)
539#             Previously (since 2.7), this was reported by omitting
540#             tls-creds instead.
541#
542# @tls-hostname: hostname of the target host for the migration. This
543#                is required when using x509 based TLS credentials and the
544#                migration URI does not already include a hostname. For
545#                example if using fd: or exec: based migration, the
546#                hostname must be provided so that the server's x509
547#                certificate identity can be validated. (Since 2.7)
548#                An empty string means that QEMU will use the hostname
549#                associated with the migration URI, if any. (Since 2.9)
550#                Previously (since 2.7), this was reported by omitting
551#                tls-hostname instead.
552#
553# @max-bandwidth: to set maximum speed for migration. maximum speed in
554#                 bytes per second. (Since 2.8)
555#
556# @downtime-limit: set maximum tolerated downtime for migration. maximum
557#                  downtime in milliseconds (Since 2.8)
558#
559# @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
560#
561# @block-incremental: Affects how much storage is migrated when the
562# 	block migration capability is enabled.  When false, the entire
563# 	storage backing chain is migrated into a flattened image at
564# 	the destination; when true, only the active qcow2 layer is
565# 	migrated and the destination must already have access to the
566# 	same backing chain as was used on the source.  (since 2.10)
567#
568# @x-multifd-channels: Number of channels used to migrate data in
569#                     parallel. This is the same number that the
570#                     number of sockets used for migration.  The
571#                     default value is 2 (since 2.11)
572#
573# @x-multifd-page-count: Number of pages sent together to a thread.
574#                        The default value is 16 (since 2.11)
575#
576# @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
577#                     needs to be a multiple of the target page size
578#                     and a power of 2
579#                     (Since 2.11)
580# Since: 2.4
581##
582# TODO either fuse back into MigrationParameters, or make
583# MigrationParameters members mandatory
584{ 'struct': 'MigrateSetParameters',
585  'data': { '*compress-level': 'int',
586            '*compress-threads': 'int',
587            '*decompress-threads': 'int',
588            '*cpu-throttle-initial': 'int',
589            '*cpu-throttle-increment': 'int',
590            '*tls-creds': 'StrOrNull',
591            '*tls-hostname': 'StrOrNull',
592            '*max-bandwidth': 'int',
593            '*downtime-limit': 'int',
594            '*x-checkpoint-delay': 'int',
595            '*block-incremental': 'bool',
596            '*x-multifd-channels': 'int',
597            '*x-multifd-page-count': 'int',
598            '*xbzrle-cache-size': 'size' } }
599
600##
601# @migrate-set-parameters:
602#
603# Set various migration parameters.
604#
605# Since: 2.4
606#
607# Example:
608#
609# -> { "execute": "migrate-set-parameters" ,
610#      "arguments": { "compress-level": 1 } }
611#
612##
613{ 'command': 'migrate-set-parameters', 'boxed': true,
614  'data': 'MigrateSetParameters' }
615
616##
617# @MigrationParameters:
618#
619# The optional members aren't actually optional.
620#
621# @compress-level: compression level
622#
623# @compress-threads: compression thread count
624#
625# @decompress-threads: decompression thread count
626#
627# @cpu-throttle-initial: Initial percentage of time guest cpus are
628#                        throttled when migration auto-converge is activated.
629#                        (Since 2.7)
630#
631# @cpu-throttle-increment: throttle percentage increase each time
632#                          auto-converge detects that migration is not making
633#                          progress. (Since 2.7)
634#
635# @tls-creds: ID of the 'tls-creds' object that provides credentials
636#             for establishing a TLS connection over the migration data
637#             channel. On the outgoing side of the migration, the credentials
638#             must be for a 'client' endpoint, while for the incoming side the
639#             credentials must be for a 'server' endpoint.
640#             An empty string means that QEMU will use plain text mode for
641#             migration, rather than TLS (Since 2.7)
642#             Note: 2.8 reports this by omitting tls-creds instead.
643#
644# @tls-hostname: hostname of the target host for the migration. This
645#                is required when using x509 based TLS credentials and the
646#                migration URI does not already include a hostname. For
647#                example if using fd: or exec: based migration, the
648#                hostname must be provided so that the server's x509
649#                certificate identity can be validated. (Since 2.7)
650#                An empty string means that QEMU will use the hostname
651#                associated with the migration URI, if any. (Since 2.9)
652#                Note: 2.8 reports this by omitting tls-hostname instead.
653#
654# @max-bandwidth: to set maximum speed for migration. maximum speed in
655#                 bytes per second. (Since 2.8)
656#
657# @downtime-limit: set maximum tolerated downtime for migration. maximum
658#                  downtime in milliseconds (Since 2.8)
659#
660# @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
661#
662# @block-incremental: Affects how much storage is migrated when the
663# 	block migration capability is enabled.  When false, the entire
664# 	storage backing chain is migrated into a flattened image at
665# 	the destination; when true, only the active qcow2 layer is
666# 	migrated and the destination must already have access to the
667# 	same backing chain as was used on the source.  (since 2.10)
668#
669# @x-multifd-channels: Number of channels used to migrate data in
670#                     parallel. This is the same number that the
671#                     number of sockets used for migration.
672#                     The default value is 2 (since 2.11)
673#
674# @x-multifd-page-count: Number of pages sent together to a thread.
675#                        The default value is 16 (since 2.11)
676#
677# @xbzrle-cache-size: cache size to be used by XBZRLE migration.  It
678#                     needs to be a multiple of the target page size
679#                     and a power of 2
680#                     (Since 2.11)
681# Since: 2.4
682##
683{ 'struct': 'MigrationParameters',
684  'data': { '*compress-level': 'uint8',
685            '*compress-threads': 'uint8',
686            '*decompress-threads': 'uint8',
687            '*cpu-throttle-initial': 'uint8',
688            '*cpu-throttle-increment': 'uint8',
689            '*tls-creds': 'str',
690            '*tls-hostname': 'str',
691            '*max-bandwidth': 'size',
692            '*downtime-limit': 'uint64',
693            '*x-checkpoint-delay': 'uint32',
694            '*block-incremental': 'bool' ,
695            '*x-multifd-channels': 'uint8',
696            '*x-multifd-page-count': 'uint32',
697            '*xbzrle-cache-size': 'size' } }
698
699##
700# @query-migrate-parameters:
701#
702# Returns information about the current migration parameters
703#
704# Returns: @MigrationParameters
705#
706# Since: 2.4
707#
708# Example:
709#
710# -> { "execute": "query-migrate-parameters" }
711# <- { "return": {
712#          "decompress-threads": 2,
713#          "cpu-throttle-increment": 10,
714#          "compress-threads": 8,
715#          "compress-level": 1,
716#          "cpu-throttle-initial": 20,
717#          "max-bandwidth": 33554432,
718#          "downtime-limit": 300
719#       }
720#    }
721#
722##
723{ 'command': 'query-migrate-parameters',
724  'returns': 'MigrationParameters' }
725
726##
727# @client_migrate_info:
728#
729# Set migration information for remote display.  This makes the server
730# ask the client to automatically reconnect using the new parameters
731# once migration finished successfully.  Only implemented for SPICE.
732#
733# @protocol:     must be "spice"
734# @hostname:     migration target hostname
735# @port:         spice tcp port for plaintext channels
736# @tls-port:     spice tcp port for tls-secured channels
737# @cert-subject: server certificate subject
738#
739# Since: 0.14.0
740#
741# Example:
742#
743# -> { "execute": "client_migrate_info",
744#      "arguments": { "protocol": "spice",
745#                     "hostname": "virt42.lab.kraxel.org",
746#                     "port": 1234 } }
747# <- { "return": {} }
748#
749##
750{ 'command': 'client_migrate_info',
751  'data': { 'protocol': 'str', 'hostname': 'str', '*port': 'int',
752            '*tls-port': 'int', '*cert-subject': 'str' } }
753
754##
755# @migrate-start-postcopy:
756#
757# Followup to a migration command to switch the migration to postcopy mode.
758# The postcopy-ram capability must be set before the original migration
759# command.
760#
761# Since: 2.5
762#
763# Example:
764#
765# -> { "execute": "migrate-start-postcopy" }
766# <- { "return": {} }
767#
768##
769{ 'command': 'migrate-start-postcopy' }
770
771##
772# @MIGRATION:
773#
774# Emitted when a migration event happens
775#
776# @status: @MigrationStatus describing the current migration status.
777#
778# Since: 2.4
779#
780# Example:
781#
782# <- {"timestamp": {"seconds": 1432121972, "microseconds": 744001},
783#     "event": "MIGRATION",
784#     "data": {"status": "completed"} }
785#
786##
787{ 'event': 'MIGRATION',
788  'data': {'status': 'MigrationStatus'}}
789
790##
791# @MIGRATION_PASS:
792#
793# Emitted from the source side of a migration at the start of each pass
794# (when it syncs the dirty bitmap)
795#
796# @pass: An incrementing count (starting at 1 on the first pass)
797#
798# Since: 2.6
799#
800# Example:
801#
802# { "timestamp": {"seconds": 1449669631, "microseconds": 239225},
803#   "event": "MIGRATION_PASS", "data": {"pass": 2} }
804#
805##
806{ 'event': 'MIGRATION_PASS',
807  'data': { 'pass': 'int' } }
808
809##
810# @COLOMessage:
811#
812# The message transmission between Primary side and Secondary side.
813#
814# @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
815#
816# @checkpoint-request: Primary VM (PVM) tells SVM to prepare for checkpointing
817#
818# @checkpoint-reply: SVM gets PVM's checkpoint request
819#
820# @vmstate-send: VM's state will be sent by PVM.
821#
822# @vmstate-size: The total size of VMstate.
823#
824# @vmstate-received: VM's state has been received by SVM.
825#
826# @vmstate-loaded: VM's state has been loaded by SVM.
827#
828# Since: 2.8
829##
830{ 'enum': 'COLOMessage',
831  'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
832            'vmstate-send', 'vmstate-size', 'vmstate-received',
833            'vmstate-loaded' ] }
834
835##
836# @COLOMode:
837#
838# The colo mode
839#
840# @unknown: unknown mode
841#
842# @primary: master side
843#
844# @secondary: slave side
845#
846# Since: 2.8
847##
848{ 'enum': 'COLOMode',
849  'data': [ 'unknown', 'primary', 'secondary'] }
850
851##
852# @FailoverStatus:
853#
854# An enumeration of COLO failover status
855#
856# @none: no failover has ever happened
857#
858# @require: got failover requirement but not handled
859#
860# @active: in the process of doing failover
861#
862# @completed: finish the process of failover
863#
864# @relaunch: restart the failover process, from 'none' -> 'completed' (Since 2.9)
865#
866# Since: 2.8
867##
868{ 'enum': 'FailoverStatus',
869  'data': [ 'none', 'require', 'active', 'completed', 'relaunch' ] }
870
871##
872# @x-colo-lost-heartbeat:
873#
874# Tell qemu that heartbeat is lost, request it to do takeover procedures.
875# If this command is sent to the PVM, the Primary side will exit COLO mode.
876# If sent to the Secondary, the Secondary side will run failover work,
877# then takes over server operation to become the service VM.
878#
879# Since: 2.8
880#
881# Example:
882#
883# -> { "execute": "x-colo-lost-heartbeat" }
884# <- { "return": {} }
885#
886##
887{ 'command': 'x-colo-lost-heartbeat' }
888
889##
890# @migrate_cancel:
891#
892# Cancel the current executing migration process.
893#
894# Returns: nothing on success
895#
896# Notes: This command succeeds even if there is no migration process running.
897#
898# Since: 0.14.0
899#
900# Example:
901#
902# -> { "execute": "migrate_cancel" }
903# <- { "return": {} }
904#
905##
906{ 'command': 'migrate_cancel' }
907
908##
909# @migrate-continue:
910#
911# Continue migration when it's in a paused state.
912#
913# @state: The state the migration is currently expected to be in
914#
915# Returns: nothing on success
916# Since: 2.11
917# Example:
918#
919# -> { "execute": "migrate-continue" , "arguments":
920#      { "state": "pre-switchover" } }
921# <- { "return": {} }
922##
923{ 'command': 'migrate-continue', 'data': {'state': 'MigrationStatus'} }
924
925##
926# @migrate_set_downtime:
927#
928# Set maximum tolerated downtime for migration.
929#
930# @value: maximum downtime in seconds
931#
932# Returns: nothing on success
933#
934# Notes: This command is deprecated in favor of 'migrate-set-parameters'
935#
936# Since: 0.14.0
937#
938# Example:
939#
940# -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
941# <- { "return": {} }
942#
943##
944{ 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
945
946##
947# @migrate_set_speed:
948#
949# Set maximum speed for migration.
950#
951# @value: maximum speed in bytes per second.
952#
953# Returns: nothing on success
954#
955# Notes: This command is deprecated in favor of 'migrate-set-parameters'
956#
957# Since: 0.14.0
958#
959# Example:
960#
961# -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
962# <- { "return": {} }
963#
964##
965{ 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
966
967##
968# @migrate-set-cache-size:
969#
970# Set cache size to be used by XBZRLE migration
971#
972# @value: cache size in bytes
973#
974# The size will be rounded down to the nearest power of 2.
975# The cache size can be modified before and during ongoing migration
976#
977# Returns: nothing on success
978#
979# Notes: This command is deprecated in favor of 'migrate-set-parameters'
980#
981# Since: 1.2
982#
983# Example:
984#
985# -> { "execute": "migrate-set-cache-size",
986#      "arguments": { "value": 536870912 } }
987# <- { "return": {} }
988#
989##
990{ 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
991
992##
993# @query-migrate-cache-size:
994#
995# Query migration XBZRLE cache size
996#
997# Returns: XBZRLE cache size in bytes
998#
999# Notes: This command is deprecated in favor of 'query-migrate-parameters'
1000#
1001# Since: 1.2
1002#
1003# Example:
1004#
1005# -> { "execute": "query-migrate-cache-size" }
1006# <- { "return": 67108864 }
1007#
1008##
1009{ 'command': 'query-migrate-cache-size', 'returns': 'int' }
1010
1011##
1012# @migrate:
1013#
1014# Migrates the current running guest to another Virtual Machine.
1015#
1016# @uri: the Uniform Resource Identifier of the destination VM
1017#
1018# @blk: do block migration (full disk copy)
1019#
1020# @inc: incremental disk copy migration
1021#
1022# @detach: this argument exists only for compatibility reasons and
1023#          is ignored by QEMU
1024#
1025# Returns: nothing on success
1026#
1027# Since: 0.14.0
1028#
1029# Notes:
1030#
1031# 1. The 'query-migrate' command should be used to check migration's progress
1032#    and final result (this information is provided by the 'status' member)
1033#
1034# 2. All boolean arguments default to false
1035#
1036# 3. The user Monitor's "detach" argument is invalid in QMP and should not
1037#    be used
1038#
1039# Example:
1040#
1041# -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
1042# <- { "return": {} }
1043#
1044##
1045{ 'command': 'migrate',
1046  'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
1047
1048##
1049# @migrate-incoming:
1050#
1051# Start an incoming migration, the qemu must have been started
1052# with -incoming defer
1053#
1054# @uri: The Uniform Resource Identifier identifying the source or
1055#       address to listen on
1056#
1057# Returns: nothing on success
1058#
1059# Since: 2.3
1060#
1061# Notes:
1062#
1063# 1. It's a bad idea to use a string for the uri, but it needs to stay
1064#    compatible with -incoming and the format of the uri is already exposed
1065#    above libvirt.
1066#
1067# 2. QEMU must be started with -incoming defer to allow migrate-incoming to
1068#    be used.
1069#
1070# 3. The uri format is the same as for -incoming
1071#
1072# Example:
1073#
1074# -> { "execute": "migrate-incoming",
1075#      "arguments": { "uri": "tcp::4446" } }
1076# <- { "return": {} }
1077#
1078##
1079{ 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
1080
1081##
1082# @xen-save-devices-state:
1083#
1084# Save the state of all devices to file. The RAM and the block devices
1085# of the VM are not saved by this command.
1086#
1087# @filename: the file to save the state of the devices to as binary
1088# data. See xen-save-devices-state.txt for a description of the binary
1089# format.
1090#
1091# @live: Optional argument to ask QEMU to treat this command as part of a live
1092# migration. Default to true. (since 2.11)
1093#
1094# Returns: Nothing on success
1095#
1096# Since: 1.1
1097#
1098# Example:
1099#
1100# -> { "execute": "xen-save-devices-state",
1101#      "arguments": { "filename": "/tmp/save" } }
1102# <- { "return": {} }
1103#
1104##
1105{ 'command': 'xen-save-devices-state',
1106  'data': {'filename': 'str', '*live':'bool' } }
1107
1108##
1109# @xen-set-replication:
1110#
1111# Enable or disable replication.
1112#
1113# @enable: true to enable, false to disable.
1114#
1115# @primary: true for primary or false for secondary.
1116#
1117# @failover: true to do failover, false to stop. but cannot be
1118#            specified if 'enable' is true. default value is false.
1119#
1120# Returns: nothing.
1121#
1122# Example:
1123#
1124# -> { "execute": "xen-set-replication",
1125#      "arguments": {"enable": true, "primary": false} }
1126# <- { "return": {} }
1127#
1128# Since: 2.9
1129##
1130{ 'command': 'xen-set-replication',
1131  'data': { 'enable': 'bool', 'primary': 'bool', '*failover' : 'bool' } }
1132
1133##
1134# @ReplicationStatus:
1135#
1136# The result format for 'query-xen-replication-status'.
1137#
1138# @error: true if an error happened, false if replication is normal.
1139#
1140# @desc: the human readable error description string, when
1141#        @error is 'true'.
1142#
1143# Since: 2.9
1144##
1145{ 'struct': 'ReplicationStatus',
1146  'data': { 'error': 'bool', '*desc': 'str' } }
1147
1148##
1149# @query-xen-replication-status:
1150#
1151# Query replication status while the vm is running.
1152#
1153# Returns: A @ReplicationResult object showing the status.
1154#
1155# Example:
1156#
1157# -> { "execute": "query-xen-replication-status" }
1158# <- { "return": { "error": false } }
1159#
1160# Since: 2.9
1161##
1162{ 'command': 'query-xen-replication-status',
1163  'returns': 'ReplicationStatus' }
1164
1165##
1166# @xen-colo-do-checkpoint:
1167#
1168# Xen uses this command to notify replication to trigger a checkpoint.
1169#
1170# Returns: nothing.
1171#
1172# Example:
1173#
1174# -> { "execute": "xen-colo-do-checkpoint" }
1175# <- { "return": {} }
1176#
1177# Since: 2.9
1178##
1179{ 'command': 'xen-colo-do-checkpoint' }
1180