Discussions related to exporting backups to tape and backing up directly to tape.
Post Reply
byteschubser
Novice
Posts: 4
Liked: never
Joined: Dec 18, 2015 9:43 am
Full Name: Helge Hoese
Contact:

Stop tape jobs - Automatic Cancellation feature?

Post by byteschubser »

Hi,

after problems with tapes having same media_id* and single tape LTO drives veeam shows many mounted medias (after using the hardware edject button) we are using the option "Eject media once the job finishes". Most of our small business cutomers only change tapes and get job mails - no access to management interface.

But sometimes people forget changing the tape. After inserting a new Tape job starts - and the next job execution fails at night :-( -waiting for tape

OK we can stop the jop at the management interface and get a message :

"VM's files for this job will be left in the inkosistent state. One or more VMs have incomplete, unusable restore points. Stop the Job anyway?"

Sounds not really good to me - ok it stops the job. What exactly is the meening of inconsisting state, incomplete, unusable restore points? When job starts again it creates new restore points - or we are wrong.

We are missing a shedule option : A backup job not completed within a specific amount of time can be automatically canceled by a defined maximum time value.

Any hints - thanks!

Helge


* many thanks for great support tweaking the database :-)
veremin
Product Manager
Posts: 20283
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Stop tape jobs - Automatic Cancellation feature?

Post by veremin »

Prior to answering your question it's worth understanding what situation led to the described behaviour ("job fails with waiting for a new tape" message). Am I right in assuming that it's been just caused by previously written media ejected after job's end that responsible individual forgot to replace with a new medium? Thanks.
Dima P.
Product Manager
Posts: 14415
Liked: 1576 times
Joined: Feb 04, 2013 2:07 pm
Full Name: Dmitry Popov
Location: Prague
Contact:

Re: Stop tape jobs - Automatic Cancellation feature?

Post by Dima P. »

If you are talking about backup to tape job there is a schedule option to run the tape job automatically ‘as new backup as a new file appear…’ where you can specify the desired backup windows.
VM's files for this job will be left in the inkosistent state
This warning is displayed while the tape job is running and you are canceling it to let you know that files written to tape during this job run will be inconsistent (because you are going to stop the writing process somewhere in the middle). Nothing to worry about if the you are canceling the job in waiting for tape state.
byteschubser
Novice
Posts: 4
Liked: never
Joined: Dec 18, 2015 9:43 am
Full Name: Helge Hoese
Contact:

Re: Stop tape jobs - Automatic Cancellation feature?

Post by byteschubser »

@Dima - thanks for the clarification. OK its what we already guessed but the warning sound s a litle bit dangerous.

@v. Eremin
Yes, you are right - previously written media ejected after job's end and responsible individual forgot to replace with a new medium.
veremin
Product Manager
Posts: 20283
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Stop tape jobs - Automatic Cancellation feature?

Post by veremin »

In this case, you could ignore the said message, as nothing additional has been written to tape medium. Thanks.
byteschubser
Novice
Posts: 4
Liked: never
Joined: Dec 18, 2015 9:43 am
Full Name: Helge Hoese
Contact:

Re: Stop tape jobs - Automatic Cancellation feature?

Post by byteschubser »

Ok, we can manual cancel the tape job - but we are missing a shedule option :
A (tape) backup job not completed within a specific amount of time can be automatically canceled by a defined maximum time value.
-> No manual intervention after christmas ;-) or anyone forgot to replace the medium.
Dima P.
Product Manager
Posts: 14415
Liked: 1576 times
Joined: Feb 04, 2013 2:07 pm
Full Name: Dmitry Popov
Location: Prague
Contact:

Re: Stop tape jobs - Automatic Cancellation feature?

Post by Dima P. »

Thanks! Have you checked the As new backup files appear schedule option - it allows to set the backup window for the tape job (last radio button on the screenshot)

Image
byteschubser
Novice
Posts: 4
Liked: never
Joined: Dec 18, 2015 9:43 am
Full Name: Helge Hoese
Contact:

Re: Stop tape jobs - Automatic Cancellation feature?

Post by byteschubser »

the tape job is scheduled with option "After this job". We will try "As new backup files appear" and define a denied period but I think the job is running and waiting for a tape. So defining a denied period will not work, because it will not cancel a running job. Thats why we think we need an option like: enable automatic cancellation after x hours ...
veremin
Product Manager
Posts: 20283
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Stop tape jobs - Automatic Cancellation feature?

Post by veremin »

Yep, even with backup window enabled, the tape job would not be cancelled. So, your voice is heard.

Though, if you have Veeam ONE deployed, I think I'm able to propose a workaround for you.

Thanks.
sysinfma
Enthusiast
Posts: 31
Liked: 7 times
Joined: Apr 14, 2021 12:25 pm
Full Name: Chris
Contact:

Re: Stop tape jobs - Automatic Cancellation feature?

Post by sysinfma »

