Ever came in the situation of a fast growing environment and your backup disks are getting fuller and fuller, till the point you need to move datasources to a new added disk?
Well, I got sick and tired of moving datasources manually using MigrateDatasourceDataFromDPM.ps1, so I wrote a powershell script.
You only need to edit the upper part of the script to your needs.
$Protectiongroupname = "Exchange 2013"
#"Disk to move from" free space percentage. When free space under this number -> distribute datasources
$Disktomovefromperc = 5
#"Disk to move to" free space percentage, only move datasources to disks with higher free space percentages.
$Disktomovetoperc = 10
#Free disk space marge in GB to keep on the disk after a datasource migration
$FreediskspacemargeGB = 25
The above settings represents the following situation:
If the free space on a disk is below 5%, move datasource to a disk with at least 10% free space where after the move of the datasource still 25GB free space is left.
In the Data Protection Manager console you will see a new job in progress with the type “Post-recovery opertation”.
This is the job that moves the datasource from the source disk to the destination disk.
The script has 3 build-in powershell functions:
Get the disk where the free space percentage is below the $Disktomovefromperc setting
Get the disk where the free space percentage is above the $Disktomovetoperc setting
Get the datasource on the disk found using the Get-MoveFromDisk function.
Get a disk using the Get-MovetoDisk function that would fit the datasource + the marge
Moves the datasource using the MigrateDatasourceDataFromDPM.ps1 script from Microsoft to an other disk.
You can download the script >>HERE<<
or on the TechNet gallery: http://gallery.technet.microsoft.com/Distribute-Datasources-3c89c598
You can easly schedule this script to run after your backup window, the distribution only creates load on the DPM server and your storage.. not on the client computer.
The script does only one datasource move at the time, because the job fails if you fire off a second datasource move job at the same computer.
Make sure you don’t schedule the script in a to little timeframe otherwise a second job will start and kill the first one, maybe I will build in a check on this in the future.
ps. @Powershell guru’s: It’s impossible to get the datasources that are on a disk with a clean powershell cmdlet, the DPM console shows it great but I’m guessing it gets it from the database.
a “get-dpmdisk | get-datasource” that actually works would be great, if there’s someone with a solution to this, please let me know 🙂