All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandre DERUMIER <aderumier@odiso.com>
To: Fam Zheng <famz@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] blockdev-mirror , how to replace old nodename by new nodename ?
Date: Wed, 19 Apr 2017 11:40:18 +0200 (CEST)	[thread overview]
Message-ID: <1746435304.10992233.1492594818158.JavaMail.zimbra@oxygem.tv> (raw)
In-Reply-To: <20170419090236.GA14508@lemon.lan>

Ok thanks.

I'll retry without replaces, but I'm pretty sure It was not working too.


Also, I notice something strange,

when I define the job-id (which is mandatory), it's replace the device option.
(If I set a random job-id name, the mirroring is not working because it don't find the device).


----- Mail original -----
De: "Fam Zheng" <famz@redhat.com>
À: "aderumier" <aderumier@odiso.com>
Cc: "qemu-devel" <qemu-devel@nongnu.org>
Envoyé: Mercredi 19 Avril 2017 11:02:36
Objet: Re: [Qemu-devel] blockdev-mirror , how to replace old nodename by new nodename ?

On Wed, 04/19 09:08, Alexandre DERUMIER wrote: 
> Hi, 
> 
> I'm trying to implement blockdev-mirror, to replace drive-mirror as we can pass more options with blockdev-mirror. 
> 
> 
> I would like to mirror an attached blockdev to a new blockdev, then switch at the end of block-job-complete, like for drive-mirror. 
> 
> 
> qemu command line (vm-138-disk-1.qcow2 filename on "drive-virtio0" nodename: 
> 
> -blockdev {"node-name":"drive-virtio0","cache":{"direct":true},"driver":"qcow2","file":{"filename":"/var/lib/vz/images/138/vm-138-disk-1.qcow2","aio":"threads","driver":"file"}} 
> -device virtio-blk-pci,drive=drive-virtio0,id=virtio0,bus=pci.0,addr=0xa,write-cache=on 
> 
> 
> add a new blockdev with blockdev-add: (a file vm-138-disk-2.raw has been created before, I assign it to a "tempmirror" nodename) 
> 
> 
> {"arguments":{"driver":"raw","cache":{"direct":true},"node-name":"tempmirror","file":{"driver":"file","aio":"threads","filename":"/var/lib/vz/images/138/vm-138-disk-2.raw"}},"execute":"blockdev-add"} 
> 
> 
> blockdev-mirror: 
> 
> {"arguments":{"job-id":"drive-virtio0","target":"tempmirror","sync":"full","replaces":"drive-virtio0","device":"drive-virtio0"},"execute":"blockdev-mirror"} 
> 
> (I have try with or without replaces option) 
> 
> then query-name-block-nodes, show vm-138-disk-2.raw file on tempmirror "node-name", and vm-138-disk1.qcow2 on "drive-virtio0" node-name 
> 
> 
> I expected that both was switched, like for drive-mirror. 

The replace/switch happens when you do block-job-complete. 

And I think in your use case "replaces" is not needed. That one is for replacing 
a node under quorum 

Fam 

  reply	other threads:[~2017-04-19  9:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-19  7:08 [Qemu-devel] blockdev-mirror , how to replace old nodename by new nodename ? Alexandre DERUMIER
2017-04-19  9:02 ` Fam Zheng
2017-04-19  9:40   ` Alexandre DERUMIER [this message]
2017-04-19 10:43 ` Kashyap Chamarthy
2017-04-19 12:28   ` Alexandre DERUMIER
2017-04-19 12:58     ` Kashyap Chamarthy
2017-04-19 13:36       ` Alexandre DERUMIER
2017-04-19 13:48         ` Alexandre DERUMIER

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=1746435304.10992233.1492594818158.JavaMail.zimbra@oxygem.tv \
    --to=aderumier@odiso.com \
    --cc=famz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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.