We're having the same problem. Tape jobs should be cancelled when no tape is present. Is there a solution?
Dima P.
Product Manager
Posts: 14415
Liked: 1576 times
Joined: Feb 04, 2013 2:07 pm
Full Name: Dmitry Popov
Location: Prague
Contact:

Re: Stop tape jobs - Automatic Cancellation feature?

Post by Dima P. » 1 person likes this post

Hello CH,

There is no UI option for that but possibly you can script such check with PowerShell (i.e. start tape job at the needed day only if tape media is present). Here is the link to PowerShell node related to tape support if you are interested. Thanks!
sysinfma
Enthusiast
Posts: 31
Liked: 7 times
Joined: Apr 14, 2021 12:25 pm
Full Name: Chris
Contact:

Re: Stop tape jobs - Automatic Cancellation feature?

Post by sysinfma »

Thanks for the link. However, I could not find a command to query if or what tape is inserted.
Dima P.
Product Manager
Posts: 14415
Liked: 1576 times
Joined: Feb 04, 2013 2:07 pm
Full Name: Dmitry Popov
Location: Prague
Contact:

Re: Stop tape jobs - Automatic Cancellation feature?

Post by Dima P. »

sysinfma
Enthusiast
Posts: 31
Liked: 7 times
Joined: Apr 14, 2021 12:25 pm
Full Name: Chris
Contact:

Re: Stop tape jobs - Automatic Cancellation feature?

Post by sysinfma » 1 person likes this post

Hello Dima P.,

many thanks, that did the trick!

Here's my script in case someone else needs to check if there's a tape in the drive:

Code: Select all

# Get the tape medium currently loaded in the drive
$TapeMedium = Get-VBRTapeMedium -Drive "Tape0"

# Check if there is a tape in the drive
if ($TapeMedium -ne $null) {
  Write-Host "There is a tape in the drive: " $TapeMedium
  return $true
} else {
  Write-Host "There is no tape in the drive."
  return $false
}
This script can be referenced in the job's settings.
sysinfma
Enthusiast
Posts: 31
Liked: 7 times
Joined: Apr 14, 2021 12:25 pm
Full Name: Chris
Contact:

Re: Stop tape jobs - Automatic Cancellation feature?

Post by sysinfma » 1 person likes this post

I'm now running this script after the last disk job. It starts the job named "Backup-to-TAPE" only if a tape is inserted:

Code: Select all

# Get the tape library and tape drive
$TapeLibrary = Get-VBRTapeLibrary -Name "Name-of-Tape-Library"
$TapeDrive = Get-VBRTapeDrive -Library $TapeLibrary

# Get the tape medium currently loaded in the drive
Start-VBRTapeInventory -Library $TapeLibrary -Wait
$TapeMedium = Get-VBRTapeMedium -Drive $TapeDrive

# Check if there is a tape in the drive
if ($TapeMedium -ne $null) {
  Write-Host "There is a tape in the drive ""$TapeDrive"": " $TapeMedium
  Get-VBRTapeJob -Name "Backup-to-TAPE" | Start-VBRJob
  Write-Host "Returned result:"
  return $true
} else {
  Write-Host "There is no tape in the drive ""$TapeDrive""."
  Write-Host "Returned result:"
  return $false
}
Dima P.
Product Manager
Posts: 14415
Liked: 1576 times
Joined: Feb 04, 2013 2:07 pm
Full Name: Dmitry Popov
Location: Prague
Contact:

Re: Stop tape jobs - Automatic Cancellation feature?

Post by Dima P. » 1 person likes this post

sysinfma,

Thank you so much for sharing the scrip with the community. Glad to read that everything worked out well!
sysinfma
Enthusiast
Posts: 31
Liked: 7 times
Joined: Apr 14, 2021 12:25 pm
Full Name: Chris
Contact:

Re: Stop tape jobs - Automatic Cancellation feature?

Post by sysinfma »

You're very welcome!

I've just got a small update. To prevent the warning "Post-job script timed out" in the job that executes the TAPE script, the parameter "-RunAsync" needs to be added to "Start-VBRJob":

Code: Select all

# Get the tape library and tape drive
$TapeLibrary = Get-VBRTapeLibrary -Name "Name-of-Tape-Library"
$TapeDrive = Get-VBRTapeDrive -Library $TapeLibrary

# Get the tape medium currently loaded in the drive
Start-VBRTapeInventory -Library $TapeLibrary -Wait
$TapeMedium = Get-VBRTapeMedium -Drive $TapeDrive

# Check if there is a tape in the drive
if ($TapeMedium -ne $null) {
  Write-Host "There is a tape in the drive ""$TapeDrive"": " $TapeMedium
  Get-VBRTapeJob -Name "Backup-to-TAPE" | Start-VBRJob -RunAsync
  Write-Host "Returned result:"
  return $true
} else {
  Write-Host "There is no tape in the drive ""$TapeDrive""."
  Write-Host "Returned result:"
  return $false
}
Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests