Showing posts with label Tape. Show all posts
Showing posts with label Tape. Show all posts

Friday, January 13, 2012

How does DPM choose which tape to use First.

DPM will use free tapes before it uses expired tapes. The thinking is that once you overwrite an expired tape, it can no longer be used for recovery, so DPM favors using free tapes first. DPM always pull tapes from the highest slot number first, so a free tape in slot 8 will be used before a free tape in slot 2.
(DPM forum by Mike J)

Friday, January 6, 2012

How to Troubleshoot Tape Library Sharing Configuration Issues in DPM 2010

A TechNet post about everything you need to consider when sharing a tape library in DPM.

Read more

Monday, September 12, 2011

Remove Tape from DPM database


When the data on a tape has expired it will show in the Tape Management Report as Tapes due online in the next x weeks.

image

When you do not add the tape back in the library the tape will eventually show up as over due Tapes.

image

There might be a situation where you are unable or unwilling to place the tape back in the library. For instance when the tape is broke, has been in the cycles for to long or the tape is even lost. In these cases you don’t want the tape to show up in report each week.

The procedure below (written by Mike Jacquet from Microsoft ) shows how to remove tapes from the Tape Management Report.

To remove a tape media from the over due tape report, you can run a SQL script to remove the media from the DPM database.

To run the script, perform the following steps:

1)  Open the DPM console and under the reporting tab, double-click the "tape management" report and select the number of weeks you want a report for (up to 4 weeks).
2)  Once the report opens- go to the page that list Over Due Tapes.
3)  Make a note of the "Tape labels"  for the tapes you want to remove from the DPM database so they will no longer show up on the report.

4) Make a backup of the DPMDB Sql database before proceeding using the following command:

     DPMBACKUP -db (The database will be saved in the C:\Program Files\Microsoft DPM\DPM\Volumes\ShadowCopy\Database Backups folder.

5) Open SQL Enterprise manager and connect to the Server_name\$MSDPM2010 instance.

6) Under DATABASES - Highlight the DPMDB entry - then click on "NEW QUERY" button.
7)  Copy / paste the following SQL script into the new query window.

---------- START COPY HERE -------------

-- overdue tapes
-- for clarity, set up the parameter as a variable
declare @paramTapeLabel as nvarchar(256)
set @paramTapeLabel = N'SAMPLE_TAPE_LABEL_NAME'

-- keys
declare @vMediaId as guid
declare @vGlobalMediaId as guid

-- if the delete gives trouble, add keyset after cursor
declare cur_label cursor
for select MediaId, GlobalMediaId
from tbl_MM_Media
where label = @paramTapeLabel;

open cur_label
while (0 = 0)
begin
fetch next from cur_label into @vMediaId, @vGlobalMediaId
-- test for being done
if @@fetch_status <> 0 break;

print 'Deleting MediaId = ' + cast(@vMediaId as varchar(36))
-- do a set of deletes atomically
begin transaction;
delete from tbl_MM_TapeArchiveMedia
  where MediaId = @vMediaId;

delete from tbl_MM_MediaMap
  where MediaId = @vMediaId;

delete from tbl_MM_ArchiveMedia
  where MediaId = @vMediaId;

delete from tbl_MM_Global_ArchiveMedia
  where MediaId = @vGlobalMediaId;

delete from tbl_MM_Global_Media
  where MediaId = @vGlobalMediaId;

delete from tbl_MM_Media
  where current of cur_label;

commit transaction;

end
close cur_label
deallocate cur_label

-------------- END COPY HERE ----------------------

8)  replace the tape label name parameter in the script with the name of the tape label from the over due tape report that you want to delete.
        set @paramTapeLabel = N'SAMPLE_TAPE_LABEL_NAME'      <--- replace tape label between the single quotes ' '

9) Execute the SQL script.

10)  Repeat steps 8. and 9. for each tape label that you want to delete.


Monday, June 21, 2010

Recatalog an Expired Tape

By default you are unable to restore data from a expired tape. Also the recatalog option is disabled for expired tapesWhen a has expired in DPM 2007. But you can use the following work around.

