All of lore.kernel.org
 help / color / mirror / Atom feed
From: Changlong Xie <xiecl.fnst@cn.fujitsu.com>
To: Eric Blake <eblake@redhat.com>,
	qemu devel <qemu-devel@nongnu.org>, Fam Zheng <famz@redhat.com>,
	Max Reitz <mreitz@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Kevin Wolf <kwolf@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>
Cc: Gonglei <arei.gonglei@huawei.com>,
	zhanghailiang <zhang.zhanghailiang@huawei.com>,
	fnstml-hwcolo@cn.fujitsu.com
Subject: Re: [Qemu-devel] [PATCH v14 5/8] docs: block replication's description
Date: Wed, 3 Feb 2016 11:18:01 +0800	[thread overview]
Message-ID: <56B17169.90601@cn.fujitsu.com> (raw)
In-Reply-To: <56B0C945.60100@redhat.com>

On 02/02/2016 11:20 PM, Eric Blake wrote:
> On 01/13/2016 02:18 AM, Changlong Xie wrote:
>> From: Wen Congyang <wency@cn.fujitsu.com>
>>
>> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
>> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
>> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
>> Signed-off-by: Changlong Xie <xiecl.fnst@cn.fujitsu.com>
>> ---
>>   docs/block-replication.txt | 229 +++++++++++++++++++++++++++++++++++++++++++++
>>   1 file changed, 229 insertions(+)
>>   create mode 100644 docs/block-replication.txt
>>
>> diff --git a/docs/block-replication.txt b/docs/block-replication.txt
>> new file mode 100644
>> index 0000000..d1a231e
>> --- /dev/null
>> +++ b/docs/block-replication.txt
>> @@ -0,0 +1,229 @@
>> +Block replication
>> +----------------------------------------
>> +Copyright Fujitsu, Corp. 2015
>> +Copyright (c) 2015 Intel Corporation
>> +Copyright (c) 2015 HUAWEI TECHNOLOGIES CO., LTD.
>
> Do you want to claim 2016 for any of this?

Will update in next version.

>
>> +
>> +This work is licensed under the terms of the GNU GPL, version 2 or later.
>> +See the COPYING file in the top-level directory.
>> +
>> +Block replication is used for continuous checkpoints. It is designed
>> +for COLO (COarse-grain LOck-stepping) where the Secondary VM is running.
>> +It can also be applied for FT/HA (Fault-tolerance/High Assurance) scenario,
>> +where the Secondary VM is not running.
>> +
>> +This document gives an overview of block replication's design.
>> +
>> +== Background ==
>> +High availability solutions such as micro checkpoint and COLO will do
>> +consecutive checkpoints. The VM state of Primary VM and Secondary VM is
>
> s/of Primary/of the Primary/

OK

>
>> +identical right after a VM checkpoint, but becomes different as the VM
>> +executes till the next checkpoint. To support disk contents checkpoint,
>> +the modified disk contents in the Secondary VM must be buffered, and are
>> +only dropped at next checkpoint time. To reduce the network transportation
>> +effort at the time of checkpoint, the disk modification operations of
>
> s/at the time of/during a vmstate/
> s/operations of/operations of the/

OK

