4

I need to share single VHDX with 1 large partition containing no OS, just plain files (mainly pictures) and promote it to 2 different VMs with 2different OS at 1time :

  1. VM Windows with stock keeping and editing program (used to manage the files, edit, etc) and
  2. VM with Linux Ubuntu with E-commerce system....both systems will use the same "folder with pictures which is about 150GB" and to reduce the "sync" process with some third party tool which will be strange for Linux I need to share this "Disk" between both VMs. Both VMs will need to have Read/write privileges.

Is there a way how to share this independent VHDx to BOTH VMs in one time? (no DFS please, I had problems with keeping files in sync once I tried it). Both VMs ideally would need to have it mounted as "internal storage" or something similar to allow both the programs to behave "natively". (iSCSI??...I guess simple network share "Map drive" might misbehave the programs function) Is there a way? To keep sutup simple yet with redundancy, I have 2 identical servers, with replication enabled between them. Both have the same RAID5 volume from SSDs, same NIC, same memory, same CPU... Some VMs (6 from 10)are running on 1server, other VMs (4from 10)are running on the other, ....the other server is always used for replications (ideally want to use only this hardware, which has alot power )....so anything I will create on primary server, ideally will need to be created as "slave" on the other machine, in case 1.server will fail.... (+replicate physically the VHDx to other server too) Thank you and I appreciate any help. WServer 2012 R2

5

You can try going alternative route. Deploying a Failover Cluster using something like StarWind VSAN or alternatives (S2D is available from Windows Server 2016), which will replicate data on the block level between the nodes, while cluster will failover you VMs. In this case you can utilize your existing RAID5 on both nodes. The following guide might help: https://www.starwindsoftware.com/resource-library/starwind-virtual-san-for-hyper-v-2-node-hyperconverged-scenario-with-windows-server-2012-r2/

0

You cannot share a single block device (disk image) between multiple VMs and expect it to be in consistent state. Practically all file systems require exclusive access to the block device they are using.

Your best option is to add the data VHD to either virtual machine, and then use networking file system to connect the other VM.

If you add the volume to Windows, share the filesystem using normal Windows file sharing, and use Samba on Ubuntu to connect to the share.

5
  • Hi, thanks....I sort of thought this kind of answer....I was hoping iSCSI or similar might be suitable.....In case I will do it as you suggested (if there will be no better option) I guess the e-commerce system will need much faster disk access (more heavy IOPS), so I guess to mount it to Linux, and rather access this Linux shared disk from windows with "map drive"? – Jozef Mar 29 at 14:38
  • You can do ISCSI, or NFS, or whatever you want. It sounds like you may want to stand up a 3rd VM solely for file serving, and then have it expose the mount however you'd like to the two other machines. – tilleyc Mar 29 at 18:52
  • Yes, you can set up Samba on the Linux to share the drive, and Windows can then mount the drive. – Tero Kilkanen Mar 29 at 19:05
  • @tilleyc Two VMs using the same iSCSI target is not an option, because file system does not have exclusive access to block device. – Tero Kilkanen Mar 29 at 19:06
  • You're right. Don't know where my brain was at with that response. – tilleyc Mar 29 at 19:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.