Luis8472
Contributor
Contributor

Sharing Files Amoungst Multiple VMs in ESX 3.5

Jump to solution

I/we need to share files amongst multiple VMs. I am finding that I am sort of stuck between the fact that ESX doesn't support NTFS and nothing but ESX supports VMFS. Ideally, what I would like is to have is a shared NTFS volume/share DataStore accessible to all VM running Windows server 2003 or 2008 that has direct access, i.e. not going over the network, as this will decrease performance. A shared VMFS DataStore would work, but natively Windows will not see the VMFS volume.

Any suggestions?

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
kjb007
Immortal
Immortal

Without a clustering technology, it is not practical to share a volume between multiple vm's. Since each vm will think the disk is owned by them, it will not recognize changes made by any other vm. For instance, if vmA and vmB are sharing a disk, and they both start at the same time, they are both aware of the same data on that disk. If after booting, vmA writes a folder called test to the disk, vmB will not see that change because it was not made by that vm. If vmB now writes a folder called test to that same disk, now you're in trouble. vmA and vmB both wrote a folder called test to the same disk. So, no new files are seen by the other vm. If you are not going to change any data on the disk, then you will be fine, for the most part. If you try to write , then you will risk data corruption.

-KjB

VMware vExpert

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB

View solution in original post

0 Kudos
12 Replies
kjb007
Immortal
Immortal

Without a clustering technology, it is not practical to share a volume between multiple vm's. Since each vm will think the disk is owned by them, it will not recognize changes made by any other vm. For instance, if vmA and vmB are sharing a disk, and they both start at the same time, they are both aware of the same data on that disk. If after booting, vmA writes a folder called test to the disk, vmB will not see that change because it was not made by that vm. If vmB now writes a folder called test to that same disk, now you're in trouble. vmA and vmB both wrote a folder called test to the same disk. So, no new files are seen by the other vm. If you are not going to change any data on the disk, then you will be fine, for the most part. If you try to write , then you will risk data corruption.

-KjB

VMware vExpert

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB

View solution in original post

0 Kudos
AllBlack
Expert
Expert

That's what file servers are for. Create a CIFS share on a dedicated file server and map to that share from other servers as needed.

Otherwise you will have to look at clustering as KjB stated

Please consider marking my answer as helpful or correct even if its completely wrong Smiley Wink

Please consider marking my answer as "helpful" or "correct"
Luis8472
Contributor
Contributor

Thank you very much KjB & AllBlack for confirming the options. This saves a lot of time!

I will look at the pros and cons associated with implementing a cluster for the share and weigh that against accessing the data across the network via a network share.

0 Kudos
RParker
Immortal
Immortal

Any suggestions?

Yes setup a VM that allocates ALL available space on an ESX host. That VM will now become a file server. That file server can be the central repository for all your other VM's.

You can't share vmfs but you CAN share a VM NTFS volume.

0 Kudos
Luis8472
Contributor
Contributor

RParker

Nice suggestion for a workaround. This seems like a very simple elegent solution! I will definitly consider it!

Thanks!

0 Kudos
kjb007
Immortal
Immortal

Please see above about sharing vm disk. The disk in question that I posted earlier is a vm ntfs disk. You can not share a read-write disk among multiple OS's without a clustering solution without risking data corruption as mentioned above.

-KjB

VMware vExpert

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB
Luis8472
Contributor
Contributor

KjB

You are correct in that RParker’s idea of dedicating one VM as the file server goes back to the problem of the disk wanting to give exclusive access to one VM only. Based on this, it sounds like what I could

do, is define a guideline reinforced by NTFS permissions that would limit the non-file server VMs to Read access only and assure that all changes/Writes are made through the file server VM only. Would this work?

0 Kudos
kjb007
Immortal
Immortal

The problem is that everytime you update your files on the file server, you would either need to reboot the servers also mounting that same drive, or you have to go into disk manager, and remove the drive letter to that disk, and reapply it. There was a post where a user used this idea and wrote a script for it, see here: http://communities.vmware.com/message/908676#908676. And, you would have to set permissions on each system itself to keep it from trying to write to that location. Use at your own risk.

The alternative would be simple SMB/CIFS file share/mapped drive as already mentioned above.

-KjB

VMware vExpert

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB
0 Kudos
RParker
Immortal
Immortal

You are correct in that RParker’s idea of dedicating one VM as the file server goes back to the problem of the disk wanting to give exclusive access to one VM only.

First I didn't say anything about sharing a VM. I am saying that if you take a physical box and share it out to OTHER machines on the network, the internal guest OS controls access to those files. That's the same idea, you take a VM, you make it exclusive to the VMFS on that 1 ESX host. What's the difference?

Before you answer, we are doing this now, 100 VM's all over the network, sharing files and data on this 1 VM (which is Windows 2003 BTW) and we have no issues. No performance problems (since it's just a file share).

So this won't corrupt the data or do anything of the sort. It's a file share based on the same principle as using a physical server to do the same thing.

0 Kudos
Luis8472
Contributor
Contributor

Thanks for the clarifications.

0 Kudos
kcollo
Contributor
Contributor

Yeah, I would avoid clustering any filesystems if at all possible between VMs. Especially windows. The fastest / easiest solution would most likely be a dedicated windows VM with a larger VMDK disk. Use this dedicated windows vm as a CIFS (windows file sharing) server. To avoild traversing outside of the software switch inside of vmware, just setup a virtual switch with no external network interface. Add another network adpater (virtual) to each of the VMs you want to access the fileserver onto the new private virtual switch. This will work fine if all vms are in the same esx server. If not, create the new virtual switch in vmware. Have the network shop vlan you off an external port on each esx server, and map those indiviual ports in each ESX host to the new private switch. So this is really easy if you only have 1 esx host. But just a little more difficult if you have multiple. At least vlaning would provide a basic level of detachment for the shared data from the regular network.

Kevin Goodman

kevin@colovirt.com

http://blog.colovirt.com

0 Kudos
paradoxxaz
Enthusiast
Enthusiast

I agree with the fileserver thought. Just create a new VM as a FS. Map drives from the other vm's....

0 Kudos