VMware Cloud Community
Joel_Duckworth
Contributor
Contributor
Jump to solution

Multiple linux guest OS accessing the same virtual disk partition

Hi I'm wondering if anyone has tried something similar to this setup and can recommend if it is a good or bad idea:

To keep the size of our Linux server template to a minimum, and to reduce the risk of /var/log & /home filling up the disk, we're thinking of creating a large virtual disk with a single Linux ext3 partition on it that is added/shared to all the guest machines. All of the machines would mount the partition as follows

/etc/fstab:

/dev/sdc1 /mnt/shared ext3 defaults 0 2

/mnt/shared/hostname/log /var/log none bind

/mnt/shared/home /home none bind

So as you can see, the disk is mounted in /mnt/shared and then the /var/log is stored individually per server in a folder and /home is shared across all the servers. This would allow us to keep a very small base image and just create a new folder on the shared disk when we make a clone. Also as we have custom applications logging to /var/log it will enable us to backup all the log data very easily (handy for compliance requirements too)

But what I want to know is if this a dangerous setup? Is it bad practice to mount the same partition as R/W on multiple servers?

0 Kudos
1 Solution

Accepted Solutions
dwight
Enthusiast
Enthusiast
Jump to solution

ext3 isn't designed to be mounted by more than one host. Since the host caches significant parts of the filesystem information in memory it is possible for one host to change something on disk while another host has old information in it's cache.

If you want a shared filesystem the easiest way to do it is use nfs. If you happen to be using NAS for your storage on the ESX you could just export the shared space as a shared volume and mount it on all the hosts. Otherwise it's fairly easy to make a small Linux VM that acts as a NFS server for the shared data.

Another option depending on the Linux you are using would be to use GFS. I have never used GFS under VMware but since it needs to directly talk to the scsi devices I imagine it would require a raw device mapping to function at all.

RHCE, VCP

RHCE, VCP Blog: http://computing.dwighthubbard.info

View solution in original post

0 Kudos
4 Replies
uslacker99
Expert
Expert
Jump to solution

EXT3 isn't a filesystem designed to be mounted in more than 1 place. A couple of ways you might want to think about this is

1) Use syslog to write to 1 box and not locally.

2) Use NFS mounting for /var/log (not /var)

I think those are better ideas.

Another way to save space is to use linked clones - you can google this and see if you can find out how to do that. That's how I was able to deploy 50 servers for testing in like 5 minutes and then spend the rest of the day reconfiguring them rather than spend most of my time doing installs.

uslacker99
Expert
Expert
Jump to solution

btw ... VMware Lab Manager does linked clones.

dwight
Enthusiast
Enthusiast
Jump to solution

ext3 isn't designed to be mounted by more than one host. Since the host caches significant parts of the filesystem information in memory it is possible for one host to change something on disk while another host has old information in it's cache.

If you want a shared filesystem the easiest way to do it is use nfs. If you happen to be using NAS for your storage on the ESX you could just export the shared space as a shared volume and mount it on all the hosts. Otherwise it's fairly easy to make a small Linux VM that acts as a NFS server for the shared data.

Another option depending on the Linux you are using would be to use GFS. I have never used GFS under VMware but since it needs to directly talk to the scsi devices I imagine it would require a raw device mapping to function at all.

RHCE, VCP

RHCE, VCP Blog: http://computing.dwighthubbard.info
0 Kudos
Joel_Duckworth
Contributor
Contributor
Jump to solution

Great info! I'm glad I asked!

Thank you.

0 Kudos