none
Tapes with expired content not registering as expired RRS feed

  • Question

  • I'm running DPM 2012 SP1 and have several tapes I'd like to reuse as I believe they are expired but I cant mark them as free.

    When I view tape contents I see the backup expires date is well past so I don't understand why the tape is not showing as expired.

    I've run the ForceFree-Tape.ps1 against the tape(s) to no effect so I'm wondering what to do next.

    Does anyone out there have any pointers?


    Cheers, David


    • Edited by soc david Tuesday, January 14, 2014 12:30 AM
    Tuesday, January 14, 2014 12:29 AM

Answers

  • Hi,

    If you are doing short-term tape backup using Full+Incremental, it is possible for the tapes that have incrementals not to expire when expected if a FULL recovery point that the incremental depends on cannot be expired.  This can happen if the FULL backups are failing. Under that condition, DPM will continue taking incremental backups that are dependent on the last successful FULL backup.  Please review your tape backup job history and see if that is the condition.

    <snip>
    I've run the ForceFree-Tape.ps1 against the tape(s) to no effect so I'm wondering what to do next.
    >snip<

    If you don't use the proper syntax, it sometimes fails silently.  Try this version of the script, it has better prompting.

    #Fixed library parsing
    #Added localhost auto-select
    #ADDED prompt for slot(s)
    
    param ([string] $DPMServerName, [string] $LibraryName, [string[]] $TapeLocationList)
    if(("-?","-help") -contains $Args[0])
    {
    Write-Host "Usage: ForceFree-Tape.ps1 [[-DPMServerName] <Name of the DPM server>] [-LibraryName] <Name of the library> [-TapeLocationList] <Array of tape locations>"
    Write-Host "Example: Force-FreeTape.ps1 -LibraryName "My library" -TapeLocationList Slot-1, Slot-7"
    Write-Host "Standalone: Force-FreeTape.ps1 -LibraryName "My library" -TapeLocationList Drive-\\.\Tape0"
    }
    if (!$DPMServerName) 
    {
    $DPMservername=&"hostname"
    "Selected DPM server = $DPMservername" 
    {
    
    }
    }
    if (!(Connect-DPMServer $DPMServerName))
    {
    Write-Error "Failed to connect To DPM server $DPMServerName"
    exit 1
    }
    $library = @(Get-DPMLibrary $DPMServerName )
    if ($library.count -eq 0)
    {
    Write-Error "Failed to find library with user friendly name $LibraryName"
    Disconnect-DPMServer $DPMServerName
    exit 1
    }
    if (!$LibraryName)
    {
    $library | foreach {$_.userfriendlyname}
    $LibraryName = Read-Host "Library name (copy & paste from above): "
    if (!$LibraryName)
    {
    Write-Error "Library name not specified."
    Disconnect-DPMServer $DPMServerName
    exit 1
    }
    #added
    $library = Get-DPMLibrary $DPMServerName | where {$_.UserFriendlyName -eq $LibraryName}
    write-host "Getting library...$LibraryName"
    if (!$library)
    {
        Write-Error "Failed to find library with user friendly name $LibraryName"
        Disconnect-DPMServer $DPMServerName
        exit 1
    }
    
    }
    if (!$TapeLocationList)
    {
    $tmp = Read-Host "Enter Slot number(s). If entering more than one, separate them by comma. Example: Slot-1,Slot-5"
    $TapeLocationList=$tmp.split(",")
    write-host "Processing this slot list..."
    $TapeLocationList
    if (!$TapeLocationList)
    {
    Write-Error "Tape location not specified."
    Disconnect-DPMServer $DPMServerName
    exit 1
    }
    }
    foreach ($media in @(Get-Tape -DPMLibrary $library))
    {
    if ($TapeLocationList -contains $media.Location)
        {
        if ($media -is [Microsoft.Internal.EnterpriseStorage.Dls.UI.ObjectModel.LibraryManagement.ArchiveMedia]) 
     {
     foreach ($rp in @(Get-RecoveryPoint -Tape $media))
         {
         Get-RecoveryPoint -Datasource $rp.Datasource | Out-Null
         Write-Verbose "Removing recovery point created at $($rp.RepresentedPointInTime) for tape in $($media.Location)."
         Remove-RecoveryPoint -RecoveryPoint $rp -ForceDeletion -Confirm:$false
         }
     Write-Verbose "Setting tape in $($media.Location) as free."
     Set-Tape -Tape $media -Free
     }
        else
     {
     Write-Error "The tape in $($media.Location) is a cleaner tape."
    }
    }
    }
    Disconnect-DPMServer $DPMServerName


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Mike J. [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, January 14, 2014 4:28 PM
    Moderator

All replies

  • Hi,

    If you are doing short-term tape backup using Full+Incremental, it is possible for the tapes that have incrementals not to expire when expected if a FULL recovery point that the incremental depends on cannot be expired.  This can happen if the FULL backups are failing. Under that condition, DPM will continue taking incremental backups that are dependent on the last successful FULL backup.  Please review your tape backup job history and see if that is the condition.

    <snip>
    I've run the ForceFree-Tape.ps1 against the tape(s) to no effect so I'm wondering what to do next.
    >snip<

    If you don't use the proper syntax, it sometimes fails silently.  Try this version of the script, it has better prompting.

    #Fixed library parsing
    #Added localhost auto-select
    #ADDED prompt for slot(s)
    
    param ([string] $DPMServerName, [string] $LibraryName, [string[]] $TapeLocationList)
    if(("-?","-help") -contains $Args[0])
    {
    Write-Host "Usage: ForceFree-Tape.ps1 [[-DPMServerName] <Name of the DPM server>] [-LibraryName] <Name of the library> [-TapeLocationList] <Array of tape locations>"
    Write-Host "Example: Force-FreeTape.ps1 -LibraryName "My library" -TapeLocationList Slot-1, Slot-7"
    Write-Host "Standalone: Force-FreeTape.ps1 -LibraryName "My library" -TapeLocationList Drive-\\.\Tape0"
    }
    if (!$DPMServerName) 
    {
    $DPMservername=&"hostname"
    "Selected DPM server = $DPMservername" 
    {
    
    }
    }
    if (!(Connect-DPMServer $DPMServerName))
    {
    Write-Error "Failed to connect To DPM server $DPMServerName"
    exit 1
    }
    $library = @(Get-DPMLibrary $DPMServerName )
    if ($library.count -eq 0)
    {
    Write-Error "Failed to find library with user friendly name $LibraryName"
    Disconnect-DPMServer $DPMServerName
    exit 1
    }
    if (!$LibraryName)
    {
    $library | foreach {$_.userfriendlyname}
    $LibraryName = Read-Host "Library name (copy & paste from above): "
    if (!$LibraryName)
    {
    Write-Error "Library name not specified."
    Disconnect-DPMServer $DPMServerName
    exit 1
    }
    #added
    $library = Get-DPMLibrary $DPMServerName | where {$_.UserFriendlyName -eq $LibraryName}
    write-host "Getting library...$LibraryName"
    if (!$library)
    {
        Write-Error "Failed to find library with user friendly name $LibraryName"
        Disconnect-DPMServer $DPMServerName
        exit 1
    }
    
    }
    if (!$TapeLocationList)
    {
    $tmp = Read-Host "Enter Slot number(s). If entering more than one, separate them by comma. Example: Slot-1,Slot-5"
    $TapeLocationList=$tmp.split(",")
    write-host "Processing this slot list..."
    $TapeLocationList
    if (!$TapeLocationList)
    {
    Write-Error "Tape location not specified."
    Disconnect-DPMServer $DPMServerName
    exit 1
    }
    }
    foreach ($media in @(Get-Tape -DPMLibrary $library))
    {
    if ($TapeLocationList -contains $media.Location)
        {
        if ($media -is [Microsoft.Internal.EnterpriseStorage.Dls.UI.ObjectModel.LibraryManagement.ArchiveMedia]) 
     {
     foreach ($rp in @(Get-RecoveryPoint -Tape $media))
         {
         Get-RecoveryPoint -Datasource $rp.Datasource | Out-Null
         Write-Verbose "Removing recovery point created at $($rp.RepresentedPointInTime) for tape in $($media.Location)."
         Remove-RecoveryPoint -RecoveryPoint $rp -ForceDeletion -Confirm:$false
         }
     Write-Verbose "Setting tape in $($media.Location) as free."
     Set-Tape -Tape $media -Free
     }
        else
     {
     Write-Error "The tape in $($media.Location) is a cleaner tape."
    }
    }
    }
    Disconnect-DPMServer $DPMServerName


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Mike J. [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, January 14, 2014 4:28 PM
    Moderator
  • Thanks Mike,

    Short term backup is to disk and long term goes to tape so I'm not sure if your suggestion applies.

    I'll give the updated script a go to see if that helps.


    Cheers, David

    Wednesday, January 15, 2014 3:14 AM
  • Unfortunately the script finishes with the following error after all the messages about recovery points being removed.

    Set-Tape : The selected tapes cannot be marked as free because they belong to
    protection groups.
    You need to stop protection of the associated protection groups before you can
    mark the tapes as free. The protection group that a tape belongs to is listed
    in the Protection Group column. (ID: 31116)
    At H:\ForceFree-Tape.ps1:79 char:2
    +  Set-Tape -Tape $media -Free
    +  ~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Set-DPMTape], ContainsValidDa
       tasetException
        + FullyQualifiedErrorId : MarkAsFreeValidDatasetError,Microsoft.Internal.E
       nterpriseStorage.Dls.UI.Cmdlet.MarkMedia

    Not sure where I go from here.

    The tape I ran the script against said backup time 29-June-2012 and Expires on 4-October-2013 so I don't understand why I couldn't set the tape free.


    Cheers, David

    Thursday, January 16, 2014 10:37 PM
  • Hi,

    Very strange for sure.

    Can you confirm that the number of datasets that the script says it is deleting matches the number of datasets on the tape when you View tape contents in the GUI ? 

    FYI - if all else fails you can erase that tape outside of DPM so it can be reused. You can get the DPMERASETAPE utility from here.


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Mike J. [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights.


    Friday, January 17, 2014 12:06 AM
    Moderator
  • Thanks Mike,

    I ran the script against tapes in different slots and its worked as expected.


    Cheers, David

    Monday, January 20, 2014 1:43 AM