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?