From: John Snow <jsnow@redhat.com>
To: Manjong Han <aksmj8855@gmail.com>, Stefan Hajnoczi <stefanha@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Using the one disk image file on 2 virtual machines at the same time
Date: Wed, 29 Jul 2015 13:46:38 -0400 [thread overview]
Message-ID: <55B9117E.2030006@redhat.com> (raw)
In-Reply-To: <CAF9qypJkLrv1=PjwLJuA+v6+SUCa8gRfVSmAAK-QHj9xx4fCYA@mail.gmail.com>
On 07/29/2015 01:29 PM, Manjong Han wrote:
> Thanks, Stefan.
>
> 2015-07-29 17:46 GMT+09:00 Stefan Hajnoczi <stefanha@gmail.com>:
>>
>> You should probably use qcow2 backing files instead:
>>
>> 10G.qcow2 <-- vm001.qcow2
>> ^-- vm002.qcow2
>>
>> The command to create these files is:
>>
>> qemu-img create -f qcow2 -o backing_file=10G.qcow2 vm001.qcow2.
>>
>> Both VMs share the data in 10G.qcow2. All writes go to vm001.qcow2 or
>> vm002.qcow2, respectively, so they don't corrupt each other.
>>
>
> I tried to create a backing files, using the commands which you told.
>
> $ qemu-img create -f qcow2 -o backing_file=10G.qcow2 vm001.qcow2
> $ qemu-img create -f qcow2 -o backing_file=10G.qcow2 vm002.qcow2
>
> And, I used these backing files on each virtual machines.
> But, new files weren't written on original disk image(10G.qcow2)..
> The backing files were working each other.
>
>> Standard file systems (ext4, xfs) and volume managers (LVM) are not
>> cluster-aware by default. They must only be accessed from one machine
>> at a time. Otherwise you risk data corruption.
>>
>
> I think that I must probably use a shared file system like NFS..
>
Yes, any files written using the backing files like outlined above will
put new files in the overlays (e.g. vm001.qcow2 or vm002.qcow2) and NOT
into the backing file (10G.qcow2)
this is a safe way to share a base image for an OS, but it's not a
method of accomplishing a concurrent fileshare.
You'll want to configure an NFS or CIFS share (etc) in the base image
and then allow the multiple VMs to utilize that share.
--js
next prev parent reply other threads:[~2015-07-29 17:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-28 15:57 [Qemu-devel] Using the one disk image file on 2 virtual machines at the same time Manjong Han
2015-07-29 8:46 ` Stefan Hajnoczi
2015-07-29 11:34 ` Kashyap Chamarthy
2015-07-29 17:29 ` Manjong Han
2015-07-29 17:46 ` John Snow [this message]
2015-07-31 12:27 ` Christopher Covington
-- strict thread matches above, loose matches on Subject: below --
2015-07-28 16:45 Manjong Han
2015-07-28 17:06 한만종
2015-07-28 21:40 ` Eric Blake
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=55B9117E.2030006@redhat.com \
--to=jsnow@redhat.com \
--cc=aksmj8855@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.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.