LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   KVM: two Guests running on two different Hosts mounting same qcow2 concurrently = corruption? (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/kvm-two-guests-running-on-two-different-hosts-mounting-same-qcow2-concurrently-%3D-corruption-4175605774/)

arcadiosincero 05-12-2017 07:55 AM

KVM: two Guests running on two different Hosts mounting same qcow2 concurrently = corruption?
 
I have two KVM Guests running on two different Hosts that are mounting the same qcow2 via NFS at the same time. Will this lead to corruption of the qcow2? If so, is there a way to prevent this via some sort of locking mechanism?

syg00 05-12-2017 08:10 AM

If both mount it read only you should be ok.

Cluster aware filesystems took a long time to develop for a reason. It's called data consistency. Perhaps you shouldn't deliberately circumvent it.

gradinaruvasile 05-12-2017 10:13 AM

Why would you want 2 guests to mount the same image at the same time?

xamaco 05-12-2017 11:37 AM

Have a look at copy on write in the Qemu documentation.

jefro 05-12-2017 02:42 PM

I don't think this is a qcow issue exactly but a nfs issue. No matter the basic filesystem or mount mechanism the issue is how nfs handles concurrent access. Samba and nfs are both good at that under some limits. The NFSv4.1 has some locks in place but if aggressive database access or other type of programs on it may be a problem.

asincero 05-12-2017 05:54 PM

Quote:

Originally Posted by gradinaruvasile (Post 5709607)
Why would you want 2 guests to mount the same image at the same time?

I don't. I was kind of hoping there was something built in to prevent something stupid like that because mistakes do happen.

jefro 05-12-2017 08:11 PM

Samba and NFS handle SOHO uses of many users just fine.

gradinaruvasile 05-13-2017 12:30 AM

Quote:

Originally Posted by asincero (Post 5709824)
I don't. I was kind of hoping there was something built in to prevent something stupid like that because mistakes do happen.

It depends how you use KVM. I you use 2 standalone servers one has no idea what the other does. If you use some clustering solution where both servers are part of the same cluster then you may manage everything centrally.


All times are GMT -5. The time now is 11:01 PM.