none
Co-located data disk usage per protected data source RRS feed

  • Question

  • Hi

    Is there a way to get the information about actual disk usage of individual protected data source on a co-located volume?

    Thanks, Grega


    Grega

    Thursday, July 4, 2013 10:11 AM

Answers

  • Hi,

    This DPM power shell script will show individual data source disk usage for all data sources including co-located.

    cls
    $color = 'white' 
    $pg = Get-ProtectionGroup (&hostname) 
    foreach ($pg1 in $pg)
    {
    	write-host "Protection Group " $pg1.friendlyname -f yellow
    	$ds = @(Get-Datasource $pg1 | sort-object -Property replicapath)
    	$count = 0
    	write-host
    	write-host  "   Colocated Replica Size        Used Datasource Name"
    	write-host  "   --------- ------------ ----------- --------------------------"
    	while ($count -lt $ds.count)
    	{
    		$dscolocation = @($ds | ? { $_.replicapath -eq $ds[$count].replicapath })
    		if ($dscolocation.count -gt 1)
    		{
    			foreach ($dc in $dscolocation)
    			{
    				$split = $dscolocation[0].diskallocation -split ' '
    				$rs = $split[3] + " " + $split[4] # replica size
    				$size = (Get-ChildItem $dc.ProtectableObjectLoadPath.values -recurse | Measure-Object -property length -sum).sum /1024/1024/1024
    				write-host ("   Yes  {0,17} {1,8:N2} GB {2,-50}" -f $rs, $size, $dc.DisplayPath) -f $color
    				$count++
    			}
    		}
    		else
    		{
    			$split = $dscolocation[0].diskallocation -split ' '
    			$rs = $split[2] + " " + $split[3] # replica size
    			$ru = $split[5] + " " + $split[6] # replica used by the datasource
    			write-host  ("   No   {0,17} {1,11} {2,-50}" -f $rs, $ru, $dscolocation[0].DisplayPath) -f $color
    			$count++
    		}
    		if ($color -eq 'white') { $color = 'cyan'} else { $color = 'white'}
    	}
    	write-host
    }
    
    


    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.

    Thursday, July 4, 2013 7:09 PM
    Moderator

All replies

  • Hi,

    This DPM power shell script will show individual data source disk usage for all data sources including co-located.

    cls
    $color = 'white' 
    $pg = Get-ProtectionGroup (&hostname) 
    foreach ($pg1 in $pg)
    {
    	write-host "Protection Group " $pg1.friendlyname -f yellow
    	$ds = @(Get-Datasource $pg1 | sort-object -Property replicapath)
    	$count = 0
    	write-host
    	write-host  "   Colocated Replica Size        Used Datasource Name"
    	write-host  "   --------- ------------ ----------- --------------------------"
    	while ($count -lt $ds.count)
    	{
    		$dscolocation = @($ds | ? { $_.replicapath -eq $ds[$count].replicapath })
    		if ($dscolocation.count -gt 1)
    		{
    			foreach ($dc in $dscolocation)
    			{
    				$split = $dscolocation[0].diskallocation -split ' '
    				$rs = $split[3] + " " + $split[4] # replica size
    				$size = (Get-ChildItem $dc.ProtectableObjectLoadPath.values -recurse | Measure-Object -property length -sum).sum /1024/1024/1024
    				write-host ("   Yes  {0,17} {1,8:N2} GB {2,-50}" -f $rs, $size, $dc.DisplayPath) -f $color
    				$count++
    			}
    		}
    		else
    		{
    			$split = $dscolocation[0].diskallocation -split ' '
    			$rs = $split[2] + " " + $split[3] # replica size
    			$ru = $split[5] + " " + $split[6] # replica used by the datasource
    			write-host  ("   No   {0,17} {1,11} {2,-50}" -f $rs, $ru, $dscolocation[0].DisplayPath) -f $color
    			$count++
    		}
    		if ($color -eq 'white') { $color = 'cyan'} else { $color = 'white'}
    	}
    	write-host
    }
    
    


    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.

    Thursday, July 4, 2013 7:09 PM
    Moderator
  • Hi Mike

    Thanks for your response. The script works fine. I just had to modify a small chunk of it to correctly display the data for the SQL databases, where they reside on more then 1 volume.

    Your script displays the replica volume size. Is there a way to get a shadow copy size?

    Thanks,

    Grega


    Grega

    Tuesday, July 9, 2013 11:29 AM
  • Hi,

    All VM's that are co-located on the replica share the same recovery points, so the recovery point volume usage is for all VM's.


    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, July 9, 2013 3:23 PM
    Moderator
  • Hi Mike

    And there is no way to see which one takes how much space? Is it the same with SQL databases?

    Thanks, Grega


    Grega

    Tuesday, July 9, 2013 9:48 PM
  • Hi,

    VSS snapshots are at the volume level, so any block level changes for any files on the replica volume get tracked and Volsnap copy-on-write (COW) operation stores the blocks on the recovery point volume in a snapshot file. There is one snapshot file for each DPM recovery point.  When you run vssadmin list shadows, the shadow copies listed are for the entire replica volume(s).


    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, July 9, 2013 10:37 PM
    Moderator
  • Hi Mike

    I apologize for asking so much ... If I understand correctly, each file represents one recovery point (except for the latest) for the protected source and they are all located on the same volume? Is there a way to get to these files' properties and get a file size? I guess it would be possible to link the IDs to the replica and therefore get the information about disk usage for a specific protected source (replica volume + recovery points).

    What happenes when you also store transaction logs? Where are they stored?

    Thanks, Grega


    Grega

    Thursday, July 11, 2013 11:01 AM
  • Hi,

    The VSS Snapshot files only store chunks of changed files, there is no "changed" file list that can be extracted from them. 

    All protected data is always stored on the replica volume.  In the case of application data, logs files are brought over and placed in subfolders between express full backups. After express full backup completes a VSS snapshot is taken then the logs are deleted from the replica to make room for new incremental log files.  As the free space that was once consumed by the old logs files gets overwritten with new log files, VSS COW writes those blocks into the shadow copy so we can always restore them from under recovery tab.

    Your best bet is to make custom filter and see how much data is being transferred during every recovery point for each data source, those changes that are brought over will eventually make it into the VSS shadow copy (recovery point) volume.


    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.

    Thursday, July 11, 2013 2:43 PM
    Moderator