none
After upgrade to 2012 from 2010 , offsite tapes not expiring. RRS feed

  • Question

  • How do i find my offsite tapes that are due online after the upgrade. They are not showing up in the Tape Management report on 2012.

    This was an in-place upgrade.

    Thursday, April 19, 2012 2:29 PM

Answers

  • Hi,

    Create a file called duetape.ps1 under DPM bin folder and paste the code below in it.

    $version = 1.6
    foreach ($switch in $args)
    {
    	$switches = $Switches + $switch.toupper() + " "
    }
    if ($switches -match'label')   { $barcode = 'label' } else { $barcode = 'barcode'}
    if ($switches -like '*??/??/????*') { [datetime] $date = $switches.substring($switches.IndexOf("/")-2,10) } else { [datetime] $date = '12/30/9999'  }
    if ($switches -match 'T' -and $date -eq '12/30/9999' ) { $date = (get-date).AddDays($switches.substring($switches.indexof("T") + 1,3))}
    if ($switches -match 'verbose') { $verbose = 1 }
    if ($switches -match '\?') { $help = 1 }
    if ($switches -match 'expired') { $expired = 1 }
    $date = $date.AddDays(1)
    $confirmpreference = "None"
    cls
    write-host "due-tape Version $version`nType ? for help"  -f white
    write-host "`nCommand: " $myinvocation.line -f yellow
    if ($help)
    { 
    	write-host 'usage: due-tape <switch>' -f white
    	write-host 'switches:'
    	write-host '   LABEL      - List ALL tapes and when they will get expired. Output will list tape labels.' -f yellow
    	write-host '   VERBOSE    - Includes all recovery points in the tape' -f yellow
    	write-host '   Tnnn       - Tapes that will be expired nn days from now. Cannot be used with mm/dd/yy switch'  -f yellow
    	write-host "   mm/dd/yyyy - Tapes that will expired before the this date"  -f yellow
    	write-host "   Expired    - Include Tapes that are already expired"  -f yellow
    	write-host "`nExamples:`n" 
    	write-host "due-tape label" -f white
    	write-host "   Return tapes with their label values. If ommited, it will return barcode values`n" -f cyan
    	write-host "due-tape  verbose" -f white
            write-host "   Include all recovery points available in the tape`n" -f cyan
    	write-host "due-tape 05/02/12" -f white
    	write-host "   Lists all tapes that are set to expire before May, the 2nd of 2012`n" -f cyan
    	write-host "due-tape T015" -f white   
    	write-host "   Lists all tapes that are set to expire within the next 15 days`n" -f cyan
    	write-host "due-tape Expired" -f white   
    	write-host "   Include all tapes expired before current date" -f cyan
    	exit
    }
    write-host "`nList tapes that will be expired before $date`n" -f cyan
    $dpmserver = connect-dpmserver (&hostname)
    $pg = @(get-protectiongroup (&hostname) | where { $_.protectionmethod -like "*Long-term using tape*"}) 
    $filename = "duetape_" +(get-date -uFormat "%m-%d-%Y_%H-%m") + ".txt"
    "Command: " + $myinvocation.line | out-file $filename -encoding ASCII
    foreach ($pg1 in $pg)
    {
    	$count = 0
    	$rp = @()
    	write-host "Protection Group" $pg1.friendlyname "has tape protection" -foreground white
    	$ds = @(get-datasource $pg1)
    	foreach ($ds1 in $ds)
    	{
    		if ((get-recoverypoint $ds1 | where { $_.datalocation -eq "Media"}) -ne $null)
    		{
    			$rp = $rp + (get-recoverypoint $ds1 | where { $_.datalocation -eq "Media"})
    		}
    	}
    	$tp = @(get-tape -protectiongroup $pg1)
    	foreach ($tp1 in $tp)
    	{
    		if ($tp1.Isoffsiteready -eq $true)
    		{
    			if ($verbose) { write-host "`n   Recovery Points present on tape with" $barcode $tp1.$barcode }
    			foreach ($rp1 in $rp)
    			{
    				if ($tp1.id -eq $rp1.RecoverySourceLocations[0].mediamaplist[$rp1.RecoverySourceLocations[0].mediamaplist.count-1].mediaid)
    				{
    					if ($verbose) { write-host "     " $rp1.RecoverySourceLocations[0].creationdatetime " - " $rp1.RecoverySourceLocations[0].expirydate " - " $tp1.$barcode "-" $rp1.recoverysourcelocations[0].generation -foreground red }
    					if ($expire -lt $rp1.RecoverySourceLocations[0].expirydate)
    					{
    						$expire = ($rp1.recoverysourcelocations[0].expirydate)							
    					}
    				}
    			}		
    			if ($tp1.location.isoffline)
    			{
    				if ($expire -lt $date -and $expire -gt (get-date))
    				{
    					write-host "   Offsite Tape with" $barcode $tp1.$barcode "is due back to Library on" $expire -foreground yellow
    					"Offsite Tape with " + $barcode + " " + $tp1.$barcode + " is due back to Library on " + $expire | out-file $filename -encoding ASCII -append
    					$count++
    				}
    			}
    			else
    			{
    				if ($expire -lt $date -and $expire -gt $currentDate)
    				{
    					write-host "   Tape in" $tp1.location.name "-" $tp1.location.id "expires on" $expire -foreground green
    					"Tape in " + $tp1.location.name + "-" + $tp1.location.id +" expires on " + $expire | out-file $filename -encoding ASCII -append
    					$count++
    				}
    			}
    		}
    		if ($expired)
    		{
    			$notexpired = 0
    			foreach ($rp1 in $rp)
    			{
    				if ($tp1.id -eq $rp1.RecoverySourceLocations[0].mediamaplist[$rp1.RecoverySourceLocations[0].mediamaplist.count-1].mediaid)
    				{
    					if ($verbose) { write-host "     " $rp1.RecoverySourceLocations[0].creationdatetime " - " $rp1.RecoverySourceLocations[0].expirydate " - " $tp1.$barcode "-" $rp1.recoverysourcelocations[0].generation -foreground red }
    					$expire1 = $rp1.RecoverySourceLocations[0].expirydate
    					if ($expire1 -gt $expire -and $expire1 -lt (get-date)) { $expire = $expire1 }
    					if (!$expire)
    					{
    						$notexpired = 1
    						Break							
    					}
    				}
    			}
    			if ($tp1.location.isoffline -eq $True -and $notexpired -eq 0)
    			{
    				write-host "   Offsite Tape with" $barcode $tp1.$barcode "expired on " $expire -foreground red
    				"Offsite Tape with " + $barcode + " " + $tp1.$barcode + " expired on " + $expire | out-file $filename -encoding ASCII -append
    				$count++
    			}
    			if ($tp1.location.isoffline -eq $False -and $notexpired -eq 0)
    			{
    				write-host "   Tape in" $tp1.location.name "-" $tp1.location.id "expired on" $expire -foreground red
    				"Tape in " + $tp1.location.name + "-" + $tp1.location.id +" expired on " + $expire | out-file $filename -encoding ASCII -append
    				$count++
    			}
    		}
    	}
    	if ($count -eq 0) { Write-host "`n   No tapes will be expired before the supplied date" -f red }
    }
    write-host "`nFile $filename created`n"

    Monday, April 30, 2012 9:46 PM

