views:

466

answers:

4

I have a Linux server at home that runs VMWare Server. I have one virtual machine for my web server, another for my zimbra server, another for my mysql server, and another that runs windows xp for testing.

My problem is where to store the data. Web files, email files, mysql, etc?

Which of these scenarios are the best?

  • Each virtual machine stores it's own data on it's own virtual hard disk
  • Create a new virtual machine for data storage and use Samba or NFS to share
  • Use Samba or NFS on the host machine to share the data
  • something else i haven't thought of yet

I know that storing Mysql data files remotely via NFS or Samba is a bad thing but I would like to keep my data consolidated together. (Or maybe i'm on crack for thinking that)

Anyway, please set me straight! Thanks.

A: 

It's really up to you (subject to the performance considerations you've already mentioned). Since you're virtualizing to compartmentalize applications, it's going to come down to what you want.

If you want easier management, put the data on the same VM as the application(s) that use it.

If you want more granular backup, put the data in a separate vm, or a separate VHD on the same VM, and back those up differently to the application VMs.

If you want to learn about SMB/NFS, or you expect remote clients to want access to the data with little configuration change on your part, put the data on the network that way.

The great thing about virtualization is that you could try it each way and see which you like best!

DDaviesBrackett
+2  A: 

Why do you want to move data off the VMs? Also, how much of the data is truly shared data? If you want to move it off so it is backed up somewhere, then create separate backup scripts/protocols for each machine. Backing up MySQL data is much different from backing up Windows files.

If the data truly is shared, then I would:

  • use Samba/NFS for everything but MySQL data and have the data stored on the host machine or another real machine.
  • put the database on a separate real machine and simply link the other machines into it (I might also look at setting up a backup script for the DB)
Chris Johnston
A: 

You will be best off storing the data on the virtual hard disk. Then you don't have to worry about NFS issues and keeping another moving part in good working condition.

Mark Harrison
+1  A: 

The real best answer really depends on what you need the data for and how important it is. I usually keep all system data for my VM's with the virtual machine. The real important stuff goes into a persistent drive, this is a VM drive which isn't affected by snapshots. I don't know how many times I have lost information because of snapshots.

All of my testing/development VM's reside on dedicated USB hard disk. I have found this extremely handy because I can move them easily to any other machine runing vm server.

If you use NFS, the file server always has to be running for your other VM's to relying on it to work. Seems a little cumbersome to me.

Brettski