Host-based backup of VMware vSphere VMs.
Post Reply
oliverL
Enthusiast
Posts: 82
Liked: 11 times
Joined: Nov 11, 2016 8:56 am
Full Name: Oliver
Contact:

powershell-pre and post-scripts

Post by oliverL »

Hi there!

so - i'm using a pretty... unsupported lab here :-)

6.7 U1 vCenter with ESXi on 6.7 U1.

For one VM i enabled HW-Passtrough to put a GPU and USB-Controller trough it (using this ESXi as a Workstation :P ). Ofcourse i can't snapshot a VM to which i passtrough stuff. Therefore i need to shut it down and afterwards reboot the whole ESXi or else i can't start the workstation VM due to the GPU Passtrough.

So i decided to create two Powershell Scripts and imported the following into my powershell profile under my veeam service account:

Code: Select all

Write-Host "Hello my friend, come in and listen for a while...."
Import-Module VMware.PowerCLI
Connect-VIServer vcsa-01.lab.local
I've also created a VICredentialStoreItem for the veeam service account, so that i don't need to use passwords in scripts.

my pre-job script contains the following:

Code: Select all

Connect-VIServer vcsa-01.lab.local
get-vm ol-workstation | stop-vm -Confirm $false
but the Veeam Job doesn't seem to execute the script because it is staying in "Running Pre-Job Scripts" (15 Minutes seems to be the timeout... - can you change the timeout-values for testing?)

the same with my reboot skript.

Is there something missing or should i load the whole stuff in each script and not in the powershell profile variable?
Andreas Neufert
VP, Product Management
Posts: 7076
Liked: 1510 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: powershell-pre and post-scripts

Post by Andreas Neufert »

Hi Oliver, thanks for the request.
Please find the registry values that you have to implement on the Backup Server. Afterwards please restart the "Veeam Backup Service".


HKEY_LOCAL_MACHINE\SOFTWARE\Veeam\Veeam Backup and Replication\

PreJobScriptTimeoutSec
Type: REG_DWORD
Default value: 15 * 60

PostJobScriptTimeoutSec
Type: REG_DWORD
Default value: 15 * 60
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 61 guests