All replies

  • Hello,

    We have had similar reports of this and is being investigated.  Stay tuned...


    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, April 20, 2012 12:52 PM
    Moderator
  • ok thanks, ill keep an eye out on this thread.

    Monday, April 23, 2012 4:33 PM
  • We also did an in-place upgrade and are having the same issue.  Any suggestions on how to best determine which tapes are due online?
    Friday, April 27, 2012 4:13 PM
  • Hi,

    Until we get a formal fix, you can use a powershell script to display media and lists it's expiry dates.   Wilson will post a script here shortly.


    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, April 27, 2012 10:14 PM
    Moderator
  • after re-installing DPM 2012, it appears to have fixed the issue, however id like to see the script to do a side-by-side comparison.
    Monday, April 30, 2012 7:10 PM
  • Hi,

    Create a file called duetape.ps1 under DPM bin folder and paste the code below in it.

    $version = 1.6
    foreach ($switch in $args)
    {
    	$switches = $Switches + $switch.toupper() + " "
    }
    if ($switches -match'label')   { $barcode = 'label' } else { $barcode = 'barcode'}
    if ($switches -like '*??/??/????*') { [datetime] $date = $switches.substring($switches.IndexOf("/")-2,10) } else { [datetime] $date = '12/30/9999'  }
    if ($switches -match 'T' -and $date -eq '12/30/9999' ) { $date = (get-date).AddDays($switches.substring($switches.indexof("T") + 1,3))}
    if ($switches -match 'verbose') { $verbose = 1 }
    if ($switches -match '\?') { $help = 1 }
    if ($switches -match 'expired') { $expired = 1 }
    $date = $date.AddDays(1)
    $confirmpreference = "None"
    cls
    write-host "due-tape Version $version`nType ? for help"  -f white
    write-host "`nCommand: " $myinvocation.line -f yellow
    if ($help)
    { 
    	write-host 'usage: due-tape <switch>' -f white
    	write-host 'switches:'
    	write-host '   LABEL      - List ALL tapes and when they will get expired. Output will list tape labels.' -f yellow
    	write-host '   VERBOSE    - Includes all recovery points in the tape' -f yellow
    	write-host '   Tnnn       - Tapes that will be expired nn days from now. Cannot be used with mm/dd/yy switch'  -f yellow
    	write-host "   mm/dd/yyyy - Tapes that will expired before the this date"  -f yellow
    	write-host "   Expired    - Include Tapes that are already expired"  -f yellow
    	write-host "`nExamples:`n" 
    	write-host "due-tape label" -f white
    	write-host "   Return tapes with their label values. If ommited, it will return barcode values`n" -f cyan
    	write-host "due-tape  verbose" -f white
            write-host "   Include all recovery points available in the tape`n" -f cyan
    	write-host "due-tape 05/02/12" -f white
    	write-host "   Lists all tapes that are set to expire before May, the 2nd of 2012`n" -f cyan
    	write-host "due-tape T015" -f white   
    	write-host "   Lists all tapes that are set to expire within the next 15 days`n" -f cyan
    	write-host "due-tape Expired" -f white   
    	write-host "   Include all tapes expired before current date" -f cyan
    	exit
    }
    write-host "`nList tapes that will be expired before $date`n" -f cyan
    $dpmserver = connect-dpmserver (&hostname)
    $pg = @(get-protectiongroup (&hostname) | where { $_.protectionmethod -like "*Long-term using tape*"}) 
    $filename = "duetape_" +(get-date -uFormat "%m-%d-%Y_%H-%m") + ".txt"
    "Command: " + $myinvocation.line | out-file $filename -encoding ASCII
    foreach ($pg1 in $pg)
    {
    	$count = 0
    	$rp = @()
    	write-host "Protection Group" $pg1.friendlyname "has tape protection" -foreground white
    	$ds = @(get-datasource $pg1)
    	foreach ($ds1 in $ds)
    	{
    		if ((get-recoverypoint $ds1 | where { $_.datalocation -eq "Media"}) -ne $null)
    		{
    			$rp = $rp + (get-recoverypoint $ds1 | where { $_.datalocation -eq "Media"})
    		}
    	}
    	$tp = @(get-tape -protectiongroup $pg1)
    	foreach ($tp1 in $tp)
    	{
    		if ($tp1.Isoffsiteready -eq $true)
    		{
    			if ($verbose) { write-host "`n   Recovery Points present on tape with" $barcode $tp1.$barcode }
    			foreach ($rp1 in $rp)
    			{
    				if ($tp1.id -eq $rp1.RecoverySourceLocations[0].mediamaplist[$rp1.RecoverySourceLocations[0].mediamaplist.count-1].mediaid)
    				{
    					if ($verbose) { write-host "     " $rp1.RecoverySourceLocations[0].creationdatetime " - " $rp1.RecoverySourceLocations[0].expirydate " - " $tp1.$barcode "-" $rp1.recoverysourcelocations[0].generation -foreground red }
    					if ($expire -lt $rp1.RecoverySourceLocations[0].expirydate)
    					{
    						$expire = ($rp1.recoverysourcelocations[0].expirydate)							
    					}
    				}
    			}		
    			if ($tp1.location.isoffline)
    			{
    				if ($expire -lt $date -and $expire -gt (get-date))
    				{
    					write-host "   Offsite Tape with" $barcode $tp1.$barcode "is due back to Library on" $expire -foreground yellow
    					"Offsite Tape with " + $barcode + " " + $tp1.$barcode + " is due back to Library on " + $expire | out-file $filename -encoding ASCII -append
    					$count++
    				}
    			}
    			else
    			{
    				if ($expire -lt $date -and $expire -gt $currentDate)
    				{
    					write-host "   Tape in" $tp1.location.name "-" $tp1.location.id "expires on" $expire -foreground green
    					"Tape in " + $tp1.location.name + "-" + $tp1.location.id +" expires on " + $expire | out-file $filename -encoding ASCII -append
    					$count++
    				}
    			}
    		}
    		if ($expired)
    		{
    			$notexpired = 0
    			foreach ($rp1 in $rp)
    			{
    				if ($tp1.id -eq $rp1.RecoverySourceLocations[0].mediamaplist[$rp1.RecoverySourceLocations[0].mediamaplist.count-1].mediaid)
    				{
    					if ($verbose) { write-host "     " $rp1.RecoverySourceLocations[0].creationdatetime " - " $rp1.RecoverySourceLocations[0].expirydate " - " $tp1.$barcode "-" $rp1.recoverysourcelocations[0].generation -foreground red }
    					$expire1 = $rp1.RecoverySourceLocations[0].expirydate
    					if ($expire1 -gt $expire -and $expire1 -lt (get-date)) { $expire = $expire1 }
    					if (!$expire)
    					{
    						$notexpired = 1
    						Break							
    					}
    				}
    			}
    			if ($tp1.location.isoffline -eq $True -and $notexpired -eq 0)
    			{
    				write-host "   Offsite Tape with" $barcode $tp1.$barcode "expired on " $expire -foreground red
    				"Offsite Tape with " + $barcode + " " + $tp1.$barcode + " expired on " + $expire | out-file $filename -encoding ASCII -append
    				$count++
    			}
    			if ($tp1.location.isoffline -eq $False -and $notexpired -eq 0)
    			{
    				write-host "   Tape in" $tp1.location.name "-" $tp1.location.id "expired on" $expire -foreground red
    				"Tape in " + $tp1.location.name + "-" + $tp1.location.id +" expired on " + $expire | out-file $filename -encoding ASCII -append
    				$count++
    			}
    		}
    	}
    	if ($count -eq 0) { Write-host "`n   No tapes will be expired before the supplied date" -f red }
    }
    write-host "`nFile $filename created`n"

    Monday, April 30, 2012 9:46 PM
  • The script doesn't appear to be working properly.  I ran it with and without the expired parameter and it only game me tapes that will be expiring in the future, not tapes that are already expired.
    Thursday, May 3, 2012 6:03 PM
  • Hi YoniB

    Can you post the output from the SQL Query below?

    use dpmdb
    select  BarcodeValue,
            Label,  
            physical.CreationDate, 
            physical.ExpiryDate, 
            map.DatasetId,
            source.DependentDatasetId
    from tbl_MM_MediaMap  map
    join tbl_MM_Media media
    on map.MediaId = media.MediaId
    join tbl_RM_RecoverySource source
    on map.DatasetId = source.DatasetId
    join tbl_RM_DatasetROMap RoMap
    on source.DatasetSequenceNumber = RoMap.DatasetSequenceNumber
    join tbl_RM_RecoverableObject recoverable
    on RoMap.RecoverableObjectId = recoverable.RecoverableObjectId
    join tbl_MM_PhysicalDataset physical
    on map.DatasetId = physical.DatasetId
    JOIN dbo.tbl_ARM_Dataset ArmDataset 
    ON source.DatasetId = ArmDataset.DatasetId 
    JOIN dbo.tbl_ARM_Datasource ArmDatasource 
    ON ArmDataset.DatasourceSequenceNumber = ARMDatasource.DatasourceSequenceNumber 
    Join tbl_IM_DataSource data
    on ArmDatasource.DatasourceId = data.DataSourceId
    order by physical.CreationDate, map.LogicalOffsetBegin


    Thanks, Wilson Souza - MSFT This posting is provided "AS IS" with no warranties, and confers no rights

    Saturday, May 5, 2012 1:26 AM
  • Hi YoniB

    Can you post the output from the SQL Query below?

    use dpmdb
    select  BarcodeValue,
            Label,  
            physical.CreationDate, 
            physical.ExpiryDate, 
            map.DatasetId,
            source.DependentDatasetId
    from tbl_MM_MediaMap  map
    join tbl_MM_Media media
    on map.MediaId = media.MediaId
    join tbl_RM_RecoverySource source
    on map.DatasetId = source.DatasetId
    join tbl_RM_DatasetROMap RoMap
    on source.DatasetSequenceNumber = RoMap.DatasetSequenceNumber
    join tbl_RM_RecoverableObject recoverable
    on RoMap.RecoverableObjectId = recoverable.RecoverableObjectId
    join tbl_MM_PhysicalDataset physical
    on map.DatasetId = physical.DatasetId
    JOIN dbo.tbl_ARM_Dataset ArmDataset 
    ON source.DatasetId = ArmDataset.DatasetId 
    JOIN dbo.tbl_ARM_Datasource ArmDatasource 
    ON ArmDataset.DatasourceSequenceNumber = ARMDatasource.DatasourceSequenceNumber 
    Join tbl_IM_DataSource data
    on ArmDatasource.DatasourceId = data.DataSourceId
    order by physical.CreationDate, map.LogicalOffsetBegin


    Thanks, Wilson Souza - MSFT This posting is provided "AS IS" with no warranties, and confers no rights

    Result is 28111 rows.  Can I upload somewhere or email it?
    Monday, May 7, 2012 2:51 PM
  • Hi YoniB

    Due to the amount of data we need to go through I guess the best bet is to open a support incident. The charge to your CC will not be processed until your case is resolved and closed, and since it’s a known code defect in the DPM 2012 product, you will not be charged for the incident.

    http://support.microsoft.com/select/Default.aspx?target=assistance

    In the Quick product finder, enter: System Center 2012

    then select System Center 2012 Data Protection Manager

    In the next screen, chose the option that applies.


    Thanks, Wilson Souza - MSFT This posting is provided "AS IS" with no warranties, and confers no rights

    Monday, May 7, 2012 9:56 PM
  • I tried this script (invoked with .\duetape.ps1 label) and all my tapes expire on 5/1/2013. I'm on DPM 2010--is there something I can check?  

    thanks, sorry to re-new this thread!

    - Vo

    Tuesday, May 29, 2012 7:44 PM
  • I second.  This little bug is causing me a lot of grief trying to track down expired tapes by hand.  Has a solution been released?
    Friday, August 24, 2012 2:11 PM
  • I have the same problem after in-place upgrade from DPM 2010. No tapes are showing up as due within next week or overdue. A solution would be much appreciated.

    Wednesday, September 19, 2012 2:48 PM
  • Hi,

    We have identified the problem and the fix is scheduled to be fixed in System Center SP1 that should be released a little later this year.


    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.

    Wednesday, September 19, 2012 6:09 PM
    Moderator