VMware Cloud Community
sjsotelo
Contributor
Contributor

Can two VM share one virtual drive?

We are in the process of learning and converting our network to virtual machines.

I'm currently trying to figure out how to take two virtual machines that are installed on one host, that has a free physical hard drive to share it.

We have web servers that have all the web files stored on the drive, and we want our virtual servers to be able to see those files and access them.

any ideas?

0 Kudos
11 Replies
Rodos
Expert
Expert

The physical disk is formated with VMFS and can contain multiple virtual disks (VMDK files).

A virtual disk can only be attached to a single VM. You can't have both accessing it.

What you are wanting to do is share the data at an OS level. So you can allocate the disk space as a disk to one of the two machines and have the other access it over the network. Or you can use a 3rd VM as like a helper to present that space to the network, hence the other VMs at the host level. There are virtual appliances that you can download to do this.

Does that make sense?

Considering awarding points if this is of use

Rodos {size:10px}{color:gray}Consider the use of the helpful or correct buttons to award points. Blog: http://rodos.haywood.org/{color}{size}
0 Kudos
samugi
Enthusiast
Enthusiast

Yes two VM's can access the same virtual drive. But you would only want to do this if the guest OS's are running clustering such as Microsoft Clustering.

This link will tell you how to do it. http://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=http--wwwv...

If you are NOT clustering then you should NOT give more than one VM access to a drive as it will corrupt data.

0 Kudos
RParker
Immortal
Immortal

This feature is called Microsoft Clustering Services. So 2 machines CAN in fact share the same drive and vmdk. This is how 2 machines would share data for high availability.

0 Kudos
Rodos
Expert
Expert

Hey good point guys, I never thought of a local cluster. Bit of an overkill and some expensive MS licenses but yes that can be done. So many ways to skin a cat, I don't like cats.

Rodos {size:10px}{color:gray}Consider the use of the helpful or correct buttons to award points. Blog: http://rodos.haywood.org/{color}{size}
0 Kudos
sjsotelo
Contributor
Contributor

We basically we have 70gigs of web files, and we DONT want to make two virtual 70gig hard drives, we want to make one, and have both of them access it at the same time.

Maybe make one with read only permissions, and the other one full?

I don't think clustering is what we want, due to the fact that both web servers still couldn't access the files at the same time.

Thanks for the help!

-Stephen

0 Kudos
dalepa
Enthusiast
Enthusiast

There's always CIFS or NFS shares...

0 Kudos
sjsotelo
Contributor
Contributor

Interesting, I have never heard of this before. I did a google search and found some information about CIFS however im not sure how to set it up.

Any guides or info on setting up a partition to be CIFS to allow two virtual servers to share the same files would be greatly appreciated.

0 Kudos
mcowger
Immortal
Immortal

CIFS is also known as SMB, or standard windows filesharing.

--Matt

--Matt VCDX #52 blog.cowger.us
0 Kudos
esloof
Expert
Expert

Running multiple virtual machines on one VMDK

I was playing around with my VDM2/VDI setup that was still present on my laptop since my VDM2 presentation at the Dutch VMUG. I'm running Workstation 6 and have installed ESX 3.0 as a virtual machine. Within ESX 3.0 I created one base Windows XP virtual machine and added two empty virtual machines without a virtual disk. Since I created a small VMFS I placed the Windows XP virtual machine in snapshot mode and added the virtual disk from this virtual machine as an existing disk to the other two virtual machines. I added the base disk as an independed nonpersistent virtual disk so the changes of my shadow virtual machines are discarded when I power off or revert to a snapshot. Besides an IP address conflict all three machines are running fine. In the images you can see the snapshot file and the REDO files of my shadow virtual machines. This technique could same me a lot of VDI-VMDK disk space in the first place, but what about the Windows XP license, it's only installed once......

[Dutch VMUG|http://www.ntpro.nl/blog/uploads/vmdisk2.jpg]

Dutch VMUG

[Dutch VMUG|http://www.ntpro.nl/blog/uploads/vmdisk1.jpg][Dutch VMUG|http://www.ntpro.nl/blog/uploads/vmdisk2.jpg]

[Dutch VMUG|http://www.ntpro.nl/blog/uploads/vmdisk3.jpg]

Dutch VMUG

Dutch VMUG

0 Kudos
TomHowarth
Leadership
Leadership

h6. Running multiple virtual machines on one VMDK

I was playing around with my VDM2/VDI setup that was still present on my laptop since my VDM2 presentation at the Dutch VMUG. I'm running Workstation 6 and have installed ESX 3.0 as a virtual machine. Within ESX 3.0 I created one base Windows XP virtual machine and added two empty virtual machines without a virtual disk. Since I created a small VMFS I placed the Windows XP virtual machine in snapshot mode and added the virtual disk from this virtual machine as an existing disk to the other two virtual machines. I added the base disk as an independed nonpersistent virtual disk so the changes of my shadow virtual machines are discarded when I power off or revert to a snapshot. Besides an IP address conflict all three machines are running fine. In the images you can see the snapshot file and the REDO files of my shadow virtual machines. This technique could same me a lot of VDI-VMDK disk space in the first place,

Very interesting, have you grown this further than the three guests, and have you measured performace I would be interested in any infomation you have on this.

>but what about the Windows XP license, it's only installed once......

Don't thnk the Lawyers at M$ will agree with your point of view there :smileygrin:

Tom Howarth

VMware Communities User Moderator

Tom Howarth VCP / VCAP / vExpert
VMware Communities User Moderator
Blog: http://www.planetvm.net
Contributing author on VMware vSphere and Virtual Infrastructure Security: Securing ESX and the Virtual Environment
Contributing author on VCP VMware Certified Professional on VSphere 4 Study Guide: Exam VCP-410
0 Kudos
esloof
Expert
Expert

The VMFS performance will drop a little bit with a large number of VM's running on one VMDK because the growing REDO files are causing SCSI lock's on the entire VMFS. The maximum number is around 16 I think.

0 Kudos