From: Bing Bu Cao <mars@linux.vnet.ibm.com>
To: QEMU Developers <qemu-devel@nongnu.org>, aliguori@us.ibm.com
Cc: Bing Bu Cao <mars@linux.vnet.ibm.com>
Subject: [Qemu-devel] How to share disk image between two kvm guests
Date: Thu, 26 Jul 2012 10:51:58 +0800 [thread overview]
Message-ID: <5010B0CE.2050900@linux.vnet.ibm.com> (raw)
Hi,all
I want to use qemu-nbd to share disk between two kvm guests.
I.
# qemu-nbd -p 1024 -e 2 -n my-disk.qcow2
# nbd-client localhost 1024 /dev/nbd0
# nbd-client localhost 1024 /dev/nbd1
II.
guest1:
# /usr/local/bin/qemu -enable-kvm -m 1024 -drive file=ubuntu.img -drive
file=/dev/nbd0,cache=none -net user -net nic,model=virtio -chardev
stdio,id=mon0 -mon chardev=mon0 -usb -device usb-tablet
guest2:
# /usr/local/bin/qemu -enable-kvm -m 1024 -drive file=ubuntu.img -drive
file=/dev/nbd0,cache=none -net user -net nic,model=virtio -chardev
stdio,id=mon0 -mon chardev=mon0 -usb -device usb-tablet
Found one problem:
No disk r/w sync between 2 virtual hosts.
One write/change on the shared disk,
another virtual host must remount the disk and can see the update from
the other virtual host.
For example,a simply test:
In the guest1,mount the disk and create on text file add some line to it.
In the guest2,mount the same disk and print the text file and found the
content is not updated.
But after after I remount the disk, the content will be updated.
Is it a issue of guest OS or qemu-nbd? Can you help me?
--
Best Regards,
Bing Bu Cao
next reply other threads:[~2012-07-26 2:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-26 2:51 Bing Bu Cao [this message]
2012-07-26 9:30 ` [Qemu-devel] How to share disk image between two kvm guests Stefan Hajnoczi
2012-07-26 10:19 ` Bing Bu Cao
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=5010B0CE.2050900@linux.vnet.ibm.com \
--to=mars@linux.vnet.ibm.com \
--cc=aliguori@us.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).