MigrateDatasourceDataFromDPM.ps1 can not be used a second time

We have a DPM 2012 server (build 4.0.1920.0) with a storagepool of 5 x 2 TB disks. A few months ago there were still 6 disks attached but because of a better backupscenario we were able to save a lot of disk space. We ran MigrateDatasourceDataFromDPM.ps1 to free one disk, the retention period was 31 days, and after that period the data was automatically transferred to the other disk and we disconnected that 1 disk.

After a while there was again more than 3 TB free so we decided to use that script again. But when we tried it again we got the error ;

Set-DPMProtectionGroup : D:\ has recently been migrated. You cannot migrate D:\ again until the recovery points on the previous replica volume are available. (ID: 31224)

At that point we let it rest for a while, but the last few weeks I tried it again and I keep getting the same errors.

PS C:\Program Files\Microsoft DPM\DPM\bin> MigrateDatasourceDataFromDPM.ps1 -DPMServerName dpmserver01 -Source $disk[1] -Destination $disk[0,2,3,4]
Set-DPMProtectionGroup : D:\ has recently been migrated. You cannot migrate D:\ again until the recovery points on the previous replica volume are available. (ID: 31224)
At C:\Program Files\Microsoft DPM\DPM\bin\MigrateDatasourceDataFromDPM.ps1:108 char:22
+         Set-ProtectionGroup <<<<  $mpg
    + CategoryInfo          : NotSpecified: (:) [Set-DPMProtectionGroup], DlsException
    + FullyQualifiedErrorId : ChainedMigrationError,Microsoft.Internal.EnterpriseStorage.Dls.UI.Cmdlet.ProtectionCmdLets.CommitProtectionGroup
Remove-DPMDisk : Disk 6 cannot be removed from the storage pool because it contains storage pool volumes. (ID: 355)
At C:\Program Files\Microsoft DPM\DPM\bin\MigrateDatasourceDataFromDPM.ps1:110 char:16
+     Remove-DPMDisk <<<<  $Source
    + CategoryInfo          : NotSpecified: (:) [Remove-DPMDisk], InvalidDiskException
    + FullyQualifiedErrorId : DiskContainsSpmVolumes,Microsoft.Internal.EnterpriseStorage.Dls.UI.Cmdlet.RemoveDPMDisk

We have waited several months now so we are certain that there are no old recovery point left. But still we keep getting these errors. We also ran pruneshadowcopiesDpm2010.ps1, but this does not resolve the issue. I've tried out several scripts to find old recoverypoints/shadowcopies that would cause this, but I can not discover why this is happening. Doe anyone have an idea how I can solve this?



  • Edited by Peter Camps Thursday, May 02, 2013 12:29 PM
May 2nd, 2013 3:20pm

Hi,

Each datasource can only have a maximum of two disk sets (replic volume and recovery point volume) associated with it at any one time.  The original migrated pair, plus the new disk set created at time of migration.  When the old recovery points expire from the original replica, DPM should delete the old migrated volume pair so you only have a single disk set.  It sounds like there is a dangling sql record that is associated with that one data source that shows there are still two pairs.   There is nothing I can suggest to get you out of that condition in the forum other than to delete that data source and delete replica, then re-protect it.  That will make a new data source record.  If that is unacceptable solution, then please open a support ticket to help find and remove the dangling sql record that is preventing migration. 

Free Windows Admin Tool Kit Click here and download it now
May 3rd, 2013 9:28pm

Hi Mike,

Thank you for your reply. Unfortunately re-protecting is no option, I would need to delete the complete backup of all company data to make this possible. We'll just have to accept that we are using a lot of extra diskspace for this customer. I will have a talk with my collegue and decide if we want to open a support ticket to have this issue resolved.

Thanks again.

May 6th, 2013 1:22pm

is there a way to solve this? We are having the same issue.

thank you

Free Windows Admin Tool Kit Click here and download it now
May 24th, 2013 3:30pm

Hi,

This may help, we have found a stored procedure that needed updating.  Please open sql management studio, connect to the dpm instance, then run the below query to update the stored procedure.  Once that is updated, run the Pruneshadowcopiesdpm2010.ps1 from the DPM power shell and see if that cleans up the dangling volumes.

