ResizeStoragePool.ps1
このソースの解説はこちらから。
【Management】DPM2007 管理シェルで保護領域の容量不足を回避する その2
*************************
param([string] $DPMServerName)
if(!$DPMServerName)
{
$DPMServerName = read-host "DPMServerName:"
}
$dpmserver=Connect-DPMServer $dpmservername
$PGList = @(Get-ProtectionGroup $dpmservername)
foreach($PG in $PGList)
{
$MPG = Get-ModifiableProtectionGroup $PG
$ModifiableProtectionGroupName = $MPG.FriendlyName
Write-Host "保護グループ::$ModifiableProtectionGroupName"
$dslist=@(get-datasource $MPG)
foreach ($ds in $dslist)
{
$DataSourceName = $ds.Name
$RecentReplicaSize = $ds.ReplicaSize
$RecentReplicaUsedSpace = $ds.ReplicaUsedSpace
$RecentReplicaUsedPercent = $RecentReplicaUsedSpace / $RecentReplicaSize * 100
$RecentShadowCopyAreaSize = $ds.ShadowCopyAreaSize
$RecentShadowCopyUsedSpace = $ds.ShadowCopyUsedSpace
$RecentShadowCopyUsedPercent = $RecentShadowCopyUsedSpace / $RecentShadowCopyAreaSize * 100
Write-Host "- データソース::$DataSourceName"
Write-Host "-- 現在のレプリカサイズ ::$RecentReplicaSize ($RecentReplicaUsedSpace) $RecentReplicaUsedPercent %"
Write-Host "-- 現在のシャドウコピーサイズ::$RecentShadowCopyAreaSize ($RecentShadowCopyUsedSpace) $RecentShadowCopyUsedPercent %"
if($ds.ReplicaSize * 0.9 -lt $ds.ReplicaUsedSpace)
{
$NewReplicaSize = $ds.ReplicaSize * 1.5
Set-DatasourceDiskAllocation -Manual -Datasource $ds -ProtectionGroup $MPG -ReplicaArea $NewReplicaSize
Set-ProtectionGroup $MPG
$RecentReplicaSize = $NewReplicaSize
$RecentReplicaUsedPercent = $RecentReplicaUsedSpace / $RecentReplicaSize * 100
Write-Host "---- 新しいレプリカサイズ ::$RecentReplicaSize ($RecentReplicaUsedSpace) $RecentReplicaUsedPercent %"
}
if($ds.ShadowCopyAreaSize * 0.9 -lt $ds.ShadowCopyUsedSpace)
{
$NewSCSize = $ds.ShadowCopyAreaSize * 1.5
Set-DatasourceDiskAllocation -Manual -Datasource $ds -ProtectionGroup $MPG -ShadowCopyArea $NewSCSize
Set-ProtectionGroup $MPG
$RecentShadowCopyAreaSize = $NewSCSize
$RecentShadowCopyUsedPercent = $RecentShadowCopyUsedSpace / $RecentShadowCopyAreaSize * 100
Write-Host "---- 新しいシャドウコピーサイズ::$RecentShadowCopyAreaSize ($RecentShadowCopyUsedSpace) $RecentShadowCopyUsedPercent %"
}
}
}
Disconnect-DPMServer $dpmservername
Comments
Anonymous
January 01, 2003
※2008/8/27 に「【Management】DPM2007 管理シェルで保護領域不足を回避する」というタイトルで登校した記事のリフレッシュ版です Data Protection Manager 2007Anonymous
January 01, 2003
※2008/8/27 に「【Management】DPM2007 管理シェルで保護領域不足を回避する」というタイトルで投稿した記事のリフレッシュ版です Data Protection Manager 2007