Possible PowerShell Command Issue

PowerShell script exchange

Possible PowerShell Command Issue

Veeam Logoby nunciate » Mon Feb 06, 2017 3:41 pm

Can I have some folks test this for me to see if it is just me or a global issue.
This is using B&R v9.5 U1. It worked in 9.0 before I upgraded.

Create 2 Tape Jobs. Assign them both to the same Standard Media Pool
Change the second job to start after the first job.

Use the following command to change the media pool to a different pool on the second job.
Tell me if your chain is now broken. It breaks the chain on all of my jobs and I have tested several times.

Set-VBRBackupToTapeJob -Job "INSERT JOB NAME" -FullBackupMediaPool "INSERT NEW MEDIA POOL NAME"
nunciate
Expert
 
Posts: 139
Liked: 23 times
Joined: Tue May 21, 2013 9:08 pm
Full Name: Alan Wells

Re: Possible PowerShell Command Issue

Veeam Logoby nunciate » Mon Feb 06, 2017 8:06 pm

I just tested this on a Dev B&R server. Same result.
The console view of the job changes so that the Next Run column only shows After {}
If you edit the job the schedule to start After this job shows the first job alphabetically in the All jobs listing.
You can change it back to the original another setting and that puts it back but will lose the setting if the command is run again.

Case # 02059900 has been submitted
nunciate
Expert
 
Posts: 139
Liked: 23 times
Joined: Tue May 21, 2013 9:08 pm
Full Name: Alan Wells

Re: Possible PowerShell Command Issue

Veeam Logoby v.Eremin » Tue Feb 07, 2017 8:47 am

I've just confirmed the experienced behaviour in my lab. We're investigating this internally, will let you know once I have more information.
v.Eremin
Veeam Software
 
Posts: 13558
Liked: 1006 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Possible PowerShell Command Issue

Veeam Logoby v.Eremin » Tue Feb 07, 2017 10:35 am

This has been tracked as a bug. We're planning to fix in Update 2. Thank you for raising this issue; appreciated.
v.Eremin
Veeam Software
 
Posts: 13558
Liked: 1006 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

[MERGED] Set tape job schedule

Veeam Logoby zuldan » Thu Feb 16, 2017 10:59 am

I'm trying to configure a tape job to run on the first Saturday of every month at 9:00PM. I'm after the following settings.

Image

I've tried the following commands. Neither of them work. Both sets run perfectly fine without any errors.

Code: Select all
$TapeMonthlyOption = New-VBRMonthlyOptions -DayOfWeek Saturday -DayNumberInMonth First -Period '21:00'
$TapeSchedule = New-VBRBackupToTapeScheduleOptions -MonthlyOptions $TapeMonthlyOption -Enabled 
$TapeJob | Set-VBRBackupToTapeJob -ScheduleOptions $TapeSchedule


and also

Code: Select all
$TapeJob | Set-VBRJobSchedule -Monthly -At '21:00' -NumberInMonth First -Days Saturday | Enable-VBRJobSchedule


Any help would be greatly appreciated. I'm using 9.5 U1.
zuldan
Enthusiast
 
Posts: 45
Liked: 5 times
Joined: Wed Feb 15, 2017 9:51 am

Set tape job to run after backup job

Veeam Logoby zuldan » Thu Feb 16, 2017 11:08 am

I'm trying to configure a tape job to run after a backup job. The commands run without any errors but I noticed in the console the "Next run" is '[]' and doesn't specify the job that it will run after. However, if I manually edit the tape job and set it to run after a backup job, "Next run" correctly shows the backup job in the console. Is there another command I'm supposed to be using to update the console?

Image

Code: Select all
$TapeSchedule = New-VBRBackupToTapeScheduleOptions -Type AfterJob -Job $Job -Enabled
$TapeJob | Set-VBRBackupToTapeJob -ScheduleOptions $TapeSchedule


Any help would be greatly appreciated. I'm using 9.5 U1.
zuldan
Enthusiast
 
Posts: 45
Liked: 5 times
Joined: Wed Feb 15, 2017 9:51 am

Re: Possible PowerShell Command Issue

Veeam Logoby v.Eremin » Sat Feb 18, 2017 11:14 am

Looks like both reported issues are related to the known problem mentioned above. Kindly, wait till Update 2 is released. Thanks.
v.Eremin
Veeam Software
 
Posts: 13558
Liked: 1006 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Possible PowerShell Command Issue

Veeam Logoby zuldan » Sat Feb 18, 2017 6:41 pm

Thanks for confirming v.Eremin. Looking forward to Update 2.
zuldan
Enthusiast
 