>
>> +Primary disk are asynchronously forwarded to the Secondary node.
>> +
>> +== Workflow ==
>
>> +== Architecture ==
>
>> +
>> +6) The drive-backup job(sync=none) is run to allow hidden-disk to buffer
>
> Space before ( in English description.

OK

>
>> +any state that would otherwise be lost by the speculative write-through
>> +of the NBD server into the secondary disk. So before block replication,
>> +the primary disk and secondary disk should contain the same data.
>> +
>> +== Failure Handling ==
>
>> +== Usage ==
>> +Primary:
>> +  -drive if=xxx,driver=quorum,read-pattern=fifo,id=colo1,vote-threshold=1,\
>> +         children.0.file.filename=1.raw,\
>> +         children.0.driver=raw
>> +
>> +  Run qmp command in primary qemu:
>> +    { 'execute': 'human-monitor-command',
>> +      'arguments': {
>> +          'command-line': 'drive_add buddy driver=replication,mode=primary,file.driver=nbd,file.host=xxxx,file.port=xxxx,file.export=colo1,node-name=nbd_client1,if=none'
>
> Eww. We shouldn't ever have to pack a command line as . single QMP
> string that needs reparsing.  Instead, you should pass the information
> as a nested QMP dictionary, something like:
>
> 'arguments': {
>    'remote-command': { 'command': 'drive_add', 'name': 'buddy',
>                        'driver': 'replication', 'mode': 'primary',
>                        'file': { 'driver': 'nbd', 'host': 'xxxx',

Hi Eric

What is 'remote-command' here? I just tried below commands, but got some 
errors.

{'execute': 'human-monitor-command',
     'arguments': {
        'command-line': {
             'command': 'drive_add',
             'name': 'buddy',
             'driver': 'replication',
             'mode': 'primary',
             'if': 'none',
             'node-name': 'primary_nbd_node',
             'file': {
                 'driver': 'nbd',
                 'host': '192.168.3.2',
                 'port': '8889',
                 'export': 'colo-disk',
             }

         }
      }
}
{"error": {"class": "GenericError", "desc": "Invalid JSON syntax"}}		


'blockdev-add' doesn't support 'nbd'. So we use 'drive_add' here, and 
it's a hmp command. If i'm right, there seems just one way to execute 
hmp commands in QMP:

================================================================
EQMP

     {
         .name       = "human-monitor-command",
         .args_type  = "command-line:s,cpu-index:i?",
         .mhandler.cmd_new = qmp_marshal_human_monitor_command,
     },

SQMP
human-monitor-command
---------------------

Execute a Human Monitor command.

Arguments:

- command-line: the command name and its arguments, just like the
                 Human Monitor's shell (json-string)
- cpu-index: select the CPU number to be used by commands which access CPU
              data, like 'info registers'. The Monitor selects CPU 0 if this
              argument is not provided (json-int, optional)

Example:

-> { "execute": "human-monitor-command", "arguments": { "command-line": 
"info kvm" } }
<- { "return": "kvm support: enabled\r\n" }
==================================================================

	   	
Thanks
	-Xie


>    ... } } }
>
>> +      }
>> +    }
>> +    { 'execute': 'x-blockdev-change',
>> +      'arguments': {
>> +          'parent': 'colo1',
>> +          'node': 'nbd_client1'
>> +      }
>> +    }
>> +  Note:
>> +  1. There should be only one NBD Client for each primary disk.
>> +  2. host is the secondary physical machine's hostname or IP
>> +  3. Each disk must have its own export name.
>> +  4. It is all a single argument to -drive and you should ignore the
>> +     leading whitespace.
>> +  5. The qmp command line must be run after running qmp command line in
>> +     secondary qemu.
>> +
>> +Secondary:
>> +  -drive if=none,driver=raw,file.filename=1.raw,id=colo1 \
>> +  -drive if=xxx,driver=replication,mode=secondary,\
>> +         file.file.filename=active_disk.qcow2,\
>> +         file.driver=qcow2,\
>> +         file.backing.file.filename=hidden_disk.qcow2,\
>> +         file.backing.driver=qcow2,\
>> +         file.backing.backing=colo1
>> +
>> +  Then run qmp command in secondary qemu:
>> +    { 'execute': 'nbd-server-start',
>> +      'arguments': {
>> +          'addr': {
>> +              'type': 'inet',
>> +              'data': {
>> +                  'host': 'xxx',
>> +                  'port': 'xxx'
>> +              }
>> +          }
>> +      }
>> +    }
>> +    { 'execute': 'nbd-server-add',
>> +      'arguments': {
>> +          'device': 'colo1',
>> +          'writable': true
>> +      }
>> +    }
>> +
>> +  Note:
>> +  1. The export name in secondary QEMU command line is the secondary
>> +     disk's id.
>> +  2. The export name for the same disk must be the same
>> +  3. The qmp command nbd-server-start and nbd-server-add must be run
>> +     before running the qmp command migrate on primary QEMU
>> +  4. Active disk, hidden disk and nbd target's length should be the
>> +     same.
>> +  5. It is better to put active disk and hidden disk in ramdisk.
>> +  6. It is all a single argument to -drive, and you should ignore
>> +     the leading whitespace.
>> +
>> +After Failover:
>> +Primary:
>> +  The secondary host is down, so we should run the following qmp command
>> +  to remove the nbd child from the quorum:
>> +  { 'execute': 'x-blockdev-change',
>> +    'arguments': {
>> +        'parent': 'colo1',
>> +        'child': 'children.1'
>> +    }
>> +  }
>> +  Note: there is no qmp command to remove the blockdev now
>> +
>> +Secondary:
>> +  The primary host is down, so we should do the following thing:
>> +  { 'execute': 'nbd-server-stop' }
>> +
>> +TODO:
>> +1. Continuous block replication
>> +2. Shared disk
>>
>

  reply	other threads:[~2016-02-03  3:17 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-13  9:18 [Qemu-devel] [PATCH v14 0/8] Block replication for continuous checkpoints Changlong Xie
2016-01-13  9:18 ` [Qemu-devel] [PATCH v14 1/8] unblock backup operations in backing file Changlong Xie
2016-01-13  9:18 ` [Qemu-devel] [PATCH v14 2/8] Store parent BDS in BdrvChild Changlong Xie
2016-01-13  9:18 ` [Qemu-devel] [PATCH v14 3/8] Backup: clear all bitmap when doing block checkpoint Changlong Xie
2016-01-27 16:05   ` Stefan Hajnoczi
2016-01-28  2:22     ` Changlong Xie
2016-01-13  9:18 ` [Qemu-devel] [PATCH v14 4/8] Allow creating backup jobs when opening BDS Changlong Xie
2016-01-27 14:04   ` Stefan Hajnoczi
2016-01-28  2:22     ` Changlong Xie
2016-01-13  9:18 ` [Qemu-devel] [PATCH v14 5/8] docs: block replication's description Changlong Xie
2016-02-02 15:20   ` Eric Blake
2016-02-03  3:18     ` Changlong Xie [this message]
2016-02-03  3:35       ` Eric Blake
2016-02-03  3:40         ` Wen Congyang
2016-01-13  9:18 ` [Qemu-devel] [PATCH v14 6/8] auto complete active commit Changlong Xie
2016-01-13  9:18 ` [Qemu-devel] [PATCH v14 7/8] Implement new driver for block replication Changlong Xie
2016-01-20  0:04   ` Eric Blake
2016-01-20  7:45     ` Changlong Xie
2016-01-27 14:46   ` Stefan Hajnoczi
2016-01-28  1:13     ` Wen Congyang
2016-01-28 15:15       ` Stefan Hajnoczi
2016-01-29  3:13         ` Changlong Xie
2016-01-29 15:46           ` Stefan Hajnoczi
2016-02-01  1:13             ` Wen Congyang
2016-02-02 14:34               ` Stefan Hajnoczi
2016-02-03  1:29                 ` Wen Congyang
2016-02-03  9:32                   ` Stefan Hajnoczi
2016-02-03  9:55                     ` Wen Congyang
2016-02-03 11:25                       ` Hailiang Zhang
2016-01-13  9:18 ` [Qemu-devel] [PATCH v14 8/8] support replication driver in blockdev-add Changlong Xie
2016-01-14  1:12 ` [Qemu-devel] [PATCH v14 0/8] Block replication for continuous checkpoints Changlong Xie
2016-01-19  1:27   ` Hailiang Zhang
2016-01-24 13:34 ` Wen Congyang
2016-01-26 16:04   ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56B17169.90601@cn.fujitsu.com \
    --to=xiecl.fnst@cn.fujitsu.com \
    --cc=arei.gonglei@huawei.com \
    --cc=eblake@redhat.com \
    --cc=famz@redhat.com \
    --cc=fnstml-hwcolo@cn.fujitsu.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=zhang.zhanghailiang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.