qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Using the one disk image file on 2 virtual machines at


From: Eric Blake
Subject: Re: [Qemu-devel] Using the one disk image file on 2 virtual machines at the same time
Date: Tue, 28 Jul 2015 15:40:23 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

On 07/28/2015 11:06 AM, 한만종 wrote:
> Hi,
> 
> I'm facing a weird behavior when I used the one disk image file on 2 virtual 
> machines at the same time.
> 
> I made the instance of a virtual machine, using the below command.
> $ qemu-system-x86_64 -smp 2 -m 1024 -hda 10G.qcow2 -enable-kvm
> 
> When the OS(Ubuntu 14.04 64bit) was booted up, I made an another one, using 
> the same command.
> $ qemu-system-x86_64 -smp 2 -m 1024 -hda 10G.qcow2 -enable-kvm
> 
> Then, I had 2 virtual machines using the same disk image file.

Bad idea.  You should NEVER have more than one qemu or qemu-img opening
an image read-write at the same time (even having multiple read-only
qemu-img visitors visiting a file opened read-write by qemu is
dangerous).  You are very likely to cause fatal corruption to the point
that neither guest will be able to see data.

> 
> When I made a directory on first virtual machine, using the command like 
> below.
> $ mkdir test1
> 
> The "test1" directory wasn't showed on another virtual machine. And, I made a 
> directory on second virtual machine, using the command like below.
> $ mkdir test2
> 
> The "test2" directory wasn't showed on another virtual machine, either.

And you should NOT expect it to work.  qcow2 images are NOT shared file
systems.  If you want a shared file system, then do something like
having both your guests mount common storage via NFS or glusterfs or
some other protocol designed to be used as a shared file systems.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]