Discussions related to exporting backups to tape and backing up directly to tape.
Post Reply
johnmacd
Lurker
Posts: 1
Liked: never
Joined: Oct 11, 2018 5:54 pm
Full Name: John MacDonald
Contact:

Automatic Tape Export Full I/E slots behaviour

Post by johnmacd »

We are implementing a PS script that will Export Tapes once a day Mon-Fri using Windows Task Scheduler to call the script.

There are approximately 18 I/E slots available. In the case where all the I/E slots were filled and the script executed on it's schedule
my hunch is that Veeam would error out as no I/E slots were available to eject the tape too, is that correct?

The scenario we trying to avoid is when there is a delay (over holidays etc.. and we do not want to pause the Export of tapes) where a human may not be available to remove the tapes from the IE slots. Would Veeam 'Queue' up the ejections and then once the slots are freed start exporting the tapes back to the first one?

Also if you know of any error Code that would appear when I/E slots are full that would be helpful as we could alert on it.

Is there a Veeam PS cmdlet that can check for I/E slot usage, availability?


Any suggestions or hints are appreciated.

Thanks,

John
vemurirajesh10
Novice
Posts: 3
Liked: never
Joined: Jul 04, 2018 12:37 pm
Full Name: Vemuri Rajesh
Location: INDIA
Contact:

Re: Automatic Tape Export Full I/E slots behaviour

Post by vemurirajesh10 »

How are you filtering full tapes to export? I hope there is no command in Veeam to check I/E Slots. You have to run "Import Tapes" before you run export the tapes to avoid failure.
csydas
Expert
Posts: 193
Liked: 47 times
Joined: Jan 16, 2018 5:14 pm
Full Name: Harvey Carel
Contact:

Re: Automatic Tape Export Full I/E slots behaviour

Post by csydas »

Hi John,

My experience is that you'll just get an error that no I/E slots were available, and it will try to go to a normal slot; if no such slot is available, you get another error that the operations failed due to no available slots in the library.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Automatic Tape Export Full I/E slots behaviour

Post by veremin » 1 person likes this post

I believe tapes in I/E slots are treated as offline ones, therefore, you cannot reliably identify them via PowerShell. As to queue question, backup server will just fail eject operation instead of queuing it up. Thanks!
vemurirajesh10
Novice
Posts: 3
Liked: never
Joined: Jul 04, 2018 12:37 pm
Full Name: Vemuri Rajesh
Location: INDIA
Contact:

Re: Automatic Tape Export Full I/E slots behaviour

Post by vemurirajesh10 »

Is there any way to check how many slots are empty in MAP from Veeam server? I have Dell ML3 library with 34 I\E Slots. I need to check how many I\E Slots are free so that my script can export only those many tapes. If no free slots then it should send a mail notification about the status.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Automatic Tape Export Full I/E slots behaviour

Post by veremin »

I'm not familiar with the given library, but there must be a native utility that allows you to check I/E availability. Combining it with Veeam PowerShll should do the trick. Thanks!
vemurirajesh10
Novice
Posts: 3
Liked: never
Joined: Jul 04, 2018 12:37 pm
Full Name: Vemuri Rajesh
Location: INDIA
Contact:

Re: Automatic Tape Export Full I/E slots behaviour

Post by vemurirajesh10 »

I have cross verified with Dell as well. They do not have CLI for this model. So I feel is to check the status of Export-VBRTapeMedium command for each tape. If it is success continue next tape to export. if it fails then stop there and send notification for those tapes that are ejected.

But need to collect the error to check if it throws something like "no I\E slot is available to export" as there might be multiple errors during tape exporting process.

Anyone is aware of error codes for "I\E Slot is not available" or how to collect this information?
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Automatic Tape Export Full I/E slots behaviour

Post by veremin »

I don't have a tape library at hand, so cannot check that, but it should be possible to assign result of export-vbrtapemedium cmdlet to a variable, and confirm its status afterwards. Thanks!
ddrudik
Lurker
Posts: 1
Liked: 2 times
Joined: Mar 29, 2022 1:43 pm
Full Name: Doug Drudik

