All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gary R Hook <grhookatwork@gmail.com>
To: Kashyap Chamarthy <kchamart@redhat.com>
Cc: libvirt-users@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [libvirt-users] Using virsh blockcopy -- what's it supposed to accomplish?
Date: Thu, 08 Jan 2015 18:04:20 -0600	[thread overview]
Message-ID: <54AF1B04.6080704@gmail.com> (raw)
In-Reply-To: <20150108202140.GL22477@tesla.redhat.com>

On 1/8/15 2:21 PM, Kashyap Chamarthy wrote:

>> qemu-img create -f qcow2 /tmp/dsk.test.qcow2
>
> A typo? You also need to provide a size here:
>
>      $ qemu-img create -f qcow2 /tmp/dsk.test.qcow2 1G

Yes, my mistake. The size is set to the potential size of the source 
disk, which in this case is 20G.

> For the rest, I'm afraid I still didn't manage time to test
> the NBD scenario to give a meaningful response here. I'll let the others
> who deal with NBD more often respond to it.

Well, that's the trick, right? No one that may have any experience has 
managed to pitch in to this conversation.

I can add this now: qemu-nbd seems to function like nbd-server, and 
concern itself with serving a filesystem. What's need, however, is a 
simple _file_. The challenge is getting that NBD-served thing to be 
viewed the same as a local disk file.

It would appear that the virsh option --raw is required. As far as I can 
tell, both virsh and qemu-nbd munge data with the intent of making it 
suitable for a qcow2 destination; the problem is that we don't need 
double-munging. So telling the blockcopy operation to "knock it off" 
seems to make it treat the NBD device the same as it does a simple disk 
file.

Yea!

So I find that the following:

>> qemu-nbd -f qcow2 -p11112 /tmp/dsk.test.qcow2
>> nbd-client localhost 11112 /dev/nbd2
>> virsh dumpxml my_domain > my_domain.xml
>> virsh undefine my_domain
>> virsh blockcopy --domain my_domain --wait --verbose --finish

only requires the addition of "--raw" to the above command. Or, rather, 
what I really need, which is

virsh blockcopy --domain my_domain --raw

which I can then control with subsequent commands.

I'm kinda surprised no one else has tried to do this and lived to write 
about it.

-- 
Gary R Hook
Senior Kernel Engineer
NIMBOXX, Inc

  reply	other threads:[~2015-01-09  0:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <54989AB7.7050607@gmail.com>
     [not found] ` <5498A052.8060904@redhat.com>
     [not found]   ` <20141223121708.GB24588@tesla.redhat.com>
     [not found]     ` <5499B6C1.2060601@gmail.com>
     [not found]       ` <20141224104226.GE24588@tesla.redhat.com>
2015-01-08 19:44         ` [Qemu-devel] [libvirt-users] Using virsh blockcopy -- what's it supposed to accomplish? Gary R Hook
2015-01-08 20:21           ` Kashyap Chamarthy
2015-01-09  0:04             ` Gary R Hook [this message]
2015-01-09  8:30               ` Kashyap Chamarthy
2015-01-08 21:04           ` Eric Blake
2015-01-08 21:13             ` Paolo Bonzini
2015-01-09  0:18             ` Gary R Hook

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=54AF1B04.6080704@gmail.com \
    --to=grhookatwork@gmail.com \
    --cc=kchamart@redhat.com \
    --cc=libvirt-users@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.