Comprehensive data protection for all workloads
Post Reply
JeWe
Enthusiast
Posts: 72
Liked: 9 times
Joined: Mar 04, 2013 2:41 pm
Contact:

Script after backup job - Won't work

Post by JeWe »

Hi,

we got several Linux VMs to backup. For the sake of data consistency, I shut down each VM before backing up via cron. After the VM is backed up, I want to use a powershell-script to power them on again.

Two HyperV servers, HV01 and HV02. The console is installed at HV02, starting up the HV02-Linux-VMs work, starting up the HV01-Linux-VMs won't. The startup script itself works, if I power down the VM and execute the script from HV02, VM gets started.

On HV01, there's for example the VM Linux01. Linux01 is powered off, backup starts and finishes without errors. Unfortunately the VM stays powered off and won't get started.

Script "D:\vm-scripts\vm-start_HV01.cmd" looks like this:
C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -Noninteractive -File "D:\vm-scripts\vm-start_HV01.ps1"

"D:\vm-scripts\vm-start_HV01.ps1" looks like this:
Invoke-Command –ComputerName HV01 –ScriptBlock{start-vm Linux01}

In the log for this backup job, I see this:
Running post-job script
Executing custom command [D:\vm-scripts\vm-start_HV01.cmd], arguments []
Post-job script completed successfully

Any hints?

Regards,
Jens
csydas
Expert
Posts: 193
Liked: 47 times
Joined: Jan 16, 2018 5:14 pm
Full Name: Harvey Carel
Contact:

Re: Script after backup job - Won't work

Post by csydas »

Jens,

Where are these scripts located? The CMD and the PS1 script, that is.

Also, why not just point it right at the powershell script? I would think it works just fine without having to invoke -noninteractive and -file.
JeWe
Enthusiast
Posts: 72
Liked: 9 times
Joined: Mar 04, 2013 2:41 pm
Contact:

Re: Script after backup job - Won't work

Post by JeWe »

Hi csydas,

thanks for your response.

I tried both, keeping the script in the exact location at HV01 and HV02. BTW, which one will be used?

Pointing it directly to the .ps1 won't also work. Anyway, thanks for the hint, didn't see the checkbox to choose .ps1
csydas
Expert
Posts: 193
Liked: 47 times
Joined: Jan 16, 2018 5:14 pm
Full Name: Harvey Carel
Contact:

Re: Script after backup job - Won't work

Post by csydas »

Sure, always happy to try :)

I like reducing complexity, so in my mind, 1 less script means 1 less point of failure, and I don't think you need both to make it work.

Is the account you run the job with high-enough level to succeed? I think it'll run as the account that the Job does, so logically it should, but I've seen such things before where non-system accounts for the Veeam services didn't have proper permissions.
JeWe
Enthusiast
Posts: 72
Liked: 9 times
Joined: Mar 04, 2013 2:41 pm
Contact:

Re: Script after backup job - Won't work

Post by JeWe »

Hi,

spent some time with doing other things, opening a ticket... Unfortunately, they tell me, scripts are not supported, so they can't help me. Quite understandable, nevertheless I'm a bit frustrated.

Csydas, the account running the job is high level enough, I tested even with domain admin credentials. No luck. Other things like putting a new folder on desktop works, but not starting the remote VM.
Post Reply

Who is online

Users browsing this forum: No registered users and 64 guests