I am trying to use Shared Disk feature to mount a single SSD drive to multiple Linux VMs.
I am able to attach a single Shared Disk to multiple Linux VMs.
I am able to create a partition (tried ext4, xfs, ntfs filesystem) on the Shared Disk.
I can do sudo mount /dev/sdc1 /data
on my VMs and it works.
If there was any data in /dev/sdc1/
, then it is visible in all the VMs with this Shared Disk mounted.
My problem starts when I want to write to the Shared Disk from one of the VMs.
The results of the write operation is visible to the machine it was called from, but it is not visible on other machines attached to the Shared Disk, unless I umount
and mount
the Shared Disk manually.
To make the write operation from machine A visible on the machine B, I need to call the following commands on machine B:
sudo umount /data
sudo mount /dev/sdc1 /data
After doing this, I can see the changes made by A from B.
I tried to solve the problem by creating different machine configurations, creating the Shared Disk from scratch multiple times - in case it was corrupted, changing partition filesystem, adding the mount to /etc/fstab with "nosync" option, but the results are always the same.
I expect the "Shared Disk" feature to create read+write capable Shared Disk that can be read and modified from multiple VMs. Specifically, I want to be able to read+write from machines A and B at the same time. I want machine B to see changes made by machine A.
EDIT:
After creating and attaching the Shared Disk to the VMs, I use these instructions from Microsoft to format and mount the Disk. I create the partition once, from one of the VMs. From the other machines I run only sudo mount /dev/sdc1 /data
.