This message was deleted.
# harvester
a
This message was deleted.
d
Do you want this data to be persistent? Is it a database or a filesystem? The "Add Container" option is only for ephemeral data such as might be used for container storage that does not persist after the container is gone. If the storage to be shared between two VMs is to be persistent, and if it needs to be consistent while being accessed and modified by two VMs, then you need some means to coordinate access to preserve consistency. A reasonable way to do that would be to have a storage server of some kind (a file server like NFS or CIFS) or an object store (such as min.io) that both of your VMs would use for all its requests to the storage. Such a server could be in a VM, or it could even be in a container inside one of your VMs. You would have to set up all of your accesses to that storage to go through that server.
b
Thank you for your reply! I want only share some data between two VMs. It is a filesystem. I don't want to download data throughout network when I create a VM. Because this used double VM's storage space.
d
If you were to directly attach a storage volume to 2 (or more) VMs, you should think about it as though you were plugging a physical drive directly into multiple physical machines. Normal storage drives don’t let you do that but you can do the equivalent of that by having the “drive” be a LUN on a SAN server that you access with iSCSI or Fibre Channel; but even then the machines accessing the LUN have to coordinate with each other in order to avoid stepping on each other as they write to the storage device. Filesystem code in your OS isn’t really designed to do this in this manner. It’s much simpler to have a single system (VM) “own” the control over the filesystem, and to have all accesses go through that. You have a few choices about how to approach this. You mentioned 2 VMs you want to have access that storage volume. You could have one of those VMs “own” the storage, and have it export the storage by NFS or CIFS to the other VM. This would make one of your VMs be “the important one” for purposes of this storage. An alternative could be to have a 3rd VM whose purpose would be only to be the server for that storage. But then you have 3 VMs, which you might not want, and your Harvester cluster may not be provisioned in a way to make that convenient. You’ll have to consider what resources you have and how you want to allocate them. There’s no one-size-fits-all answer but these are some possibilities.
☝️ 1