Re: Automatic Tape Export Full I/E slots behaviour

Post by ddrudik » 2 people like this post

Below is the PowerShell script we use to export full tapes from the Dell ML3 on our VBR server (scheduled to run periodically with task scheduler). Will need to be modified to match your setup.

Code: Select all

function ConvertTo-HashtableFromPsCustomObject { 
    param ( 
        [Parameter(  
            Position = 0,   
            Mandatory = $true,   
            ValueFromPipeline = $true,  
            ValueFromPipelineByPropertyName = $true  
        )] [object] $psCustomObject 
    );
    Write-Verbose "[Start]:: ConvertTo-HashtableFromPsCustomObject"
    $output = @{}; 
    $psCustomObject | Get-Member -MemberType *Property | % {
        $output.($_.name) = $psCustomObject.($_.name); 
    }
    Write-Verbose "[Exit]:: ConvertTo-HashtableFromPsCustomObject"
    return  $output;
}
### The following line filters online full/non-expired tapes that end in barcode "L8", if your tape barcodes differ modify accordingly.
$tapesToExport = Get-VBRTapeMedium | Where-Object {$_.Location -like "Slot" -and $_.IsFull -eq $true -and $_.Barcode -like "*L8" -and $_.IsExpired -eq $false -and $_.IsFree -eq $false}
### The last tape in a numbered media set will not be full so it will be ignored by this script and will need to be manually exported later.
if ($tapesToExport.count -gt 0){
    ### The following line is to assume trust for an untrusted certificate on your ML3's web interface, if you have a trusted certificate on your ML3 you can eliminate this line
    [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
    ### Create a monitor-level user in the ML3's web interface, login as that new user to the web interface to set a new password.  Enter logon details in the following section:
    $monitorUser = @{
        username='yourMonitorUser'
        password='yourMonitorUserPassword'
    }
    $body = (ConvertTo-Json $monitorUser)
    ### Change 192.168.0.1 to the IP address of your ML3.
    $bearer = Invoke-RestMethod -Uri https://192.168.0.1:3031/rest/login -Method Post -Body $body -ContentType 'application/json'
    $bearer = ConvertTo-HashtableFromPsCustomObject($bearer)
    $token = @{
        Authorization=$bearer['token']
    }
    ### Change 192.168.0.1 to the IP address of your ML3.
    $mediaInfo = Invoke-RestMethod -Uri https://192.168.0.1:3031/rest/library/mediainfo -Method GET -Headers $token -ContentType 'application/json'
    ### Assuming no ML3E Expansion modules the LogicalNumbers of the ML3 export slots should be 1.36 to 1.40
    $exportSlots  = $mediaInfo | Where-Object {$_.LogicalNumber -eq '1.36' -or $_.LogicalNumber -eq '1.37' -or $_.LogicalNumber -eq '1.38' -or $_.LogicalNumber -eq '1.39' -or $_.LogicalNumber -eq '1.40'} | Measure-Object
    ### Change the following to match your SMTP server requirements
    $smtpFrom = 'veeamexport@your.domain'
    $smtpTo = 'you@your.domain'
    $smtpServer = 'your.smtp.server'
    $remainingExportSlots=5-($exportSlots.count)
    $i=0
    while(($i -lt $tapesToExport.Length) -and ($remainingExportSlots -gt 0)) {
        $barcode = $tapesToExport[$i].Barcode
        $tapesToExport[$i] | Export-VBRTapeMedium
        $remainingExportSlots=$remainingExportSlots-1
        if($remainingExportSlots -eq 0){
            $subject = "Tape $barcode exported ($remainingExportSlots export slots remain open - remove the exported tapes)"
        } else {
            $subject = "Tape $barcode exported ($remainingExportSlots export slots remain open)"
        }
        Send-MailMessage -From $smtpFrom -To $smtpTo -Subject $subject -DeliveryNotificationOption OnSuccess, OnFailure -SmtpServer $smtpServer
        $subject
        $i++
    }
}
Post Reply

Who is online

Users browsing this forum: Tesla2k and 26 guests