USE [DPMDB]
GO
/****** Object:  StoredProcedure [dbo].[prc_RM_ReplicaDataset_GetValidDatasetCountOnPhysicalReplica]    Script Date: 05/24/2013 10:08:13 ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO

-- Returns the number of valid datasets for that datasource on the physical replica for the given datasource
ALTER PROCEDURE [dbo].[prc_RM_ReplicaDataset_GetValidDatasetCountOnPhysicalReplica]
(
  @DatasourceId GUID,
  @ReplicaId GUID
)
AS
    DECLARE @error int
    SET @error = 0
    
    SET NOCOUNT ON

SELECT COUNT(Dataset.DatasetId)
      FROM dbo.tbl_RM_ReplicaDataset AS Dataset
      LEFT OUTER JOIN tbl_RM_ShadowCopy ShadowCopy
            ON ShadowCopy.ShadowCopyId = Dataset.ShadowCopyId
      JOIN dbo.tbl_RM_RecoverySource AS RecoverySource
            ON Dataset.DatasetId = RecoverySource.DatasetId
      JOIN tbl_PRM_LogicalReplica ReplicaDS
            ON Dataset.ReplicaId = ReplicaDS.ReplicaId
      WHERE ReplicaDS.PhysicalReplicaId = @ReplicaId AND
      ReplicaDS.DatasourceId = @DatasourceId AND
      ReplicaDS.Validity <> 4 AND     -- not destroyed
      ((RecoverySource.WriterId != '00000000-0000-0000-0000-000000000000' AND     -- File system
        RecoverySource.WriterId != '7B2E4C3D-876F-4535-B5C9-B344D4F05120' AND     -- Disconnected client
        Dataset.ShadowCopyId IS NULL) OR -- App data sets can be valid without shadow copies
      ShadowCopy.Validity = 2) AND
      RecoverySource.IsValid = 1 AND
      RecoverySource.IsGCed = 0 AND
      ReplicaDS.IsGCed = 0 AND
      (ShadowCopy.IsGCed = 0 OR ShadowCopy.IsGCed IS NULL) AND
      Dataset.IsGCed = 0

          
    SET @error = @@ERROR
    SET NOCOUNT OFF

    RETURN @error

May 24th, 2013 6:23pm

Hi Mike,

Just to make sure, is this applicable to DPM2012SP1 as well?

Thanks!

Free Windows Admin Tool Kit Click here and download it now
May 24th, 2013 7:28pm

Yes, DPM 2012 Sp1 also has the same stored procedure problem.
May 24th, 2013 8:20pm

Hi Mike,

a quick update on the issue: during the weekends I executed the SQL script and the Pruneshadowcopiesdpm2010.ps1 which took around 20-25 mins to complete. I presume that the MigrateDatasourceDataFromDPM.ps1 script will put some load on our SAN (we want to move the storage which currently resides on the SAN to a newly installed local attached storage pool) so that requires me to inform my client and request a new time windows which is most convenient for our client. If everything goes well I should get that time windows this week and I will let you know the result.

Thanks in advance and I'll keep you posted.

Didier

Free Windows Admin Tool Kit Click here and download it now
May 27th, 2013 12:58pm

Mike, hereby the feedback as promised. Unfortunately the problem does not appear to be solved. The script runs for around 5 mins and after 5 mins I get the same message again. These first 5 minutes I do see activity on our storage so it starts doing something.

Your help is greatly appreciated Mike , if we can fix this I'll send you a nice bottle of belgian beer!

PS C:\Program Files\Microsoft System Center 2012\DPM\DPM\bin> .\MigrateDatasourceDataFromDPM.ps1 -DPMServerName APP32 -Source $disk[2] -Destination $d
isk[1]
Set-DPMProtectionGroup : C:\ has recently been migrated. You cannot migrate C:\ again until the recovery points on the previous replica volume are av
ailable. (ID: 31224)
At C:\Program Files\Microsoft System Center 2012\DPM\DPM\bin\MigrateDatasourceDataFromDPM.ps1:111 char:22
+         Set-ProtectionGroup <<<<  $mpg
    + CategoryInfo          : NotSpecified: (:) [Set-DPMProtectionGroup], DlsException
    + FullyQualifiedErrorId : ChainedMigrationError,Microsoft.Internal.EnterpriseStorage.Dls.UI.Cmdlet.ProtectionCmdLets.CommitProtectionGroup
Remove-DPMDisk : Disk 2 cannot be removed from the storage pool because it contains storage pool volumes. (ID: 355)
At C:\Program Files\Microsoft System Center 2012\DPM\DPM\bin\MigrateDatasourceDataFromDPM.ps1:113 char:16
+     Remove-DPMDisk <<<<  $Source
    + CategoryInfo          : NotSpecified: (:) [Remove-DPMDisk], InvalidDiskException
    + FullyQualifiedErrorId : DiskContainsSpmVolumes,Microsoft.Internal.EnterpriseStorage.Dls.UI.Cmdlet.RemoveDPMDisk
PS C:\Program Files\Microsoft System Center 2012\DPM\DPM\bin>

May 28th, 2013 2:59pm

ps: forgot to mention:

PS C:\Program Files\Microsoft System Center 2012\DPM\DPM\bin> Get-DPMDisk -DPMServerName APP32
WARNING: Connecting to DPM server: APP32

Name                     DiskStatus                               NtDiskId       TotalCapacityLabel    UnallocatedSpaceLabel DiskTypeLabel
----                     ----------                               --------       ------------------    --------------------- -------------
EQLOGIC 100E-00  Mult... Healthy                                         4                     0 GB                     0 GB Uninitialized
DELL PERC 6/i SCSI Di... Healthy                                         1                 13037 GB                 12106 GB Dynamic
EQLOGIC 100E-00  Mult... Healthy                                         2                 10239 GB                  3454 GB Dynamic

Free Windows Admin Tool Kit Click here and download it now
May 28th, 2013 3:03pm

Hello Mike,

I just ran the SQL Query, did a reboot of the server, then the command pruneshadowcopiesDpm2010.ps1 ran for about 5 minutes.

I ran the MigrateDatasourceDataFromDPM.ps1 and it was succesfull. The disk is removed from the DPM storage pool.

Thank you very much for the support and the suggested solution.

P.S. Didier, hope you find a solution as well.

May 31st, 2013 6:01pm

Hi Didier,

I will need to look into the error when we hit an already migrated data source, we should be able to ignore it and try the next datasource.  In the meantime, you can migrate each datasource one at a time and after migrating all of them, be sure to create filler volumes on the disk you want to remove once DPM expires the RP's and deletes the volumes.  That way DPM will not re-use that free space for any future extensions or new datasources additions.  Once it's all freed up, you can remove it from the storage pool.

Free Windows Admin Tool Kit Click here and download it now
May 31st, 2013 6:56pm

Would this stored procedure only solve issues with a second diskmigration, or does it include a scenario where the nightly scheduled pruneshadowcopes2010 just hangs, never exiting? dpm 2012 UR3
June 5th, 2013 1:44pm

The updated stored procedure has nothing to do with disk migration per say, it just helps prune old shadow copies that normally would be deleted, but are not.  DPM will only remove old migrated volumes once all recovery points are expired and pruned.  Once the old migrated volumes are deleted, then a 2nd migration can take place. 
Free Windows Admin Tool Kit Click here and download it now
June 5th, 2013 7:03pm

Hello,


Didier open a case to MS Support and I handle it. After took a DPM Trace, we notice that the migration failed due to Chained migration error. In fact, a DS was presente and spanned on both disk. After migrating manually the DS to the new disk:

$ds = Get-Datasource -DPMServerName <DPMSERVER> Where-Object {$_.Computer -eq "DS" -and $_.Name -eq "X:\"}

$disks = Get-DPMDisk

.\MigrateDatasourceDataFromDPM.ps1 -DPMServerName <DPMSERVER>-Source $ds -Destination $disks[1]

Finally the migration from old disk to the new disk was succesfull.

Regards

Carlos Carrolo (MSFT)

June 10th, 2013 12:21pm

Hi Mike,

do this also work for DPM 2012 R2 4.2.1273.0

Regards

Sebastian

Free Windows Admin Tool Kit Click here and download it now
January 28th, 2015 10:12am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics