Server Virtualization

For complex topics that regular users would not be interested in. For power users and database administrators.
Post Reply
bpcomp
Posts: 304
Joined: Mon Feb 27, 2012 7:30 am
Location: Tucson, AZ
Contact:

Server Virtualization

Post by bpcomp » Thu Aug 30, 2012 8:24 am

We have decided to do some virtualization in our office. I decided to go with Linux for the host and Server 2008 for the guest operating system. I know I could do bare metal virtualization, but I decided not to because of cost issues and more importantly complexity. It is easier to teach someone else how to open a gui and recover if there is a disaster IMO.

I am still in the testing stage and this is not fully implemented but we are getting closer to deploying this scenario with confidence.

So for our situation I have two computers. One which is the main server and a second which serves two main functions. The second computer hosts all our videos and plays them on the TV in the kids room so that we are not constantly having to switch discs and navigate through menus trying to keep the movie playing. The second function it performs is to be a backup target for the first machine. Both computers run Linux as their primary or host operating system. On the primary server I have VMware Workstation 8 which has a virtual server 2008 installed. That server 2008 copy is our primary domain controller as well as DNS and DHCP. It also serves our files and applications. (OpenDental and Imaging)

The virtual server 2008 is cloned every night to the backup/video server. If there is any major failure on the primary server I can shut that computer down and boot up the server on the backup machine using VMware player and have our office back online probably within 5 to 10 minutes. All computers on the domain will see the virtual machine at the new location and talk to it without having to do any reconfiguration, at most we reboot the workstations. I scoured the internet for how to backup the VM with a script and everything I found had either been bought by a company or it was very old and did not work. Not having the skill to troubleshoot these more advanced scripts I wrote some of my own to do the job.

The first script is the nightly backup script http://pastebin.com/ZNGW992a. All paths are hardcoded and if you use it in your environment you will need to update to your own paths. Every night the server is fully cloned to the backup server over the network and the backup is put in a folder for the day it was created. An example path is /backup/daily/20120830. A log file is written to /backup/logs/20120830.log which keeps track of when stuff happened so you know how long your backup takes to run.

The second script I wrote monitors the /backup/daily folder and runs every day looking for folders that are 7 days old and then it removes them. http://pastebin.com/Yuz0LQTg

The third script runs only on thursdays and after the server has backed up, copies the days backup into a weekly folder. http://pastebin.com/RsBVTuVm

The fourth script cleans the weekly folder and only keeps files newer than 28 days (4 weeks) http://pastebin.com/kjw96Evc

Here is the crontab entry that makes all of this work on schedule.

# At 8:45 PM on thursdays, run the weekly clean script.
45 20 * * 5 /backup/scripts/weekly_clean_old_backup

# At 9 PM on mon-fri run the daily clean script.
* 21 * * 2,3,4,5,6 /backup/scripts/daily_clean_old_backup

# At 9:15 PM on mon-fri run the daily backup script.
15 21 * * 2,3,4,5,6 /backup/scripts/nightly_backup

# At 11:30 on thursdays, run the weekly copy script.
30 23 * * 5 /backup/scripts/weekly_copy


So at the end of all this I have a full bootable virtual server that can be run from practically any machine in the office and I have every work day for the last week and once a week for the last month.

Our second backup runs inside of the virtual machine with Symantec Backup Exec System Recovery and makes a full backup to a set of portable drives which rotate out of the office.

User avatar
drtech
Posts: 1647
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Server Virtualization

Post by drtech » Thu Aug 30, 2012 11:55 am

nice work
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

Post Reply