Hi there,
im looking for a nice solution to backup our VM environment. First: The solution should be at no cost. I know that there are products like vranger and so on, but there is no budget for something like that...
First: I tried VMWare Data Recovery. Is a nice tool but i have some "problems" with it:
- I havent found any way to send mail notifications. I found that there is a operations_log.utx file under /var/vmware/datarecovery in the data recovery VM. Has anyone tried to export and edit this file and send as a email-report or something like this? This would be nice, so i don't have to look every day in the "Data Recovery" Tab if the backups are successful...
So i started to script something with VCB.
My goal is to get a script which can backup machines from any host connected to Virtual Center. The script should be a batch script because of that other administrators understand what i've scripted. At this time my script creates per task a backup of all virtual disks connected to the vm over lan to a backupshare.
What i want to have:
- I want to have a backuphistory. I set the maximum backup time to hold backups into a variable. Then every time a backuptask runs the backupfolders will be renamed (backup1 will be backup2, backup2 will be backup3 and so on) and the backupfolder with the name of the "hold backups" value should be deleted. So i get a history... Anyone experience with this?
- Then i would write what my script is doing into a logfile which should be send per email with blat.exe. Here i need a opportunity to create logfiles with virtualmachinename and date in the dataname and an opportunity to delete logifles after a defined timeframe.
REM *********************
REM * Backupjob XP *
REM *********************
REM Laufwerks- und Pfadvariablen werden gesetzt...
set RootLaufwerk=C:
set BackupLaufwerk=Q:
set Backupshare=\\fileserver\VCB
REM Allgemeine Variablen werden gesetzt...
set vcserver=vc.testdom01.local
set user=vcbuser
set pass=vcbuser
set vcbpath=%ProgramFiles%\Vmware\Vmware Consolidated Backup Framework
REM Variablen der zu sichernden VM werden gesetzt...
set vmname=XP
set moref=vm-304
set backupfolder=%vmname%
REM Backuplaufwerk wird verbunden...
net use %BackupLaufwerk% %Backupshare%
sleep 5
REM Bereinigung der alten Backups...
%BackupLaufwerk%
if not exist %backupfolder% goto backup
rd /s /q %backupfolder%
goto backup
REM Durchführung des Backups...
:backup
%RootLaufwerk%
sleep 5
"%vcbpath%\vcbmounter" -h %vcserver% -u %user% -p %pass% -a moref:%moref% -r %BackupLaufwerk%\%backupfolder% -t fullvm -M 0 -F 0 -m nbd -L 4
%RootLaufwerk%
sleep 5
REM Backuplaufwerk wird getrennt..
net use %BackupLaufwerk% /delete
REM Backupjob beeendet.