avoid redundant writing of virus scan signatures in VMs on same disk [closed]

I have two VMs on the same disk that each have clamav installed. Both regularly run updates for the same virus scan signatures simultaneously which results in an unnecessary strain on the performance of the disk every time. Since those are the same signatures that are downloaded, I want to reduce the redundancy in that case.

The initial idea was to let them share a virtual disk where those signatures are downloaded once, so the VMs just read them from there. Therefore, only one VM needs a write access to the disk for downloading while the other has readonly access.

I attached the virtual disk to the first VM with: $ virsh attach-disk <VM1> <virtDisk> vdb --cache none

However, while trying to attach the same virtual disk to the second VM, after attaching it to the first successfully, with: $ virsh attach-disk <VM2> <virtDisk> vdb --cache none --mode readonly

the error unable to execute QEMU command 'device-add': Failed to get shared "write" lock occurred. Is it just not possible that way or am I missing an option?

What would be the best way to share those signatures between VMs for that purpose?


Solution 1:

You need some cluster-aware file system to share any block device in between multiple non-R/O consumers. See whole story wrap up here:

https://forums.starwindsoftware.com/viewtopic.php?f=5&t=1392

It's the same for any block storage like SAS, FC, iSCSI or virtual block device.