1) In the DPM admin console select the TAB Library Management, Select the Tape and mark the tape as Free.
mark_free 

2) Select the tape again Unmark tape as Free
unmark_free

3) Now the option re-catalog imported tape is available
cat

4) After the catalog is completed you should be able to restore data from the tape
cat2

Note: On the restore tab you will find the items under External DPM Tapes
image 
When you use this option to restore a Exchange mailbox; On the restore tab you will be unable to drive down to mailbox level. It is also not possible to restore to the Recovery Store Group (RSG).

Wednesday, October 7, 2009

Tape library inventory using Powershell

The command to start a fast or detailed inventory using Powershell is not to difficult, the trick is to get the correct name for the tape library.
In the example below we use an additional Powershell command to read the Library name in to a variable.  

First we need to list all tape libraries attached to the DPM server. When you have a Tape library attached, you might see the drive listed as well. Note the order the tape libraries are listed.
(replace dpm01 with the name of your DPM server)

PS > get-dpmlibrary -DPMServerName dpm01

Name                                     Drives                   Slots          I/E ports
----                                     ------                   -----               ---------
Stand-alone Drive: I...                       1                    0                 0          #0
Library: Library1                             2                      23                1          #1

Now we read the library details in to the variable $DPMlib
(replace dpm01 with the name of your DPM server)

$dpmlib = get-dpmlibrary -DPMServerName dpm01

Using the information collected with the first command we now can start the inventory. The number added to the $DPMlib variable is the order number in which the library is listed, start counting with 0. In this example, the number 1.

Fast inventory:

PS > Start-DPMLibraryInventory -DpmLibrary $dpmlib[1]

JobCategory                        Status                             HasCompleted
-----------                             ------                                  ------------
FastInventory                      Scheduled                            False

Detailed inventory:

PS > Start-DPMLibraryInventory -DetailedInventory -DpmLibrary $dpmlib[1]

JobCategory                        Status                                  HasCompleted
-----------                             ------                                  ------------
DetailedInventory                Scheduled                               False

When you use it in a script it will look like this

$dpmlib = get-dpmlibrary -DPMServerName dpm01
Start-DPMLibraryInventory -DpmLibrary $dpmlib[1]

Tuesday, September 1, 2009

Script to resolve: Free tape threshold reached

When you have a tape library for which you change the tapes on a daily or weekly basis you properly run in to the following warning: Free tape threshold reached.

The number of free tapes in the Tape Library ,name> is less than or equals the threshold value of #. You must add tape to the library and it as free in order to prevent future backups from failing (ID 3305)

You receive this warning even when there are enough expired tapes available in the tape library. You get this warning because DPM checks the number of free tapes, in spite of the fact that DPM can write to expired tapes as well.
image

The advised resolution in DPM is manually mark all expired tapes as free. However a real IT-admin does not like manual labor. Therefore we created a PowerShell script that checks for expired tapes and marks them free.
If you run the script manually it looks like this:
image

Powershell script:

param ([string] $DPMServerName)
add-PSSnapin Microsoft.DataProtectionManager.PowerShell
if(("-?","-help") -contains $args[0])
{
    Write-Host "Description: This script marks all expired tapes as free"
    Write-Host "Usage: MarkExpiredTapesAsFree.ps1 [-DPMServerName] <Name of the DPM server>"
    exit 0
}
if (!$DPMServerName)
{
    $DPMServerName = Read-Host "DPM server name"
    if (!$DPMServerName)
    {
        Write-Error "Dpm server name not specified."
        exit 1
    }
}
if (!(Connect-DPMServer $DPMServerName))
{
    Write-Error "Failed to connect To DPM server $DPMServerName"
    exit 1
}
$libraryList = Get-DPMLibrary -DPMServerName $DPMServerName
foreach ($library in $libraryList)
{
    $expiredTapeList = @(Get-Tape -DPMLibrary $library |
    ? {$_ -is [Microsoft.Internal.EnterpriseStorage.Dls.UI.ObjectModel.LibraryManagement.ArchiveMedia] -and

$_.DatasetState -eq "Recyclable"})
    if ($expiredTapeList.Length -gt 0)
    {
        Write-Host "Marking $($expiredTapeList.Length) tape(s) as free in $($library.UserFriendlyName)."
        Set-Tape -Tape $expiredTapeList -Free
        $expiredTapeList | select Location
    }

}

