A lot of you out there are VMware admins like me right? How many of you know about VMware's really awesome backup appliance called VMware Data Recovery? How many of you know that it backs up full VM's directly from within vSphere, and stores them using deduplication? Now answer me how many of you don't use it because it only backs up to disk, and not to tape?
I'm sure there are quite a few of you out there still using VCB, or something similar to backup full VMs, as well as send them offsite using tape because you can't get that with VMware Data Recovery. Hell, some of you probably use both. VMware Data Recovery for fast restores, and VCB to get offsite. Well, now you can stop using both, and just use VMware Data Recovery.
Here's what you do:
- On you VMware Data Recovery Server create a new /etc/crontab file using your favorite text editor. I like nano. For example:
- Paste in the following:
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
# Weekly VMware Tarball
0 5 * * 0 root /root/vmwareback.sh
- Restart the Cron service:
- Create a script in /root called vmwareback.sh
- Paste in the following:
- Make the script executable:
#chmod +x vmwareback.sh
The above options creates a weekly tarball of the /SCSI-0:1/VMwareDataRecovery directory with the data appended to it every Monday at 5:00am. I'll let you Google how to change the date and time options for Cron on your own. I do mine on Monday because VMware Data recovery runs all weekend, and I want to get the weekend's backups off site by Wednesday.
Hint: NTBackup in Windows 2003 and below has the ability to backup to tape. If all you need to do it backup your VMware environment, this may be a completely free solution for you.
- Once WinSCP is installed, create a folder for your scripts, and place to store the tarball we created in the previous steps. I put mine in E:\vmware. To keep things simple, I copied my WinSCP.exe program from C:\Program Files (x86)\WinSCP to E:\vmware.
- Create two batch files. One called VMware.cmd and the other called WinSCP.cmd.
- In VMware.cmd paste the following:
option batch on
option confirm off
option transfer binary
- In WinSCP.cmd paste the following:
winscp.exe /console /script=e:\vmware\vmware.cmd
- Now add a scheduled task in WIndows to run your WinSCP.cmd script once a week one day after your Cron job on the VMware Data Recovery server runs and it will automatically go out, grab the tarball to e:\vmware then delete it from the server.
Once your tarball is on your Windows backup server, you can then back it up to tape! To restore it later, all you have to do is setup a new VMware Data Recovery Server. Create a LUN on your SAN, and format it with ext3, then copy your tarball to the LUN. Extract the tarball with the following:
tar –xzvf *.tgz
Which should create a VMwareDataRecovery folder on the root of that LUN. Now mount that LUN to VMware Data Recovery. VMware Data Recovery should now rescan it, and be able to see your old backups.
If you're a corporate user that's interested in backing up an entire network, you can take a look at some of the solutions for VMware at Dell.com that include data center services.
Did this work for you? Did it not? Do you do it a different way? Let us know in the comments!