Posts: 45
Liked: 5 times
Joined: Wed Feb 15, 2017 9:51 am

Re: Possible PowerShell Command Issue

Veeam Logoby v.Eremin » Sun Feb 19, 2017 2:18 pm

I will most likely update this thread, once the it's released. So, stay tuned.
v.Eremin
Veeam Software
 
Posts: 13558
Liked: 1006 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Possible PowerShell Command Issue

Veeam Logoby zuldan » Tue Mar 14, 2017 4:03 am

Just something else to add to the list, looks like many of the Tape powershell cmdlets are broken.

1. -AlwaysCopyFromLatestFull in Add-VBRBackupToTapeJob does not enable "Process latest full backup chain only" on the job.

2. Set-VBRBackupToTapeJob -JobScriptOptions $ScriptOptions seems to 'reset' some scheduled options. Can't remember exactly would options would go to factory settings.
zuldan
Enthusiast
 
Posts: 45
Liked: 5 times
Joined: Wed Feb 15, 2017 9:51 am

Re: Possible PowerShell Command Issue

Veeam Logoby v.Eremin » Tue Mar 14, 2017 12:04 pm

1. -AlwaysCopyFromLatestFull in Add-VBRBackupToTapeJob does not enable "Process latest full backup chain only" on the job.

I was not able to reproduce that on 9.5 Update 1.

2. Set-VBRBackupToTapeJob -JobScriptOptions $ScriptOptions seems to 'reset' some scheduled options. Can't remember exactly would options would go to factory settings.

This issue is similar to the ones mentioned previously (Set-VBRBackupToTapeJob resets the specified schedule). It's planned to be addressed in Update 2.
v.Eremin
Veeam Software
 
Posts: 13558
Liked: 1006 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Possible PowerShell Command Issue

Veeam Logoby zuldan » Tue Mar 14, 2017 11:11 pm

Thanks for the reply v.Eremin. Regarding issues 1.

I cannot get the option enabled. Maybe it breaks when using a combination of other parameters? Here is my exact code below.

Code: Select all
Add-PSSnapin -Name VeeamPSSnapIn

$TapePool = 'Onsite Tapes'

$JobList = Get-VBRJob | Where-Object -FilterScript { $PSItem.JobTargetType -eq 'Backup' }

foreach ($Job in $JobList)
{
    if ($null -eq (Get-VBRTapeJob -Name "$TapePool - $($Job.Name)" -ErrorAction SilentlyContinue))
    {
        Write-Host -Object "`nCreating tape job: $TapePool - $($Job.Name)"
        Write-host -Object "$TapePool - $($Job.Name): Adding $($Job.Name)"

        # Create Tape Job and add backup job
        $Mediapool = Get-VBRTapeMediaPool -Name $TapePool
        $TapeJob = Add-VBRBackupToTapeJob -Name "$TapePool - $($Job.Name)" -Object $Job -FullBackupMediaPool $Mediapool -ProcessIncrementalBackup -IncrementalBackupMediaPool $Mediapool -ExportDays Friday -AlwaysCopyFromLatestFull
       
        # Configure Tape Job to start after backup job
        $TapeSchedule = New-VBRBackupToTapeScheduleOptions -Type AfterJob -Job $Job -Enabled
        $TapeJob | Set-VBRBackupToTapeJob -ScheduleOptions $TapeSchedule
    }
}
zuldan
Enthusiast
 
Posts: 45
Liked: 5 times
Joined: Wed Feb 15, 2017 9:51 am

Re: Possible PowerShell Command Issue

Veeam Logoby v.Eremin » Wed Mar 15, 2017 10:45 am

Before we dig deep into the code, can you tell what product version is in use?
v.Eremin
Veeam Software
 
Posts: 13558
Liked: 1006 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Possible PowerShell Command Issue

Veeam Logoby zuldan » Wed Mar 15, 2017 10:48 am

I'm using using 9.5 U1.
zuldan
Enthusiast
 
Posts: 45
Liked: 5 times
Joined: Wed Feb 15, 2017 9:51 am

Re: Possible PowerShell Command Issue

Veeam Logoby v.Eremin » Wed Mar 15, 2017 5:39 pm

Last call of Set-VBRBackupToTapeJob seems to erase the said setting. So, in order to be of the safe side use it along with -IncrementalBackupMediaPool parameter. Thanks.
v.Eremin
Veeam Software
 
Posts: 13558
Liked: 1006 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Next

Return to PowerShell



Who is online

Users browsing this forum: No registered users and 5 guests