We have scheduled this script to run daily using the Windows task scheduler. Expired tapes are now mark as free on a daily basis

In order to schedule a Powershell command you need to create a cmd that calls the Powershell script. The command file is listed below

command file:

powershell -command "& 'd:\ps_scripts\MarkExpiredTapesAsFree.ps1' <servername>"

Thanks to Mischa for his help with the script.

Friday, July 31, 2009

Fast inventory fails

Found that the fast inventory of the Tape library in DPM can fail or show the wrong results in some cases. According to a newsgroup post this can be caused (in certain types of libraries) by the press of a cleaning tape.

The post reports this for IBM 35XX series and HP 1/8 tape libraries. We have seen the same issue on the Dell TL2000 tape library which is actually an IBM Totalstorage 3573 Tape library.

The workaround is to remove the cleaning tape from the library.

The newsgroup threat also describes a fix setting a registry key. (I have not tried this yet)

The rekey fix is to handle some  unexpected behavior of tape library. The issue is when there is cleaner media present in some library element (slot/drive/transport ) the IOCTL_CHANGER_GET_ELEMENT_STATUS for that particular elment returns with ELEMENT_STATUS_EXCEPT set in CHANGER_ELEMENT_STATUS.Flags and CHANGER_ELEMENT_STATUS.ExceptionCode is set to ERROR_UNHANDLED_ERROR.  This is unexpected behavior as per WHQL and as a result of this you will see Fast  Inventory failing with "Hardware Issue". The workaround is added in DPM 2007 SP1 and we have seen this issue with only IBM 35XX series and HP 1/8 tape library

Thanks to Sachin

Link to full newsgroup threat

Wednesday, July 15, 2009

Regional Settings

I Found some unexpected behavior on a DPM server that is configured with an English OS, but with the Dutch regional settings.

When using the command: set-dpmGlobalproperty –DPMserverName <servername> -TapewritePeriodRatio 0.2 (this command configures the DPM settings for marking tapes ready for offsite storage)

This command works and the settings seem to be update.

image

When you after that request the active settings with the command: get-dpmGlobalproperty –DPMserverName <servername> TapewritePeriodRatio. You get the value back in the Dutch regional format, which is 0,2. (see above)

image

The workaround is to configure the server with US regional settings at least for the decimal symbol and digit grouping symbol

Thanks to Peer for his help on this.

Tuesday, June 30, 2009

I/O device errors during tape backup

My experience is that tape drive errors are common with many backup applications. DPM is no difference here. According to posts I found most issues are caused due to incorrect behavior either by tape drive firmware or device driver.

But I found also some issues where DPM fails to span to multiple tapes. This could be solved by creating a registry key: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Data Protection Manager\Agent] "BufferQueueSize"=dword:00000001" This will ensure that backup will span to next available whenever any IO device error beyond of 30 GB on tape occurs. There by avoiding backup failures

Monday, June 8, 2009

Which tape drives are supported

It’s a little bit hidden on the Microsoft webpage. But a full overview of tape-drives en libraries supported by DPM 2007 can be found here: http://technet.microsoft.com/en-gb/dpm/cc678583.aspx

Additionally for HP drives you find the support Matrix here: http://h18000.www1.hp.com/products/storageworks/ebs/matrix_archives.html

Saturday, June 6, 2009

Tape collocation

With DPM 2007 SP1 you can use Tape Collection or Tape media sharingso that multiple protection groups with similar tape retention periods can now share tapes. This enables you to have multiple recovery points from the same as well as different protection groups use the same tape.
To enable (from DPM management Shell): Set-DPMGlobalProperty -DpmServer -OptimizeTapeUsage $true
To disable(from DPM management Shell): Set-DPMGlobalProperty -DpmServer -OptimizeTapeUsage $false

Requirement: Protection group must have the same tape retention period configured.