VMware Cloud Community
tropix
Hot Shot
Hot Shot

how to configure VCB to do backup each VM at a time (VCB+TSM)

hi all.

on my dsm.opt I have this lines:

PRESCHEDULECMD "pres.bat"

POSTSCHEDULECMD "post.bat"

Inside pres.bat I have: pre-command.bat job1 vm1 vm2 vm3

Inside post.bat I have: post-command job1

So, all vm snapshot are made at same time.

Has a way to do snapshot and remove snapshot one vm at a time? I like to do this because I have no more space on VMFS volumes.

Regards,

Eduardo

If you found this information useful, please consider awarding points for "Correct" or "Helpful".
Reply
0 Kudos
4 Replies
tropix
Hot Shot
Hot Shot

ok

If you found this information useful, please consider awarding points for "Correct" or "Helpful".
Reply
0 Kudos
francisbandi
Enthusiast
Enthusiast

Ed

I am also working on this.. and using pre-command.vbs so that I can use a text file to pass the vM data.

did any one answered privately for this question.

I do have some issue around using TSM with VCB..

in my case post command runs before the pre command completes.

Now I am trying to create another batch files as u specified and going to test..

Can i PM u

Reply
0 Kudos
Sourcery
Contributor
Contributor

Hello,

Why not make multiple command files and schedule them with scheduled task? I havent started working with CB yet, just starting to find out how it works, so maybe my idea wont work?

/Kristian

Reply
0 Kudos
Peaceman
Contributor
Contributor

We did it in the following way:

vmtask.ini[/b]

# Comments

task1=vm1.domain.com-FullVM vm2.domain.com-FullVM

\# Comments

task2=vm3.domain.com-FullVM vm4.domain.com-FullVM

\# Comments

task3=vm7.domain.com-FullVM vm8.domain.com-FullVM[/i]

When TSM Sheduler starts the first time the 'pre-command.bat' script gets the parameters from the task1 line, the second time from the task2 line e.t.c

See pre.bat[/b] and post.bat[/b] bellow.

status.ini[/b]

# This file is auto-generated by post.bat script.

\# NEXTSTEP parameter points to the appropriate TSH Scheduler for the VCB

NEXTSTEP=1[/i]

This file auto-generated and contains current step, post.bat increments NEXTSTEP parameter each time.

pre.bat[/b]

@echo off

setlocal enabledelayedexpansion

call :read_settings status.ini || set NEXTSTEP=1

call :read_settings vmtask.ini || exit /b 1

if "!task%NEXTSTEP%!" == "" (

echo FAIL: Variable 'task%NEXTSTEP%' is not defined in the 'vmtask.ini' config file.

exit /b 1

)

call "%VCBBASE%\tsm\pre-command.bat" job%NEXTSTEP% \!task%NEXTSTEP%!

exit /b 0

:read_settings

set SETTINGSFILE=%1

If not exist %SETTINGSFILE% (

echo FAIL: Can not find file with setting

exit /b 1

)

for /f "eol=# delims== tokens=1,2" %%i in (%SETTINGSFILE%) do (

set %%i=%%j

)

exit /b 0[/i]

post.bat[/b]

@echo off

setlocal enabledelayedexpansion

SET STATUSFILE=status.ini

call :read_settings status.ini || set NEXTSTEP=1

call :read_settings vmtask.ini

call "%VCBBASE%\tsm\post-command.bat" job%NEXTSTEP%

set /a NEXTSTEP=NEXTSTEP+1

if "!task%NEXTSTEP%!" == "" (

set NEXTSTEP=1

)

echo # This file is auto-generated by post.bat script.>%STATUSFILE%

echo # NEXTSTEP parameter points to the appropriate TSH Scheduler for the VCB>>%STATUSFILE%

echo NEXTSTEP=!NEXTSTEP!>>%STATUSFILE%

exit /b 0

:read_settings

set SETTINGSFILE=%1

If not exist %SETTINGSFILE% (

echo FAIL: Can not find file with setting

exit /b 1

)

for /f "eol=# delims== tokens=1,2" %%i in (%SETTINGSFILE%) do (

set %%i=%%j

)

exit /b 0[/i]

So dsm.opt file should contain the following line:

PRESCHEDULECMD "pre.bat"

POSTSCHEDULECMD "post.bat"

Reply
0 Kudos