PowerShell script exchange
Post Reply
SYildiz

Shutdown Backup Proxy after backup job

Post by SYildiz »

Hi to all of you,

I'm new here and first of all I just wanna say hello - my name is Serkan and I'm a system engineer. so far so good.

I have written a PS1 script (in combination with a bat-file) which is able to shutdown a vm.
The script works as I opened it with the BackAdmin user in CMD but as a post-job script it ends up with a "time out".

Maybe some of you could help?!

The scripts:
stop_bvm02.bat:

Code: Select all

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noe -c ". \"C:\Program Files (x86)\VMware\Infrastructure\PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1\" $true; . \"C:\Scripts\stop_bvm02.ps1\""
exit /b 0
stop_bvm02.ps1:

Code: Select all

$vCenter = "XXXXXX"
$User = "XXXXXXXX"
$Password = "XXXXXXX"
$VM = "bvm02"

Write-Output "Connect vCenter..."
Connect-VIServer -Server $vCenter -Protocol https -User $User -Password $Password

Write-Output "stop bvm02"
stop-vm -vm $VM -Confirm:$false

Write-Output "Disconnect vCenter..."
Disconnect-VIServer -Server $vCenter -Confirm:$false
exit
The idea was to reduce the ressource (CPU & RAM) and shutdown the backup proxies after the backup job is finished.
Is this possible? Or have some of you any other ideas?

Thank you in advance!

Best reguards,

Serkan
SYildiz

Re: Shutdown Backup Proxy after backup job

Post by SYildiz »

Code: Select all

[04.03.2019 10:08:50] <01> Info     [BackupJobPostActivity] JobSession 'xxxxxxxxxxxxxxx PostActivity: 'AskService'
[04.03.2019 10:08:50] <01> Info     [BackupJobPostActivity] Session result is Failed. Checking if it is last retry
[04.03.2019 10:08:50] <01> Info     [BackupJobPostActivity] wouldBeRetried: 'False'. Need post activity: 'True'
[04.03.2019 10:08:50] <01> Info     [JobState] Updating JobState: [JobId: xxxxxxxx. ScriptCommandRunCount: 0]
[04.03.2019 10:08:50] <01> Info     Running post-job script
[04.03.2019 10:08:50] <01> Info     Executing custom command [C:\Scripts\stop_bvm02.bat], arguments []
[04.03.2019 10:14:22] <38> Info     Removing xxxxxxx:veeam@xxxxxxxxx:False::0:1 from cache. Reason: Expired
[04.03.2019 10:14:22] <38> Info     [Soap] Logout from "https://xxxxxxxxxxxxx/sdk"
[04.03.2019 10:14:37] <38> Info     Server thumbprint: xxxxxxxxxxxxxxxx
[04.03.2019 10:23:50] <01> Warning  Post-job script timed out
[04.03.2019 10:23:50] <01> Warning  Post-job script timed out
SYildiz

Re: Shutdown Backup Proxy after backup job

Post by SYildiz »

When I select the "stop_bvm02.ps1" as a post-job script it ends up with

Code: Select all

 04.03.2019 11:45:06 :: Post-job script terminated with exit code 1 
"
brichardson1991_obk
Expert
Posts: 114
Liked: 8 times
Joined: Aug 20, 2015 2:20 pm
Full Name: Ben Richardson
Contact:

Re: Shutdown Backup Proxy after backup job

Post by brichardson1991_obk »

Your proxy shouldn't be doing anything once the backup job has finished. Personally I would leave it switched on as it will be less hassle to keep switching it on and off.
AlexandreD
Service Provider
Posts: 42
Liked: 2 times
Joined: Jan 22, 2019 4:21 pm
Full Name: ALEXANDRE D
Location: Reims, France
Contact:

Re: Shutdown Backup Proxy after backup job

Post by AlexandreD »

Hi,

I'm asking myself about shutdown proxy after backup job.
I have multiple VM Proxy in my infrastructure, around 30 (one per ESXi).
Each proxy can execute 8 simultaneous tasks, with each one 8vCPU allocate in the VM.

I'm trying to identify CPU ready issue on the esxi, even if proxy do "nothing" after the backup job, there is 8 CPU allocate, ready to use.
Does this really have any impact on vmware performance ? what is your opinion on this ?

thank you
Alexandre
oleg.feoktistov
Veeam Software
Posts: 1918
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Shutdown Backup Proxy after backup job

Post by oleg.feoktistov »

Hi Alexandre,
Does this really have any impact on vmware performance?
I assume it depends on your oversubscription ratio (if you have one) and some other factors like VM/Resource Pool CPU usage limitations and reservations.
I'd check for values of these first.

Thanks,
Oleg
Post Reply

Who is online

Users browsing this forum: kcctech1 and 16 guests