VMware

This Question is Answered

4 Replies Last post: Nov 6, 2007 2:03 PM by Joel Duckworth  

Multiple linux guest OS accessing the same virtual disk partition posted: Nov 5, 2007 5:06 PM

Click to view Joel Duckworth's profile Novice 19 posts since
Oct 30, 2007

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?

Click to view uslacker99's profile Expert 275 posts since
Sep 26, 2005

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.

Click to view uslacker99's profile Expert 275 posts since
Sep 26, 2005
btw ... VMware Lab Manager does linked clones.
Click to view dwight@dwightandamy.com's profile Hot Shot 94 posts since
Mar 30, 2004
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

VMware Beta Programs

Want to be Considered for Future Beta Programs?

Learn More

VMware Developer

Download SDKs, APIs, videos,
training, and more in the Developer community.

Learn More

Developer
Sample Code

Increase your developer productivity with VMware API sample code.

Learn More

VMworld
Sessions & Labs

Online access to the latest VMworld Sessions & Labs and online services.

Learn more

Purchase PSO Credits Online

Purchase credits to redeem training and consulting services online.

Buy Now

Community Hardware Software

View reported configurations or report your own.

Learn More

Only VMware ... Delivers Nexus 1000V

Ensure consistent, policy-based network capabilities to virtual machines across your data center.

Learn More

Communities