VMware Solutions Discussions

Running scripts in VSC-BackupJOB (4.2 & 5.0)

PHILIP_SONNTAG
3,040 Views

Hello,

i have to shutdown a vm in a customers environment, when the backup is running. The Workflow:

BackupJob Start:

1. Script will Shutdown VM

2. Script will wait 30 seconds (giving VM enough time to shutdown)

3. VSC will take snapshot

4. Script will Start VM.

I built following Script:

if %BACKUP_PHASE% == PRE_BACKUP goto PRE

if %BACKUP_PHASE% == POST_BACKUP goto POST

goto END

:PRE

C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -PSConsoleFile "C:\Program Files\VMware\Infrastructure\vSphere PowerCLI\vim.psc1" -Command "Connect-VIServer -Server 192.168.11.90; Get-Vm -Name "My-VM" | Shutdown-VMGuest -Confirm:$false"

timeout /T 30

goto END

:POS

C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -PSConsoleFile "C:\Program Files\VMware\Infrastructure\vSphere PowerCLI\vim.psc1" -Command "Connect-VIServer -Server 192.168.11.90; Get-Vm -Name "My-VM" | Start-vm"

goto END

:END

I save the script C:\Program Files\NetApp\Virtual Storage Console\smvi\server\scripts and selected it in my BackupJob. But it did not work. It seems that VirtualStorage Console is ignoring the script. No error message. Nothing. The BackupJob is successful, but VM is not in shutdown state...

Anyone ideas or tips?

0 REPLIES 0
Public