We made something familiar in a Linux cluster setup.
The Linux cluster exists of 2 seperate VM's and 2 datastores. Each VM's OS disk exists on one of the two datastores.
The data disk exists of 2 disks, one from each datastore and they are combined in the same volume(group)
So let's say one linux VM is active and the other standby. (Linux clustering handles the failover mechanism which server will be the active one)
All data written to the data volumegroup will be written to both VMDK's.
For your case I guess you can use the same method to present a VMDK to two diffent VM's and use them. In our case it is always a active/passive situation which prevents writing to the same disk from 2 nodes. I also don't know if it's recommended to Read and write simultaneously from 2 VM's on the same disk
To build the data volume group I do this:
- Start by adding a new disk to the first VM
- Remember the SCSI ID of the disk you add!
Choose the options below
- Disk provisioning type = Thick : Eager Zeroed
- Independent mode -> Persistent (Changes are immediately and permanently written to the disk)
After finishing a disk is added, go back to edit settings (or use powercli/SSH) to edit the advanced VMX settings.
vSphere Client:
VM needs to be powered off !
- Choose "Edit settings" -> "Options" -> "General" -> "Configuration Parameters"
As you remember or wrote down the SCSI ID, sort the column by name and search for scsiX:X (whatever you wrote down) for example I now use scsi1:0
Change the setting scsi1:0.ctkenabled from "true" to "false" this disables Change Blocktracking. I noticed that with CBT there could be a problem on the passive node to open or use the disk because the CBT disk is in use on the active node. This prevents the passive node from using it properly.
VMware KB: Enabling Changed Block Tracking (CBT) on virtual machines
On to the next setting:
- Add a new row with the name "scsi1:0.sharing"
- Value = "Multi-writer"
- Press "OK" and submit the changes you made
VMware KB: Disabling simultaneous write protection provided by VMFS using the multi-writer flag
By setting this value it now is possible for 2 "powered-on" VMs to use the same disk.
Now the same disk needs to be added to the 2nd VM
Go to the 2nd VM - "Edit settings" -> add harddisk -> "use an existing virtual disk" -> browse to the disk you created above
Add the disk and repeat the steps above about disabling CTK and enable multi-writer. Also check if the disk is "Independent - Persistent mode"
Powercli
get-vm <VM>|Get-AdvancedSetting -Name scsi1:0.ctkEnabled|Set-AdvancedSetting -Value false –confirm:$false
get-vm <VM>| New-AdvancedSetting -Name "scsi1:0.sharing" -Value "multi-writer" –confirm:$false
Also you best should create a DRS rule so to seperate the both VM's, else if your host crashes and somehow both VM's are on the same host, both your VM's could go down and your load balancing wouldn't help you there :smileyhappy: